Skip to content

Fix OpenStack Metadata 404 - #4413

Open
robinschneider wants to merge 2 commits into
mainfrom
robin/ignition-404
Open

robinschneider wants to merge 2 commits into
mainfrom
robin/ignition-404

Conversation

@robinschneider

Copy link
Copy Markdown
Member

Fix OpenStack Metadata 404

OpenStack Metadata service sometimes is not yet ready when a server tries to access it. In this case OpenStack returns 404, the issue is OpenStack also returns 404 when Metadata service is available but there is no user-data. Ignition never retries after a 404.
Therefore this fix (PR for upstream Ignition still open coreos/ignition#2355) adds a probe to check, if the metadata service is already available.

How to use

Mantle tests for Brightbox and STACKIT were successfull.
Also a local test was successfull with a metadata service that is healthy but always returns 404

[   44.107614] systemd[1]: Reached target remote-cryptsetup.target - Remote Encrypted Volumes.
[   44.111460] systemd[1]: Reached target remote-fs.target - Remote File Systems.
[   44.141402] systemd-vconsole-setup[621]: [0;1;39mConfiguration of first virtual console was skipped, ignoring remaining ones.[0m
[[0;32m  OK  [0m] Finished [0;1;39msystemd-vconsole-setup.service[0m - Virtual Console Setup.
[   44.146686] systemd[1]: Finished systemd-vconsole-setup.service - Virtual Console Setup.
[   44.219956] audit: type=1130 audit(1796132844.753:27): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   44.369885] ignition[598]: GET http://169.254.169.254/openstack/latest/user_data: attempt #4
[   44.441579] ignition[598]: GET result: Service Unavailable
[   44.917545] systemd-networkd[488]: eth0: Gained IPv6LL
[   46.048474] ignition[598]: GET http://169.254.169.254/openstack/latest/user_data: attempt #5
[   46.058564] ignition[598]: GET result: Service Unavailable
[ [0;31m*[0;1;31m*[0m[0;31m*  [0m] (2 of 2) Job dev-mapper-usr.device/start running (22s / 1min 30s)
M[K[  [0;31m*[0;1;31m*[0m[0;31m* [0m] (2 of 2) Job dev-mapper-usr.device/start running (23s / 1min 30s)
M[K[   [0;31m*[0;1;31m*[0m[0;31m*[0m] (2 of 2) Job dev-mapper-usr.device/start running (23s / 1min 30s)
M[K[    [0;31m*[0;1;31m*[0m] (1 of 2) Job ignition-fetch.service/start running (24s / no limit)
M[K[     [0;31m*[0m] (1 of 2) Job ignition-fetch.service/start running (24s / no limit)
M[K[    [0;31m*[0;1;31m*[0m] (1 of 2) Job ignition-fetch.service/start running (25s / no limit)
M[K[   [0;31m*[0;1;31m*[0m[0;31m*[0m] (2 of 2) Job dev-mapper-usr.device/start running (25s / 1min 30s)
[   49.263295] ignition[598]: GET http://169.254.169.254/openstack/latest/user_data: attempt #6
[   49.273452] ignition[598]: GET result: Service Unavailable
M[K[  [0;31m*[0;1;31m*[0m[0;31m* [0m] (2 of 2) Job dev-mapper-usr.device/start running (26s / 1min 30s)
M[K[ [0;31m*[0;1;31m*[0m[0;31m*  [0m] (2 of 2) Job dev-mapper-usr.device/start running (26s / 1min 30s)
M[K[[0;31m*[0;1;31m*[0m[0;31m*   [0m] (1 of 2) Job ignition-fetch.service/start running (27s / no limit)
M[K[[0;1;31m*[0m[0;31m*    [0m] (1 of 2) Job ignition-fetch.service/start running (27s / no limit)
M[K[[0m[0;31m*     [0m] (1 of 2) Job ignition-fetch.service/start running (28s / no limit)
M[K[[0;1;31m*[0m[0;31m*    [0m] (2 of 2) Job dev-mapper-usr.device/start running (28s / 1min 30s)
M[K[[0;31m*[0;1;31m*[0m[0;31m*   [0m] (2 of 2) Job dev-mapper-usr.device/start running (29s / 1min 30s)
M[K[ [0;31m*[0;1;31m*[0m[0;31m*  [0m] (2 of 2) Job dev-mapper-usr.device/start running (29s / 1min 30s)
M[K[  [0;31m*[0;1;31m*[0m[0;31m* [0m] (1 of 2) Job ignition-fetch.service/start running (30s / no limit)
M[K[   [0;31m*[0;1;31m*[0m[0;31m*[0m] (1 of 2) Job ignition-fetch.service/start running (30s / no limit)
[   54.276777] ignition[598]: GET http://169.254.169.254/openstack/latest/user_data: attempt #7
[   54.287893] ignition[598]: GET result: Service Unavailable
M[K[    [0;31m*[0;1;31m*[0m] (1 of 2) Job ignition-fetch.service/start running (31s / no limit)
M[K[     [0;31m*[0m] (2 of 2) Job dev-mapper-usr.device/start running (31s / 1min 30s)
M[K[    [0;31m*[0;1;31m*[0m] (2 of 2) Job dev-mapper-usr.device/start running (32s / 1min 30s)
M[K[   [0;31m*[0;1;31m*[0m[0;31m*[0m] (2 of 2) Job dev-mapper-usr.device/start running (32s / 1min 30s)
M[K[  [0;31m*[0;1;31m*[0m[0;31m* [0m] (1 of 2) Job ignition-fetch.service/start running (33s / no limit)
M[K[ [0;31m*[0;1;31m*[0m[0;31m*  [0m] (1 of 2) Job ignition-fetch.service/start running (33s / no limit)
M[K[[0;31m*[0;1;31m*[0m[0;31m*   [0m] (1 of 2) Job ignition-fetch.service/start running (34s / no limit)
M[K[[0;1;31m*[0m[0;31m*    [0m] (2 of 2) Job dev-mapper-usr.device/start running (34s / 1min 30s)
M[K[[0m[0;31m*     [0m] (2 of 2) Job dev-mapper-usr.device/start running (35s / 1min 30s)
M[K[[0;1;31m*[0m[0;31m*    [0m] (2 of 2) Job dev-mapper-usr.device/start running (35s / 1min 30s)
[   59.291402] ignition[598]: GET http://169.254.169.254/openstack/latest/user_data: attempt #8
[   59.302743] ignition[598]: GET result: Service Unavailable

Testing done

Both mantle tests as well as manual testing with an always 404 returning metadata service succeeded.

Signed-off-by: Robin Schneider <mail@robinschneider.dev>
@robinschneider
robinschneider requested a review from a team as a code owner December 1, 2026 16:12
Copilot AI balanced review requested due to automatic review settings December 1, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the Ignition metadata-readiness and concurrent-fetching changes.

No open issues 🎉

What changed in this PR

This PR adds downstream Ignition patches so Flatcar can distinguish an OpenStack metadata service that is not ready from an instance with no user data.

Changes:

  • Probe instance metadata after a user-data 404, retry until metadata is available, then fetch user data again.
  • Rework parallel fetching to wait for the first successful result or all failures, with regression tests.
  • Configure redirect handling once per HTTP client to avoid concurrent updates during fetches.
File Description
sdk_container/​src/​third_party/​coreos-overlay/​coreos/​user-patches/​sys-apps/​ignition/​40d22206921fe129044ffde455bb410767e46445.patch Moves redirect-handler setup into HTTP client initialization.
sdk_container/​src/​third_party/​coreos-overlay/​coreos/​user-patches/​sys-apps/​ignition/​3b569f91c166a2da00bceab1bb24a533eb86399c.patch Adds metadata-readiness probing, revises parallel fetching, and includes tests and an upstream release note.

Review effort: Balanced

@tormath1 tormath1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the upstream PR is approved / merged. In the meantime, we can just move those patches to: https://github.com/flatcar/scripts/tree/main/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/files

This can help when upgrading Ignition, all patches are in the same place.

This branch is waiting to be deployed

1 waiting deployment
development — b7f0995b Waiting Dec 1, 2026 by robinschneider via Wait for approval #6211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants