You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have reproduced this in our deployment, issue is not related to calling report directly, but comes from stacktrace-gps producing invalid function names.
Example response:
{
"error": {
"code": 400,
"message": "ReportedErrorEvent.context must contain a location unless `message` contain an exception or stacktrace.",
"status": "INVALID_ARGUMENT"
}
}
Example message from request:
TypeError: Cannot read property 'removeLayer' of null
at window.setTimeout(function (webpack:///node_modules/prunecluster/dist/PruneCluster.js:938:0)
This would be correctly reported as <anonymous> but has instead given 'window.setTimeout(function' as the function name.
Workarounds at the stackdriver-errors-js level are possible, if a bit awkward? Could use something like isVarName to strip out badly detection function names.
{
"serviceContext":{"service":"web"},
"context":{"httpRequest":{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36","url":"https://app.DOMAIN.com/tracks/91"}},
"message":"TypeError: Cannot read property 'querySelectorAll' of null\n at _loadArchivedCards(t){this.store.dispatch(Object(h.g)(this.stage.trackId,{stageId:this.stage.id,archived:!0})).then(()=>{Object(F.a) (https://app.DOMAIN.com/6.49bfb0b2404f25c0f4e0.bundle.js:515:1420)"
}
Response:
{
"error": {
"code": 400,
"message": "ReportedErrorEvent.context must contain a location unless `message` contain an exception or stacktrace.",
"status": "INVALID_ARGUMENT"
}
}
Activity
steren commentedon Jan 22, 2019
It seems that the
messageattribute is not recognized as being an exception by Stackdriver Error Reporting.Stackdriber Error Reporting expects stacktraces formatted as such
Would you mind providing an exact sample that reproduces the issue?
murphyke commentedon Jan 22, 2019
I am cranking for a deadline but will make a reminder to look at this ... hopefully next week.
bz2 commentedon Jun 11, 2019
I have reproduced this in our deployment, issue is not related to calling report directly, but comes from
stacktrace-gpsproducing invalid function names.Example response:
{ "error": { "code": 400, "message": "ReportedErrorEvent.context must contain a location unless `message` contain an exception or stacktrace.", "status": "INVALID_ARGUMENT" } }Example message from request:
The section of code from PruneCluster:
This would be correctly reported as
<anonymous>but has instead given'window.setTimeout(function'as the function name.Workarounds at the stackdriver-errors-js level are possible, if a bit awkward? Could use something like isVarName to strip out badly detection function names.
See also stacktracejs/stacktrace-gps#54 which is another problem with this part of the JS parsing.
ernsheong commentedon Jul 24, 2021
Seeing something similar in 0.8.0:
Payload:
Response: