-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Retry authentication and other connection failures in Saved Object migrations #51324
Conversation
Pinging @elastic/kibana-platform (Team:Platform) |
I changed the kibana user's password while starting up from x-pack directory and got tons of errors repeating. Then I checked the kibana user's password back to what kibana was configured to use (around timestamp [14:00:05.764]) and it instantly started working. This wasn't an exhaustive test, but a good sign.
|
💚 Build Succeeded |
This is interesting to me, I changed the password in elasticsearch to be wrong again and opened Kibana in my browser. |
This is fun... while you're logged in to Kibana and testing things run this script to constantly change the kibana user's password and make sure the Kibana process never crashes; while (true); do curl -k -XPUT --basic "http://elastic:changeme@localhost:9220/_xpack/security/user/kibana/_password?pretty" -H 'Content-Type: application/json' -d'{ "password": "changeit" }'; echo "bad password"; sleep 4; curl -k -XPUT --basic "http://elastic:changeme@localhost:9220/_xpack/security/user/kibana/_password?pretty" -H 'Content-Type: application/json' -d'{ "password": "changeme" }'; echo "good password"; sleep 8; done |
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 haven't found any issues in manual testing. @LeeDr are you good with this change as you tested?
|
||
// TODO: Replace with APICaller from './scoped_cluster_client' once #46668 is merged | ||
export function migrationsRetryCallCluster( | ||
apiCaller: ( |
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.
optional: use APICaller
since it exists now
log: Logger, | ||
delay: number = 2500 | ||
) { | ||
const previousErrors: string[] = []; |
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.
optional: use Set instead of array
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
…grations (elastic#51324) * Retry authentication and other connection failures in migrations * Log migration ES connection errors once, retry every 2.5s * Test migrations es connection error logging * retry on AuthorizationExceptions during migration * Set delay to 1 for tests
…grations (elastic#51324) * Retry authentication and other connection failures in migrations * Log migration ES connection errors once, retry every 2.5s * Test migrations es connection error logging * retry on AuthorizationExceptions during migration * Set delay to 1 for tests
Summary
Fixes #51242 by retrying authentication and other failures encountered from
callCluster
in the Saved Object migrator.Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers