We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Cloud-init does not retry IMDSv2 token calls when 503 is returned. According to the public documentation, a 503 error code should be retried and not result in a failure in and of itself. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
The problem cannot be reproduced on demand.
2024-07-24 08:13:06,797 - DataSourceEc2.py[DEBUG]: Fetching Ec2 IMDSv2 API Token 2024-07-24 08:13:06,797 - url_helper.py[DEBUG]: [0/1] open 'http://169.254.169.254/latest/api/token' with {'url': 'http://169.254.169.254/latest/api/token', 'allow_redirects': True, 'method': 'PUT', 'timeout': 50.0, 'headers': {'User-Agent': 'Cloud-Init/22.2-0ubuntu1~20.04.3', 'X-aws-ec2-metadata-token-ttl-seconds': 'REDACTED'}} configuration 2024-07-24 08:13:06,801 - url_helper.py[DEBUG]: Read from http://169.254.169.254/latest/api/token (503, 359b) after 1 attempts 2024-07-24 08:13:06,801 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/latest/api/token' failed [0/120s]: bad status code [503] 2024-07-24 08:13:06,801 - DataSourceEc2.py[WARNING]: Fatal error while requesting Ec2 IMDSv2 API tokens 2024-07-24 08:13:06,801 - DataSourceEc2.py[WARNING]: IMDS's HTTP endpoint is probably disabled
[ 15.417209] cloud-init[10775]: Feb 12 11:15:27 cloud-init[10775]: url_helper.py[WARNING]: Calling 'http://169.254.169.254/latest/api/token' failed [0/120s]: bad status code [503] [ 15.417267] cloud-init[10775]: Feb 12 11:15:27 cloud-init[10775]: DataSourceEc2.py[WARNING]: Fatal error while requesting Ec2 IMDSv2 API tokens [ 15.417864] cloud-init[10775]: Feb 12 11:15:27 cloud-init[10775]: DataSourceEc2.py[WARNING]: IMDS's HTTP endpoint is probably disabled [ 15.467706] cloud-init[10775]: Feb 12 11:15:27 cloud-init[10775]: cc_write_metadata.py[WARNING]: there is no identity dataset [ 15.468057] cloud-init[10775]: Feb 12 11:15:27 cloud-init[10775]: util.py[WARNING]: Running module write-metadata (<module 'cloudinit.config.cc_write_metadata' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_write_metadata.pyc'>) failed [[1;31mFAILED[0m] Failed to start Initial cloud-init job (metadata service crawler).
The text was updated successfully, but these errors were encountered:
Thanks for reporting, @taylorpn!
According to the public documentation, a 503 error code should be retried and not result in a failure in and of itself.
Yeah, I think that this would generally be safe to do.
Sorry, something went wrong.
feat(url_helper): Retry on 503 error
cc16534
If the server is busy, no need to fail. Add type hints to adjascent code paths. Fixes canonicalGH-5577
Successfully merging a pull request may close this issue.
Bug report
Cloud-init does not retry IMDSv2 token calls when 503 is returned. According to the public documentation, a 503 error code should be retried and not result in a failure in and of itself.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
Steps to reproduce the problem
The problem cannot be reproduced on demand.
Environment details
cloud-init logs
The text was updated successfully, but these errors were encountered: