-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Ingest Manager] API sends 404 when package config id is missing #73212
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
[Ingest Manager] API sends 404 when package config id is missing #73212
Conversation
Currently failing with a 500 as in #66388
The test initally failed with a 500 when the `after` was added. Debugging narrowed it down to a missing default config. getDefaultAgentConfigId errors if there isn't a default config. The config is added by `setupIngestManager` which _was_ always called during plugin#start but is no longer. We could add the setup call to the test/suite, but instead I changed AgentConfigService.delete to use ensureDefaultAgentConfig instead of getDefaultAgentConfigId. ensureDefaultAgentConfig adds one if it's missing. The check in delete is to make sure we don't delete the default config. We can still do that and now we add a config if it wasn't already there (which seems like A Good Thing)
|
cc @elastic/endpoint-app-team for the text change in https://github.com/elastic/kibana/pull/73212/files#diff-d892c26bb4fc08d103899f8234beb2d4 |
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
|
@elasticmachine merge upstream |
| import { TypeOf } from '@kbn/config-schema'; | ||
| import Boom from 'boom'; | ||
| import { RequestHandler } from 'src/core/server'; | ||
| import { RequestHandler, SavedObjectsErrorHelpers } from '../../../../../../src/core/server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the relative path here because I was getting an error like "cannot find module 'src/core/server'" when I added the helpers
|
@elasticmachine merge upstream |
|
@jen-huang I figured this would be backported to 7.9 because it's a bug fix for #66388 |
|
Spun the change in /agent_configs/delete behavior into separate PR #73376 if we'd rather deal with it separately |
We just got an email from @ph that only blockers should be backported to 7.9. This isn't a blocker. |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
) (#73659) * Add test to confirm missing config responds w/ 404 Currently failing with a 500 as in #66388 * Use after() to remove items added by test. The test initally failed with a 500 when the `after` was added. Debugging narrowed it down to a missing default config. getDefaultAgentConfigId errors if there isn't a default config. The config is added by `setupIngestManager` which _was_ always called during plugin#start but is no longer. We could add the setup call to the test/suite, but instead I changed AgentConfigService.delete to use ensureDefaultAgentConfig instead of getDefaultAgentConfigId. ensureDefaultAgentConfig adds one if it's missing. The check in delete is to make sure we don't delete the default config. We can still do that and now we add a config if it wasn't already there (which seems like A Good Thing) * Fix package config path in OpenApi spec * Return 404 if package config id is invalid/missing * Change test for error displayed text Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
fixes #66388
Respond with a 404 when a given package config id cannot be found
Added test to confirm 404
Changed
AgentConfigService.deleteto not throw if a default config isn't present. Behavior & reasoning described in b4f4051. I created a separate PR and added a test in [Ingest Manager] Fix /agent_config/delete API 500 if default config missing #73376 if we want to deal with it separately. I could also close that and bring the test over to this branch.Updated the expected text in an Endpoint UI test
Checklist
Delete any items that are not applicable to this PR.