Closed
Bug 1184688
Opened 10 years ago
Closed 9 years ago
Accept RavenJS crashes
Categories
(Socorro :: General, task)
Socorro
General
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: peterbe, Unassigned)
Details
I installed RavenJS (and angular-raven since this was an angular app) and let it report errors. When an error happens it causes this request to be made:
curl 'https://errormill.mozilla.org/api/59/store/?sentry_version=4&sentry_client=raven-js/1.1.19&sentry_key=204938957a7c41d5b6dd2e109effbb98&sentry_data=%7B%22project%22%3A%2259%22%2C%22logger%22%3A%22javascript%22%2C%22platform%22%3A%22javascript%22%2C%22request%22%3A%7B%22url%22%3A%22http%3A%2F%2Flocalhost%3A8000%2F%23textarea%22%2C%22headers%22%3A%7B%22User-Agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010.10%3B%20rv%3A41.0)%20Gecko%2F20100101%20Firefox%2F41.0%22%7D%7D%2C%22exception%22%3A%7B%22type%22%3A%22ReferenceError%22%2C%22value%22%3A%22bar%20is%20not%20defined%22%7D%2C%22stacktrace%22%3A%7B%22frames%22%3A%5B%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A802%2C%22colno%22%3A46%2C%22function%22%3A%22Gf%2Fc%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A1017%2C%22colno%22%3A444%2C%22function%22%3A%22Jc%5Bc%5D%3C%2F%3C.compile%2F%3C%2F%3C%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A901%2C%22colno%22%3A304%2C%22function%22%3A%22hf%2Fthis.%24get%3C%2Fm.prototype.%24apply%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A901%2C%22colno%22%3A79%2C%22function%22%3A%22hf%2Fthis.%24get%3C%2Fm.prototype.%24eval%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A1017%2C%22colno%22%3A394%2C%22function%22%3A%22Jc%5Bc%5D%3C%2F%3C.compile%2F%3C%2F%3C%2Ff%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%20line%20977%20%3E%20Function%22%2C%22lineno%22%3A2%2C%22colno%22%3A242%2C%22function%22%3A%22anonymous%2Ffn%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A3121%2C%22colno%22%3A9%2C%22function%22%3A%22%24scope.toggleShowWarnings%22%2C%22in_app%22%3Atrue%7D%5D%7D%2C%22culprit%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22message%22%3A%22bar%20is%20not%20defined%22%2C%22extra%22%3A%7B%22session%3Aduration%22%3A5155%7D%2C%22event_id%22%3A%229556212aafeb479d8cf3b24b092d4ce2%22%7D' -H 'Host: errormill.mozilla.org' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 Firefox/41.0' -H 'Accept: image/png,image/*;q=0.8,*/*;q=0.5' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://localhost:8000/' -H 'Origin: http://localhost:8000' -H 'Connection: keep-alive' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache'
I have the Firefox web console convert it to a curl command.
The parameters, sent as query string, are:
sentry_version=4
sentry_client=raven-js/1.1.19
sentry_key=204938957a7c41d5b6dd2e109effbb98
sentry_data=%7B%22project%22%3A%2259%22%2C%22logger%22%3A%22javascript%22%2C%22platform%22%3A%22javascript%22%2C%22request%22%3A%7B%22url%22%3A%22http%3A%2F%2Flocalhost%3A8000%2F%23textarea%22%2C%22headers%22%3A%7B%22User-Agent%22%3A%22Mozilla%2F5.0%20(Macintosh%3B%20Intel%20Mac%20OS%20X%2010.10%3B%20rv%3A41.0)%20Gecko%2F20100101%20Firefox%2F41.0%22%7D%7D%2C%22exception%22%3A%7B%22type%22%3A%22ReferenceError%22%2C%22value%22%3A%22bar%20is%20not%20defined%22%7D%2C%22stacktrace%22%3A%7B%22frames%22%3A%5B%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A802%2C%22colno%22%3A46%2C%22function%22%3A%22Gf%2Fc%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A1017%2C%22colno%22%3A444%2C%22function%22%3A%22Jc%5Bc%5D%3C%2F%3C.compile%2F%3C%2F%3C%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A901%2C%22colno%22%3A304%2C%22function%22%3A%22hf%2Fthis.%24get%3C%2Fm.prototype.%24apply%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A901%2C%22colno%22%3A79%2C%22function%22%3A%22hf%2Fthis.%24get%3C%2Fm.prototype.%24eval%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A1017%2C%22colno%22%3A394%2C%22function%22%3A%22Jc%5Bc%5D%3C%2F%3C.compile%2F%3C%2F%3C%2Ff%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%20line%20977%20%3E%20Function%22%2C%22lineno%22%3A2%2C%22colno%22%3A242%2C%22function%22%3A%22anonymous%2Ffn%22%2C%22in_app%22%3Atrue%7D%2C%7B%22filename%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22lineno%22%3A3121%2C%22colno%22%3A9%2C%22function%22%3A%22%24scope.toggleShowWarnings%22%2C%22in_app%22%3Atrue%7D%5D%7D%2C%22culprit%22%3A%22http%3A%2F%2Flocalhost%3A8000%2Fjs%2Fapp.js%22%2C%22message%22%3A%22bar%20is%20not%20defined%22%2C%22extra%22%3A%7B%22session%3Aduration%22%3A5155%7D%2C%22event_id%22%3A%229556212aafeb479d8cf3b24b092d4ce2%22%7D
Converted to a Python dict the values are::
{'sentry_client': 'raven-js/1.1.19',
'sentry_data': '{"project":"59","logger":"javascript","platform":"javascript","request":{"url":"http://localhost:8000/#textarea","headers":{"User-Agent":"Mozilla/5.0 '
'(Macintosh; Intel Mac OS X 10.10; rv:41.0) Gecko/20100101 '
'Firefox/41.0"}},"exception":{"type":"ReferenceError","value":"bar '
'is not '
'defined"},"stacktrace":{"frames":[{"filename":"http://localhost:8000/js/app.js","lineno":802,"colno":46,"function":"Gf/c","in_app":true},{"filename":"http://localhost:8000/js/app.js","lineno":1017,"colno":444,"function":"Jc[c]</<.compile/</<","in_app":true},{"filename":"http://localhost:8000/js/app.js","lineno":901,"colno":304,"function":"hf/this.$get</m.prototype.$apply","in_app":true},{"filename":"http://localhost:8000/js/app.js","lineno":901,"colno":79,"function":"hf/this.$get</m.prototype.$eval","in_app":true},{"filename":"http://localhost:8000/js/app.js","lineno":1017,"colno":394,"function":"Jc[c]</<.compile/</</f","in_app":true},{"filename":"http://localhost:8000/js/app.js '
'line 977 > '
'Function","lineno":2,"colno":242,"function":"anonymous/fn","in_app":true},{"filename":"http://localhost:8000/js/app.js","lineno":3121,"colno":9,"function":"$scope.toggleShowWarnings","in_app":true}]},"culprit":"http://localhost:8000/js/app.js","message":"bar '
'is not '
'defined","extra":{"session:duration":5155},"event_id":"9556212aafeb479d8cf3b24b092d4ce2"}',
'sentry_key': '204938957a7c41d5b6dd2e109effbb98',
'sentry_version': '4'}
If we convert that `sentry_data` key, to a Python dict we get::
>>> pprint(sentry_data)
{'culprit': 'http://localhost:8000/js/app.js',
'event_id': '9556212aafeb479d8cf3b24b092d4ce2',
'exception': {'type': 'ReferenceError', 'value': 'bar is not defined'},
'extra': {'session:duration': 5155},
'logger': 'javascript',
'message': 'bar is not defined',
'platform': 'javascript',
'project': '59',
'request': {'headers': {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac '
'OS X 10.10; rv:41.0) '
'Gecko/20100101 Firefox/41.0'},
'url': 'http://localhost:8000/#textarea'},
'stacktrace': {'frames': [{'colno': 46,
'filename': 'http://localhost:8000/js/app.js',
'function': 'Gf/c',
'in_app': True,
'lineno': 802},
{'colno': 444,
'filename': 'http://localhost:8000/js/app.js',
'function': 'Jc[c]</<.compile/</<',
'in_app': True,
'lineno': 1017},
{'colno': 304,
'filename': 'http://localhost:8000/js/app.js',
'function': 'hf/this.$get</m.prototype.$apply',
'in_app': True,
'lineno': 901},
{'colno': 79,
'filename': 'http://localhost:8000/js/app.js',
'function': 'hf/this.$get</m.prototype.$eval',
'in_app': True,
'lineno': 901},
{'colno': 394,
'filename': 'http://localhost:8000/js/app.js',
'function': 'Jc[c]</<.compile/</</f',
'in_app': True,
'lineno': 1017},
{'colno': 242,
'filename': 'http://localhost:8000/js/app.js '
'line 977 > Function',
'function': 'anonymous/fn',
'in_app': True,
'lineno': 2},
{'colno': 9,
'filename': 'http://localhost:8000/js/app.js',
'function': '$scope.toggleShowWarnings',
'in_app': True,
'lineno': 3121}]}}
| Reporter | ||
Comment 1•10 years ago
|
||
So the curl command would be a great start for development. If we can accept crashes like that it would be a good start.
There is however, a couple of things to consider.
* Note that it sends it with a GET (not a POST!) I guess that's to prevent the browser to do a pre-flight and checking for CORS headers.
* Sentry works by you having to specify which domains we should allow. You can set it to *.mozilla.org or www.mozilla.org or just *. In fact you can have multiple regexes for domains.
** I'm assuming they use the `Origin` header for the whitelist matching joint with a key.
* It's pretty amazing that you can now send the line number and column number. Given some sourcemap magic, you'd be able to write a very interesting stacktrace.
| Reporter | ||
Comment 2•10 years ago
|
||
NB: I used the latest RavenJS and it's unable to send samples to errormill.mozilla.org because it's so outdated.
Comment 3•10 years ago
|
||
If it's not too much trouble, GET and POST support would be good. Raven uses GET from the client but POST from everywhere else.
Comment 4•10 years ago
|
||
RavenJS specifically uses GET, but if we can transform the GET string and hook into the same mechanism underlying the POST easily that would save us a little time in the future and a follow on bug.
| Reporter | ||
Comment 5•9 years ago
|
||
Not an active project any more. If we're going to re-open the idea of accepting JavaScript crashes we might not use RavenJS so we'll start afresh that day.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•