OpenStack datasource should not retry user-data on 404
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When receiving a 404 from user_data attempts, cloud-init should not attempt to retry the errant user_data file as it is wasted effort. If the metadata service is already up, then any user-data should already be present, so a 404 at this time means that no user data exists so retries will not result in finding user-data at a later time.
Excerpt of logs indicating metadata is up but user-data does not exist:
2017-07-03 18:26:50,408 - __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.
2017-07-03 18:26:50,558 - url_helper.
2017-07-03 18:26:51,434 - url_helper.
...
2017-07-03 18:26:51,445 - url_helper.
2017-07-03 18:26:52,514 - url_helper.
...2017-07-03 18:26:53,957 - url_helper.
2017-07-03 18:26:59,989 - openstack.
Validated as well on cmdline minutes later:
wget http://
--2017-07-03 18:51:33-- http://
Connecting to 169.254.
HTTP request sent, awaiting response... 404 Not Found
2017-07-03 18:51:34 ERROR 404: Not Found.
Related branches
- Scott Moser: Approve
- Server Team CI bot: Approve (continuous-integration)
-
Diff: 2321 lines (+1535/-239)26 files modifiedcloudinit/config/cc_snap.py (+2/-45)
cloudinit/config/cc_ubuntu_advantage.py (+173/-0)
cloudinit/config/tests/test_snap.py (+6/-51)
cloudinit/config/tests/test_ubuntu_advantage.py (+269/-0)
cloudinit/ec2_utils.py (+2/-4)
cloudinit/net/netplan.py (+9/-16)
cloudinit/sources/DataSourceAzure.py (+9/-22)
cloudinit/sources/DataSourceConfigDrive.py (+10/-0)
cloudinit/sources/DataSourceIBMCloud.py (+325/-0)
cloudinit/sources/DataSourceScaleway.py (+3/-3)
cloudinit/subp.py (+57/-0)
cloudinit/tests/test_subp.py (+61/-0)
cloudinit/tests/test_util.py (+72/-0)
cloudinit/url_helper.py (+12/-8)
cloudinit/util.py (+31/-0)
config/cloud.cfg.tmpl (+3/-0)
debian/changelog (+19/-0)
doc/rtd/topics/modules.rst (+1/-0)
tests/unittests/test_datasource/test_azure.py (+7/-15)
tests/unittests/test_datasource/test_ibmcloud.py (+262/-0)
tests/unittests/test_ds_identify.py (+112/-3)
tests/unittests/test_handler/test_schema.py (+1/-0)
tests/unittests/test_net.py (+12/-63)
tools/ds-identify (+60/-9)
tools/pipremove (+14/-0)
tox.ini (+3/-0)
- Scott Moser: Approve
- Chad Smith: Approve
- Server Team CI bot: Approve (continuous-integration)
- Paul Graydon: Pending requested
-
Diff: 35 lines (+7/-6)2 files modifiedcloudinit/sources/DataSourceScaleway.py (+3/-3)
cloudinit/url_helper.py (+4/-3)
description: | updated |
summary: |
- OpenStack datasource should not retry user-data on 404s + OpenStack datasource should not retry user-data on 404 |
Changed in cloud-init: | |
importance: | Undecided → Medium |
assignee: | nobody → Chad Smith (chad.smith) |
status: | New → In Progress |
Changed in cloud-init: | |
assignee: | Chad Smith (chad.smith) → nobody |
sources/ helpers/ openstack. py has the exception_cb logic reversed.
Attached patch fixes it.
Note: I special cased 'meta_data.json' as this is required and we might want to have retries for this file even though we have a response code >= 400. This is not because I believe that this is the best possible approach, but because there might be environments out there that relied on the unintended retrials and I want to avoid this patch possibly causing a regression anywhere.
Patch is against 0.7.9 from Xenial (where I tested this), let me know if you need this rediffed against some current git tree.