-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[APM] Kibana errors on "constructor" keyword in APM stack trace documents #99526
Comments
Pinging @elastic/apm-ui (Team:apm) |
Hi @adpeters Thanks for the detailed report. Can you add a screenshot of the error so we have the full context? Thanks. |
Hi @sqren, thanks for responding. Here's a screenshot of the error showing up in Kibana: Let me know if you need any other information or have any suggestions! |
Great, thanks. One more thing: can you add a sample document that causes this issue?
|
Sure, here's a sample error document: |
Great, I can repro now with the following:
|
@watson I think you have some context here. You added some security hardening in Kibana that prevents certain reserved keywords (like "constructor") and thus causes the following error: {
"statusCode": 500,
"error": "Internal Server Error",
"message": "Object contains forbidden prototype property",
} How should we treat APM data that contains the "constructor" keyword? |
Sorry, I completely missed this initially. I agree, it looks like this is caused by the elasticsearch client. |
This should be solved by upgrading to the latest elasticsearch client. Kibana is working on this in #98266 and I expect that to solve it. |
Versions
Kibana: 7.12.1
APM Server: 7.12.1
Elasticsearch: 7.12.1
Kibana cannot view certain error documents sent by APM. I am using the latest python APM agent (6.1.3) with a Flask application. When there are error stack traces sent by APM the documents contain the variables at the time of the error, which sometimes contain a "constructor" field. In particular, in my case this is true for SQL-Alchemy errors, but it could exist in many cases. With recent changes to the elasticsearch-js library, Kibana errors when trying to parse these documents, so they cannot be viewed in the APM error view. I believe this is related to elastic/elasticsearch-js#1408. There is a configuration value for that library to get around this issue by allowing the "constructor" keyword, but I'm not sure if there's a way to specify this configuration in Kibana.
A simple way to reproduce this is:
The error in the Kibana logs is:
{"type":"log","@timestamp":"2021-05-06T16:43:44+00:00","tags":["error","http"],"pid":6,"message":"WrappedElasticsearchClientError: Object contains forbidden prototype property\n at /usr/share/kibana/x-pack/plugins/observability/server/utils/unwrap_es_response.js:66:11\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at /usr/share/kibana/x-pack/plugins/apm/server/lib/errors/get_error_group_sample.js:75:18\n at /usr/share/kibana/x-pack/plugins/apm/server/routes/create_api/index.js:180:26\n at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:163:30)\n at handler (/usr/share/kibana/src/core/server/http/router/router.js:124:50)\n at exports.Manager.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)\n at Object.internals.handler (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)\n at exports.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)\n at Request._lifecycle (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:370:32)\n at Request._execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:279:9) {\n originalError: DeserializationError: Object contains forbidden prototype property\n at Serializer.deserialize (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Serializer.js:43:13)\n at onBody (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:299:41)\n at IncomingMessage.onEnd (/usr/share/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:260:11)\n at IncomingMessage.emit (events.js:327:22)\n at endReadableNT (internal/streams/readable.js:1327:12)\n at processTicksAndRejections (internal/process/task_queues.js:80:21)..."}
I'm not sure exactly where the best place to address this issue is, or if there is a configuration workaround of some sort.
The text was updated successfully, but these errors were encountered: