-
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
Improve Clean Repository error message. #117947
Improve Clean Repository error message. #117947
Conversation
Pinging @elastic/kibana-stack-management (Team:Stack Management) |
{cleanup.error | ||
? JSON.stringify(cleanup.error) | ||
: i18n.translate('xpack.snapshotRestore.repositoryDetails.cleanupUnknownError', { | ||
defaultMessage: '503: Unknown error', |
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'm missing the background on this particular error scenario. @cuff-links Do you recall any details around this or how we could reproduce?
💚 Build Succeeded
Metrics [docs]Async chunks
To update your PR or re-run it, just comment with: |
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.
Thanks for patching this up @cjcenizal! code changes lgtm, I was only able to test it locally by forcing an error on the POST handler for cleanup repository x-pack/plugins/snapshot_restore/server/routes/api/repositories.ts
|
||
type HomeTestSubjects = TestSubjects | ThreeLevelDepth | NonVisibleTestSubjects; | ||
|
||
type NonVisibleTestSubjects = |
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.
🔥
# Conflicts: # x-pack/plugins/snapshot_restore/server/routes/api/repositories.ts
I updated the error-handling and display logic to surface only the pertinent details of the error instead of rendering the raw JSON response from ES (originally introduced in #53047). I also updated the tests.
Here's how this error looks now:
Steps to test
The repository will fail to clean up because it's in the process of deleting a snapshot and you'll see the error above.