-
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
Non-deterministic behavior while installing a package #75862
Comments
Pinging @elastic/ingest-management (Team:Ingest Management) |
@jfsiii You might know here as you spent some time on improving the error handling / error messaging. |
We have a ticket to improve error handling #66688 The issue description says a 500 code but I believe 'Bad Request' is a 400. I thought it might be an outdated package, but I see we are using 400 for unknown errors as well (for now, unknown errors will be 500 again soon) kibana/x-pack/plugins/ingest_manager/server/errors.ts Lines 22 to 26 in fec0d51
I'll look into it, especially regarding the error message, but @neptunian would better know what might be going on with the installation. |
@jfsiii I put more details about the error in this PR: elastic/package-storage#370 (comment) . It looks that it's reported as HTTP 500. |
I think the relevant parts of the proposal in #66688 for this situation are:
|
@skh @jfsiii Creating a package policy calls |
@neptunian But there must be some route handler handling the request triggering the error, is there a reason why we can't add error handling to that handler? |
@skh Yes, the handler is We have all this error handling specific to installing a package in the |
@skh agreed, I have a WIP at #74409 which does that @neptunian indeed, I've been in that code recently with #75372 and #74409. We don't want to incur the cost of creating/handling those new connections. We also may need to pass requests around to access current user info, etc. It'd be a big change in approach. We can talk about it more anywhere outside this ticket if you want. @mtojek I ran the |
Steps to reproduce it:
Actually you don't need to anything special, just try to serve and install the latest aws package even via the Kibana UI. |
@mtojek thanks, those are the steps I took before posting. I can see the tests failing w/500 vs 200, but I don't know how to stand up the same stack the tests are using and run HTTP / ES requests. Update: I just found https://github.com/elastic/package-storage/blob/master/testing/environments/README.md I ran those |
Steps for me or anyone else following along:
I can now reproduce this error with
Now I'll try to run a local kibana branch like https://github.com/jfsiii/kibana/tree/ingest-default-error-handler against this local registry and do what I can to improve the error reporting. I'll report back later today (I'm afk for a few more hours) |
Maybe I'm not afk :) I ran that registry locally in my https://github.com/jfsiii/kibana/tree/ingest-default-error-handler branch I ran this in one window
and saw this in the logs
Root cause aside, what status code and message would most helpful/appropriate for the response to |
@leehinman Does this error message look familiar? ^^ |
I think I've seen this message before with packages that contained pipelines in YAML format that were not accepted by elasticsearch for formatting reasons. This can be tested by trying to add the pipelines manually with What I've seen is that elasticsearch insists on the YAML file starting with |
jfsiii if you don't mind, I have assigned it to you. For the status code, this seems to be indeed a bad request (400) aka malformed request syntax, the elasticsearch error showed here could be propagated back? @ycombinator in the package-spec are we validating pipeline in the yaml format? |
Not at the moment but we plan to. The spec does define constraints for YAML files in the That being said, |
I will verify this. Thanks for heads up!
I wonder if the PR was green then or has been merged despite errors. |
I would say the most meaningful one: parsing exception around EDIT: To fully understand the problem. Is the line |
I have not been able to find out if elasticsearch is overly picky here, but if I'm not completely mistaken it does reject pipelines without it, so if this is valid YAML it would be a bug in elasticsearch. Please note that in Ingest Manager code on the Kibana side we don't look at the YAML at all. We can respond with "error adding pipeline to elasticsearch", but we will not know if the error was caused by a missing |
@mtojek (and others) how about this:
Another alternative is:
More info on the ES error responsesThe ES client failure is currently returning YAML inside the
I believe this is because it believes that's appropriate since we sent a YML request. I added an and put this in the Kibana logs
|
The first option is a bit vague:
The second option gives more details regarding the exception's reason, which is an ultimate root cause analysis (the field is duplicated). If it doesn't leak any confidential details, I would vote for this one. One more possible improvement would be providing filename of the affected ingest pipeline. |
(that's rather a side issue) @skh I'm not convinced if it's not a security threat, as the user might pass or upload a malformed document, which can blow up ES instance. We plan to install .zip files in the future, which may contain huge but compressed files that can cause OOM errors. I believe there should be some basic restrictions (file size, pipeline format verification, etc.). |
@mtojek This is touching several aspects.
A user who can install packages has enough privileges to upload documents through the dev console, or just use
Definitely. The feature to allow direct package upload is tracked here: #70582
The final authority whether a pipeline (or any other elasticsearch asset) is valid is elasticsearch itself. I'm not sure how much effort we should put into validation code on the Kibana side, for the following reasons:
That said, basic validation that assets are valid JSON, YAML etc. are of course useful. I'm more talking about the cases where the file syntax is valid, but the asset is still not acceptable to elasticsearch. |
I added the full response body to the message. It's now In this example, that becomes:
The endpoint that had the failure (
We could add some try/catch'es closer to the error in separate PRs but the error'ing endpoint & the response seems like a reasonable default. |
@jfsiii The returned error message looks good, thanks! I don't have any other comments regarding phrasing, I think you can proceed. |
What is the status of this issue @jfsiii ? |
draft PR at #76865 |
#76865 is ready for review @mtojek & @kaiyan-sheng I developed it using the steps from this PR & assets from elastic/package-storage#370 so it "should" work as discussed. I'm not sure how easy it is for you to test that PR but let me know if you have any questions or comments |
## Summary closes #75862 1. Use an HTTP status code if ES client error provides one. extended #75862 (comment) to all 4xx-5xx errors 1. Format Error message as described in #75862 (comment) & agreed to #75862 (comment) ### example Request/Response: ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode":400, "error":"Bad Request", "message":"[parse_exception] Failed to parse content to map from ES at /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` ### example Kibana Logs: `[parse_exception] Failed to parse content to map` <details><summary>Used `test.each` to generate tests for each 4xx - 5xx error. Call each error 3 different ways.</summary> ``` defaultIngestErrorHandler use the HTTP error status code provided by LegacyESErrors ✓ 400 - with path & response (12ms) ✓ 401 - with path & response (5ms) ✓ 402 - with path & response (5ms) ✓ 403 - with path & response (6ms) ✓ 404 - with path & response (5ms) ✓ 405 - with path & response (17ms) ✓ 406 - with path & response (2ms) ✓ 407 - with path & response (3ms) ✓ 408 - with path & response (6ms) ✓ 409 - with path & response (5ms) ✓ 410 - with path & response (1ms) ✓ 411 - with path & response (1ms) ✓ 412 - with path & response (1ms) ✓ 413 - with path & response (1ms) ✓ 414 - with path & response (1ms) ✓ 415 - with path & response (1ms) ✓ 416 - with path & response (1ms) ✓ 417 - with path & response (9ms) ✓ 418 - with path & response (1ms) ✓ 421 - with path & response (1ms) ✓ 426 - with path & response (1ms) ✓ 429 - with path & response (1ms) ✓ 450 - with path & response (1ms) ✓ 494 - with path & response (1ms) ✓ 497 - with path & response (1ms) ✓ 499 - with path & response (3ms) ✓ 500 - with path & response (2ms) ✓ 501 - with path & response (1ms) ✓ 502 - with path & response (2ms) ✓ 503 - with path & response (1ms) ✓ 504 - with path & response (1ms) ✓ 505 - with path & response (8ms) ✓ 506 - with path & response (2ms) ✓ 510 - with path & response (1ms) ✓ 400 - with other metadata (1ms) ✓ 401 - with other metadata (1ms) ✓ 402 - with other metadata (1ms) ✓ 403 - with other metadata (1ms) ✓ 404 - with other metadata (2ms) ✓ 405 - with other metadata (1ms) ✓ 406 - with other metadata (2ms) ✓ 407 - with other metadata (1ms) ✓ 408 - with other metadata (1ms) ✓ 409 - with other metadata (1ms) ✓ 410 - with other metadata (10ms) ✓ 411 - with other metadata (2ms) ✓ 412 - with other metadata (1ms) ✓ 413 - with other metadata (1ms) ✓ 414 - with other metadata (1ms) ✓ 415 - with other metadata (1ms) ✓ 416 - with other metadata (7ms) ✓ 417 - with other metadata (2ms) ✓ 418 - with other metadata (1ms) ✓ 421 - with other metadata (1ms) ✓ 426 - with other metadata (1ms) ✓ 429 - with other metadata (1ms) ✓ 450 - with other metadata (1ms) ✓ 494 - with other metadata (11ms) ✓ 497 - with other metadata (1ms) ✓ 499 - with other metadata (1ms) ✓ 500 - with other metadata (1ms) ✓ 501 - with other metadata (1ms) ✓ 502 - with other metadata (1ms) ✓ 503 - with other metadata (1ms) ✓ 504 - with other metadata (2ms) ✓ 505 - with other metadata (2ms) ✓ 506 - with other metadata (1ms) ✓ 510 - with other metadata (1ms) ✓ 400 - without metadata (1ms) ✓ 401 - without metadata (1ms) ✓ 402 - without metadata (10ms) ✓ 403 - without metadata (1ms) ✓ 404 - without metadata (1ms) ✓ 405 - without metadata (1ms) ✓ 406 - without metadata (1ms) ✓ 407 - without metadata (1ms) ✓ 408 - without metadata (1ms) ✓ 409 - without metadata (1ms) ✓ 410 - without metadata (1ms) ✓ 411 - without metadata (1ms) ✓ 412 - without metadata (1ms) ✓ 413 - without metadata (1ms) ✓ 414 - without metadata (1ms) ✓ 415 - without metadata (12ms) ✓ 416 - without metadata (1ms) ✓ 417 - without metadata (2ms) ✓ 418 - without metadata (1ms) ✓ 421 - without metadata (1ms) ✓ 426 - without metadata (2ms) ✓ 429 - without metadata (2ms) ✓ 450 - without metadata (3ms) ✓ 494 - without metadata (2ms) ✓ 497 - without metadata (2ms) ✓ 499 - without metadata (1ms) ✓ 500 - without metadata (1ms) ✓ 501 - without metadata (2ms) ✓ 502 - without metadata (1ms) ✓ 503 - without metadata (10ms) ✓ 504 - without metadata (2ms) ✓ 505 - without metadata (1ms) ✓ 506 - without metadata (2ms) ✓ 510 - without metadata (1ms) ``` </details> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### Manual testing <details><summary><strong>Manual testing</strong></summary> #### Checkout the branch from elastic/package-storage#370 ``` git clone https://github.com/elastic/package-storage.git cd package-storage/ git switch -C update-aws-0.2.7-1598281986 origin/update-aws-0.2.7-1598281986 ``` #### start the stack using the registry from elastic/package-storage#370 ``` cd testing/environments/ docker-compose -f snapshot.yml pull docker-compose -f snapshot.yml -f local.yml up --force-recreate ``` #### Try to install the broken package ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' {"statusCode":500,"error":"Internal Server Error","message":"Bad Request"} ``` _observe the same error as #75862_ #### start only local registry with the broken package ``` # CTRL-C the stack (shell where you ran `docker-compose`) cd ../.. # back to package-storage root docker build . docker run -p 8080:8080 id_from_prior_step ``` #### start the stack from this PR, pointing at the local registry from prior step ``` yarn start --no-base-path --xpack.ingestManager.registryUrl=http://localhost:8080 yarn es snapshot --license=trial -E xpack.security.authc.api_key.enabled=true ``` #### Try to install the broken package ``` curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode": 400, "error": "Bad Request", "message": "[parse_exception] Failed to parse content to map response from /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` _observe new error format_ </details>
## Summary closes elastic#75862 1. Use an HTTP status code if ES client error provides one. extended elastic#75862 (comment) to all 4xx-5xx errors 1. Format Error message as described in elastic#75862 (comment) & agreed to elastic#75862 (comment) ### example Request/Response: ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode":400, "error":"Bad Request", "message":"[parse_exception] Failed to parse content to map from ES at /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` ### example Kibana Logs: `[parse_exception] Failed to parse content to map` <details><summary>Used `test.each` to generate tests for each 4xx - 5xx error. Call each error 3 different ways.</summary> ``` defaultIngestErrorHandler use the HTTP error status code provided by LegacyESErrors ✓ 400 - with path & response (12ms) ✓ 401 - with path & response (5ms) ✓ 402 - with path & response (5ms) ✓ 403 - with path & response (6ms) ✓ 404 - with path & response (5ms) ✓ 405 - with path & response (17ms) ✓ 406 - with path & response (2ms) ✓ 407 - with path & response (3ms) ✓ 408 - with path & response (6ms) ✓ 409 - with path & response (5ms) ✓ 410 - with path & response (1ms) ✓ 411 - with path & response (1ms) ✓ 412 - with path & response (1ms) ✓ 413 - with path & response (1ms) ✓ 414 - with path & response (1ms) ✓ 415 - with path & response (1ms) ✓ 416 - with path & response (1ms) ✓ 417 - with path & response (9ms) ✓ 418 - with path & response (1ms) ✓ 421 - with path & response (1ms) ✓ 426 - with path & response (1ms) ✓ 429 - with path & response (1ms) ✓ 450 - with path & response (1ms) ✓ 494 - with path & response (1ms) ✓ 497 - with path & response (1ms) ✓ 499 - with path & response (3ms) ✓ 500 - with path & response (2ms) ✓ 501 - with path & response (1ms) ✓ 502 - with path & response (2ms) ✓ 503 - with path & response (1ms) ✓ 504 - with path & response (1ms) ✓ 505 - with path & response (8ms) ✓ 506 - with path & response (2ms) ✓ 510 - with path & response (1ms) ✓ 400 - with other metadata (1ms) ✓ 401 - with other metadata (1ms) ✓ 402 - with other metadata (1ms) ✓ 403 - with other metadata (1ms) ✓ 404 - with other metadata (2ms) ✓ 405 - with other metadata (1ms) ✓ 406 - with other metadata (2ms) ✓ 407 - with other metadata (1ms) ✓ 408 - with other metadata (1ms) ✓ 409 - with other metadata (1ms) ✓ 410 - with other metadata (10ms) ✓ 411 - with other metadata (2ms) ✓ 412 - with other metadata (1ms) ✓ 413 - with other metadata (1ms) ✓ 414 - with other metadata (1ms) ✓ 415 - with other metadata (1ms) ✓ 416 - with other metadata (7ms) ✓ 417 - with other metadata (2ms) ✓ 418 - with other metadata (1ms) ✓ 421 - with other metadata (1ms) ✓ 426 - with other metadata (1ms) ✓ 429 - with other metadata (1ms) ✓ 450 - with other metadata (1ms) ✓ 494 - with other metadata (11ms) ✓ 497 - with other metadata (1ms) ✓ 499 - with other metadata (1ms) ✓ 500 - with other metadata (1ms) ✓ 501 - with other metadata (1ms) ✓ 502 - with other metadata (1ms) ✓ 503 - with other metadata (1ms) ✓ 504 - with other metadata (2ms) ✓ 505 - with other metadata (2ms) ✓ 506 - with other metadata (1ms) ✓ 510 - with other metadata (1ms) ✓ 400 - without metadata (1ms) ✓ 401 - without metadata (1ms) ✓ 402 - without metadata (10ms) ✓ 403 - without metadata (1ms) ✓ 404 - without metadata (1ms) ✓ 405 - without metadata (1ms) ✓ 406 - without metadata (1ms) ✓ 407 - without metadata (1ms) ✓ 408 - without metadata (1ms) ✓ 409 - without metadata (1ms) ✓ 410 - without metadata (1ms) ✓ 411 - without metadata (1ms) ✓ 412 - without metadata (1ms) ✓ 413 - without metadata (1ms) ✓ 414 - without metadata (1ms) ✓ 415 - without metadata (12ms) ✓ 416 - without metadata (1ms) ✓ 417 - without metadata (2ms) ✓ 418 - without metadata (1ms) ✓ 421 - without metadata (1ms) ✓ 426 - without metadata (2ms) ✓ 429 - without metadata (2ms) ✓ 450 - without metadata (3ms) ✓ 494 - without metadata (2ms) ✓ 497 - without metadata (2ms) ✓ 499 - without metadata (1ms) ✓ 500 - without metadata (1ms) ✓ 501 - without metadata (2ms) ✓ 502 - without metadata (1ms) ✓ 503 - without metadata (10ms) ✓ 504 - without metadata (2ms) ✓ 505 - without metadata (1ms) ✓ 506 - without metadata (2ms) ✓ 510 - without metadata (1ms) ``` </details> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### Manual testing <details><summary><strong>Manual testing</strong></summary> #### Checkout the branch from elastic/package-storage#370 ``` git clone https://github.com/elastic/package-storage.git cd package-storage/ git switch -C update-aws-0.2.7-1598281986 origin/update-aws-0.2.7-1598281986 ``` #### start the stack using the registry from elastic/package-storage#370 ``` cd testing/environments/ docker-compose -f snapshot.yml pull docker-compose -f snapshot.yml -f local.yml up --force-recreate ``` #### Try to install the broken package ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' {"statusCode":500,"error":"Internal Server Error","message":"Bad Request"} ``` _observe the same error as #75862_ #### start only local registry with the broken package ``` # CTRL-C the stack (shell where you ran `docker-compose`) cd ../.. # back to package-storage root docker build . docker run -p 8080:8080 id_from_prior_step ``` #### start the stack from this PR, pointing at the local registry from prior step ``` yarn start --no-base-path --xpack.ingestManager.registryUrl=http://localhost:8080 yarn es snapshot --license=trial -E xpack.security.authc.api_key.enabled=true ``` #### Try to install the broken package ``` curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode": 400, "error": "Bad Request", "message": "[parse_exception] Failed to parse content to map response from /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` _observe new error format_ </details>
## Summary closes elastic#75862 1. Use an HTTP status code if ES client error provides one. extended elastic#75862 (comment) to all 4xx-5xx errors 1. Format Error message as described in elastic#75862 (comment) & agreed to elastic#75862 (comment) ### example Request/Response: ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode":400, "error":"Bad Request", "message":"[parse_exception] Failed to parse content to map from ES at /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` ### example Kibana Logs: `[parse_exception] Failed to parse content to map` <details><summary>Used `test.each` to generate tests for each 4xx - 5xx error. Call each error 3 different ways.</summary> ``` defaultIngestErrorHandler use the HTTP error status code provided by LegacyESErrors ✓ 400 - with path & response (12ms) ✓ 401 - with path & response (5ms) ✓ 402 - with path & response (5ms) ✓ 403 - with path & response (6ms) ✓ 404 - with path & response (5ms) ✓ 405 - with path & response (17ms) ✓ 406 - with path & response (2ms) ✓ 407 - with path & response (3ms) ✓ 408 - with path & response (6ms) ✓ 409 - with path & response (5ms) ✓ 410 - with path & response (1ms) ✓ 411 - with path & response (1ms) ✓ 412 - with path & response (1ms) ✓ 413 - with path & response (1ms) ✓ 414 - with path & response (1ms) ✓ 415 - with path & response (1ms) ✓ 416 - with path & response (1ms) ✓ 417 - with path & response (9ms) ✓ 418 - with path & response (1ms) ✓ 421 - with path & response (1ms) ✓ 426 - with path & response (1ms) ✓ 429 - with path & response (1ms) ✓ 450 - with path & response (1ms) ✓ 494 - with path & response (1ms) ✓ 497 - with path & response (1ms) ✓ 499 - with path & response (3ms) ✓ 500 - with path & response (2ms) ✓ 501 - with path & response (1ms) ✓ 502 - with path & response (2ms) ✓ 503 - with path & response (1ms) ✓ 504 - with path & response (1ms) ✓ 505 - with path & response (8ms) ✓ 506 - with path & response (2ms) ✓ 510 - with path & response (1ms) ✓ 400 - with other metadata (1ms) ✓ 401 - with other metadata (1ms) ✓ 402 - with other metadata (1ms) ✓ 403 - with other metadata (1ms) ✓ 404 - with other metadata (2ms) ✓ 405 - with other metadata (1ms) ✓ 406 - with other metadata (2ms) ✓ 407 - with other metadata (1ms) ✓ 408 - with other metadata (1ms) ✓ 409 - with other metadata (1ms) ✓ 410 - with other metadata (10ms) ✓ 411 - with other metadata (2ms) ✓ 412 - with other metadata (1ms) ✓ 413 - with other metadata (1ms) ✓ 414 - with other metadata (1ms) ✓ 415 - with other metadata (1ms) ✓ 416 - with other metadata (7ms) ✓ 417 - with other metadata (2ms) ✓ 418 - with other metadata (1ms) ✓ 421 - with other metadata (1ms) ✓ 426 - with other metadata (1ms) ✓ 429 - with other metadata (1ms) ✓ 450 - with other metadata (1ms) ✓ 494 - with other metadata (11ms) ✓ 497 - with other metadata (1ms) ✓ 499 - with other metadata (1ms) ✓ 500 - with other metadata (1ms) ✓ 501 - with other metadata (1ms) ✓ 502 - with other metadata (1ms) ✓ 503 - with other metadata (1ms) ✓ 504 - with other metadata (2ms) ✓ 505 - with other metadata (2ms) ✓ 506 - with other metadata (1ms) ✓ 510 - with other metadata (1ms) ✓ 400 - without metadata (1ms) ✓ 401 - without metadata (1ms) ✓ 402 - without metadata (10ms) ✓ 403 - without metadata (1ms) ✓ 404 - without metadata (1ms) ✓ 405 - without metadata (1ms) ✓ 406 - without metadata (1ms) ✓ 407 - without metadata (1ms) ✓ 408 - without metadata (1ms) ✓ 409 - without metadata (1ms) ✓ 410 - without metadata (1ms) ✓ 411 - without metadata (1ms) ✓ 412 - without metadata (1ms) ✓ 413 - without metadata (1ms) ✓ 414 - without metadata (1ms) ✓ 415 - without metadata (12ms) ✓ 416 - without metadata (1ms) ✓ 417 - without metadata (2ms) ✓ 418 - without metadata (1ms) ✓ 421 - without metadata (1ms) ✓ 426 - without metadata (2ms) ✓ 429 - without metadata (2ms) ✓ 450 - without metadata (3ms) ✓ 494 - without metadata (2ms) ✓ 497 - without metadata (2ms) ✓ 499 - without metadata (1ms) ✓ 500 - without metadata (1ms) ✓ 501 - without metadata (2ms) ✓ 502 - without metadata (1ms) ✓ 503 - without metadata (10ms) ✓ 504 - without metadata (2ms) ✓ 505 - without metadata (1ms) ✓ 506 - without metadata (2ms) ✓ 510 - without metadata (1ms) ``` </details> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### Manual testing <details><summary><strong>Manual testing</strong></summary> #### Checkout the branch from elastic/package-storage#370 ``` git clone https://github.com/elastic/package-storage.git cd package-storage/ git switch -C update-aws-0.2.7-1598281986 origin/update-aws-0.2.7-1598281986 ``` #### start the stack using the registry from elastic/package-storage#370 ``` cd testing/environments/ docker-compose -f snapshot.yml pull docker-compose -f snapshot.yml -f local.yml up --force-recreate ``` #### Try to install the broken package ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' {"statusCode":500,"error":"Internal Server Error","message":"Bad Request"} ``` _observe the same error as #75862_ #### start only local registry with the broken package ``` # CTRL-C the stack (shell where you ran `docker-compose`) cd ../.. # back to package-storage root docker build . docker run -p 8080:8080 id_from_prior_step ``` #### start the stack from this PR, pointing at the local registry from prior step ``` yarn start --no-base-path --xpack.ingestManager.registryUrl=http://localhost:8080 yarn es snapshot --license=trial -E xpack.security.authc.api_key.enabled=true ``` #### Try to install the broken package ``` curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode": 400, "error": "Bad Request", "message": "[parse_exception] Failed to parse content to map response from /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` _observe new error format_ </details>
## Summary closes #75862 1. Use an HTTP status code if ES client error provides one. extended #75862 (comment) to all 4xx-5xx errors 1. Format Error message as described in #75862 (comment) & agreed to #75862 (comment) ### example Request/Response: ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode":400, "error":"Bad Request", "message":"[parse_exception] Failed to parse content to map from ES at /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` ### example Kibana Logs: `[parse_exception] Failed to parse content to map` <details><summary>Used `test.each` to generate tests for each 4xx - 5xx error. Call each error 3 different ways.</summary> ``` defaultIngestErrorHandler use the HTTP error status code provided by LegacyESErrors ✓ 400 - with path & response (12ms) ✓ 401 - with path & response (5ms) ✓ 402 - with path & response (5ms) ✓ 403 - with path & response (6ms) ✓ 404 - with path & response (5ms) ✓ 405 - with path & response (17ms) ✓ 406 - with path & response (2ms) ✓ 407 - with path & response (3ms) ✓ 408 - with path & response (6ms) ✓ 409 - with path & response (5ms) ✓ 410 - with path & response (1ms) ✓ 411 - with path & response (1ms) ✓ 412 - with path & response (1ms) ✓ 413 - with path & response (1ms) ✓ 414 - with path & response (1ms) ✓ 415 - with path & response (1ms) ✓ 416 - with path & response (1ms) ✓ 417 - with path & response (9ms) ✓ 418 - with path & response (1ms) ✓ 421 - with path & response (1ms) ✓ 426 - with path & response (1ms) ✓ 429 - with path & response (1ms) ✓ 450 - with path & response (1ms) ✓ 494 - with path & response (1ms) ✓ 497 - with path & response (1ms) ✓ 499 - with path & response (3ms) ✓ 500 - with path & response (2ms) ✓ 501 - with path & response (1ms) ✓ 502 - with path & response (2ms) ✓ 503 - with path & response (1ms) ✓ 504 - with path & response (1ms) ✓ 505 - with path & response (8ms) ✓ 506 - with path & response (2ms) ✓ 510 - with path & response (1ms) ✓ 400 - with other metadata (1ms) ✓ 401 - with other metadata (1ms) ✓ 402 - with other metadata (1ms) ✓ 403 - with other metadata (1ms) ✓ 404 - with other metadata (2ms) ✓ 405 - with other metadata (1ms) ✓ 406 - with other metadata (2ms) ✓ 407 - with other metadata (1ms) ✓ 408 - with other metadata (1ms) ✓ 409 - with other metadata (1ms) ✓ 410 - with other metadata (10ms) ✓ 411 - with other metadata (2ms) ✓ 412 - with other metadata (1ms) ✓ 413 - with other metadata (1ms) ✓ 414 - with other metadata (1ms) ✓ 415 - with other metadata (1ms) ✓ 416 - with other metadata (7ms) ✓ 417 - with other metadata (2ms) ✓ 418 - with other metadata (1ms) ✓ 421 - with other metadata (1ms) ✓ 426 - with other metadata (1ms) ✓ 429 - with other metadata (1ms) ✓ 450 - with other metadata (1ms) ✓ 494 - with other metadata (11ms) ✓ 497 - with other metadata (1ms) ✓ 499 - with other metadata (1ms) ✓ 500 - with other metadata (1ms) ✓ 501 - with other metadata (1ms) ✓ 502 - with other metadata (1ms) ✓ 503 - with other metadata (1ms) ✓ 504 - with other metadata (2ms) ✓ 505 - with other metadata (2ms) ✓ 506 - with other metadata (1ms) ✓ 510 - with other metadata (1ms) ✓ 400 - without metadata (1ms) ✓ 401 - without metadata (1ms) ✓ 402 - without metadata (10ms) ✓ 403 - without metadata (1ms) ✓ 404 - without metadata (1ms) ✓ 405 - without metadata (1ms) ✓ 406 - without metadata (1ms) ✓ 407 - without metadata (1ms) ✓ 408 - without metadata (1ms) ✓ 409 - without metadata (1ms) ✓ 410 - without metadata (1ms) ✓ 411 - without metadata (1ms) ✓ 412 - without metadata (1ms) ✓ 413 - without metadata (1ms) ✓ 414 - without metadata (1ms) ✓ 415 - without metadata (12ms) ✓ 416 - without metadata (1ms) ✓ 417 - without metadata (2ms) ✓ 418 - without metadata (1ms) ✓ 421 - without metadata (1ms) ✓ 426 - without metadata (2ms) ✓ 429 - without metadata (2ms) ✓ 450 - without metadata (3ms) ✓ 494 - without metadata (2ms) ✓ 497 - without metadata (2ms) ✓ 499 - without metadata (1ms) ✓ 500 - without metadata (1ms) ✓ 501 - without metadata (2ms) ✓ 502 - without metadata (1ms) ✓ 503 - without metadata (10ms) ✓ 504 - without metadata (2ms) ✓ 505 - without metadata (1ms) ✓ 506 - without metadata (2ms) ✓ 510 - without metadata (1ms) ``` </details> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### Manual testing <details><summary><strong>Manual testing</strong></summary> #### Checkout the branch from elastic/package-storage#370 ``` git clone https://github.com/elastic/package-storage.git cd package-storage/ git switch -C update-aws-0.2.7-1598281986 origin/update-aws-0.2.7-1598281986 ``` #### start the stack using the registry from elastic/package-storage#370 ``` cd testing/environments/ docker-compose -f snapshot.yml pull docker-compose -f snapshot.yml -f local.yml up --force-recreate ``` #### Try to install the broken package ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' {"statusCode":500,"error":"Internal Server Error","message":"Bad Request"} ``` _observe the same error as #75862_ #### start only local registry with the broken package ``` # CTRL-C the stack (shell where you ran `docker-compose`) cd ../.. # back to package-storage root docker build . docker run -p 8080:8080 id_from_prior_step ``` #### start the stack from this PR, pointing at the local registry from prior step ``` yarn start --no-base-path --xpack.ingestManager.registryUrl=http://localhost:8080 yarn es snapshot --license=trial -E xpack.security.authc.api_key.enabled=true ``` #### Try to install the broken package ``` curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode": 400, "error": "Bad Request", "message": "[parse_exception] Failed to parse content to map response from /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` _observe new error format_ </details>
* [Ingest Manager] Handle Legacy ES client errors (#76865) ## Summary closes #75862 1. Use an HTTP status code if ES client error provides one. extended #75862 (comment) to all 4xx-5xx errors 1. Format Error message as described in #75862 (comment) & agreed to #75862 (comment) ### example Request/Response: ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode":400, "error":"Bad Request", "message":"[parse_exception] Failed to parse content to map from ES at /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` ### example Kibana Logs: `[parse_exception] Failed to parse content to map` <details><summary>Used `test.each` to generate tests for each 4xx - 5xx error. Call each error 3 different ways.</summary> ``` defaultIngestErrorHandler use the HTTP error status code provided by LegacyESErrors ✓ 400 - with path & response (12ms) ✓ 401 - with path & response (5ms) ✓ 402 - with path & response (5ms) ✓ 403 - with path & response (6ms) ✓ 404 - with path & response (5ms) ✓ 405 - with path & response (17ms) ✓ 406 - with path & response (2ms) ✓ 407 - with path & response (3ms) ✓ 408 - with path & response (6ms) ✓ 409 - with path & response (5ms) ✓ 410 - with path & response (1ms) ✓ 411 - with path & response (1ms) ✓ 412 - with path & response (1ms) ✓ 413 - with path & response (1ms) ✓ 414 - with path & response (1ms) ✓ 415 - with path & response (1ms) ✓ 416 - with path & response (1ms) ✓ 417 - with path & response (9ms) ✓ 418 - with path & response (1ms) ✓ 421 - with path & response (1ms) ✓ 426 - with path & response (1ms) ✓ 429 - with path & response (1ms) ✓ 450 - with path & response (1ms) ✓ 494 - with path & response (1ms) ✓ 497 - with path & response (1ms) ✓ 499 - with path & response (3ms) ✓ 500 - with path & response (2ms) ✓ 501 - with path & response (1ms) ✓ 502 - with path & response (2ms) ✓ 503 - with path & response (1ms) ✓ 504 - with path & response (1ms) ✓ 505 - with path & response (8ms) ✓ 506 - with path & response (2ms) ✓ 510 - with path & response (1ms) ✓ 400 - with other metadata (1ms) ✓ 401 - with other metadata (1ms) ✓ 402 - with other metadata (1ms) ✓ 403 - with other metadata (1ms) ✓ 404 - with other metadata (2ms) ✓ 405 - with other metadata (1ms) ✓ 406 - with other metadata (2ms) ✓ 407 - with other metadata (1ms) ✓ 408 - with other metadata (1ms) ✓ 409 - with other metadata (1ms) ✓ 410 - with other metadata (10ms) ✓ 411 - with other metadata (2ms) ✓ 412 - with other metadata (1ms) ✓ 413 - with other metadata (1ms) ✓ 414 - with other metadata (1ms) ✓ 415 - with other metadata (1ms) ✓ 416 - with other metadata (7ms) ✓ 417 - with other metadata (2ms) ✓ 418 - with other metadata (1ms) ✓ 421 - with other metadata (1ms) ✓ 426 - with other metadata (1ms) ✓ 429 - with other metadata (1ms) ✓ 450 - with other metadata (1ms) ✓ 494 - with other metadata (11ms) ✓ 497 - with other metadata (1ms) ✓ 499 - with other metadata (1ms) ✓ 500 - with other metadata (1ms) ✓ 501 - with other metadata (1ms) ✓ 502 - with other metadata (1ms) ✓ 503 - with other metadata (1ms) ✓ 504 - with other metadata (2ms) ✓ 505 - with other metadata (2ms) ✓ 506 - with other metadata (1ms) ✓ 510 - with other metadata (1ms) ✓ 400 - without metadata (1ms) ✓ 401 - without metadata (1ms) ✓ 402 - without metadata (10ms) ✓ 403 - without metadata (1ms) ✓ 404 - without metadata (1ms) ✓ 405 - without metadata (1ms) ✓ 406 - without metadata (1ms) ✓ 407 - without metadata (1ms) ✓ 408 - without metadata (1ms) ✓ 409 - without metadata (1ms) ✓ 410 - without metadata (1ms) ✓ 411 - without metadata (1ms) ✓ 412 - without metadata (1ms) ✓ 413 - without metadata (1ms) ✓ 414 - without metadata (1ms) ✓ 415 - without metadata (12ms) ✓ 416 - without metadata (1ms) ✓ 417 - without metadata (2ms) ✓ 418 - without metadata (1ms) ✓ 421 - without metadata (1ms) ✓ 426 - without metadata (2ms) ✓ 429 - without metadata (2ms) ✓ 450 - without metadata (3ms) ✓ 494 - without metadata (2ms) ✓ 497 - without metadata (2ms) ✓ 499 - without metadata (1ms) ✓ 500 - without metadata (1ms) ✓ 501 - without metadata (2ms) ✓ 502 - without metadata (1ms) ✓ 503 - without metadata (10ms) ✓ 504 - without metadata (2ms) ✓ 505 - without metadata (1ms) ✓ 506 - without metadata (2ms) ✓ 510 - without metadata (1ms) ``` </details> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### Manual testing <details><summary><strong>Manual testing</strong></summary> #### Checkout the branch from elastic/package-storage#370 ``` git clone https://github.com/elastic/package-storage.git cd package-storage/ git switch -C update-aws-0.2.7-1598281986 origin/update-aws-0.2.7-1598281986 ``` #### start the stack using the registry from elastic/package-storage#370 ``` cd testing/environments/ docker-compose -f snapshot.yml pull docker-compose -f snapshot.yml -f local.yml up --force-recreate ``` #### Try to install the broken package ``` > curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' {"statusCode":500,"error":"Internal Server Error","message":"Bad Request"} ``` _observe the same error as #75862_ #### start only local registry with the broken package ``` # CTRL-C the stack (shell where you ran `docker-compose`) cd ../.. # back to package-storage root docker build . docker run -p 8080:8080 id_from_prior_step ``` #### start the stack from this PR, pointing at the local registry from prior step ``` yarn start --no-base-path --xpack.ingestManager.registryUrl=http://localhost:8080 yarn es snapshot --license=trial -E xpack.security.authc.api_key.enabled=true ``` #### Try to install the broken package ``` curl --user elastic:changeme -X POST http://localhost:5601/api/ingest_manager/epm/packages/aws-0.2.7 -H 'kbn-xsrf: xyz' { "statusCode": 400, "error": "Bad Request", "message": "[parse_exception] Failed to parse content to map response from /_ingest/pipeline/logs-aws.cloudtrail-0.2.7: {\"error\":{\"root_cause\":[{\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\"}],\"type\":\"parse_exception\",\"reason\":\"Failed to parse content to map\",\"caused_by\":{\"type\":\"json_parse_exception\",\"reason\":\"Duplicate field 'ListGroupsForUser'\\n at [Source: (byte[])\\\"---\\ndescription: Pipeline for AWS CloudTrail Logs\\nprocessors:\\n - set:\\n field: event.ingested\\n value: '{{_ingest.timestamp}}'\\n - rename:\\n field: \\\"message\\\"\\n target_field: \\\"event.original\\\"\\n - json:\\n field: \\\"event.original\\\"\\n target_field: \\\"json\\\"\\n - date:\\n field: \\\"json.eventTime\\\"\\n target_field: \\\"@timestamp\\\"\\n ignore_failure: true\\n formats:\\n - ISO8601\\n - rename:\\n field: \\\"json.eventVersion\\\"\\n target_field: \\\"aws.cloudtrail.event_versi\\\"[truncated 16425 bytes]; line: 489, column: 26]\"}},\"status\":400}" } ``` _observe new error format_ </details> * Remove TS 4 feature b/c 7.9 is on TS 3.9.5 Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This PR elastic/package-storage#370 introduces an update AWS package. The update might be faulty, so Kibana rejects it with HTTP 500. Unfortunately it says nothing, but "Bad request" (side issue: error reporting for developer purposes should be improved).
I clicked the
Install
button second time and it worked without any problems. See screenshots, I'm not sure if it works or not./cc @ruflin @kaiyan-sheng
The text was updated successfully, but these errors were encountered: