Skip to content

fix(hetznercloud): poll zone action endpoint instead of server action - #1177

Open
legend813 wants to merge 1 commit into
qdm12:masterfrom
legend813:fix/hetznercloud-zone-action
Open

fix(hetznercloud): poll zone action endpoint instead of server action#1177
legend813 wants to merge 1 commit into
qdm12:masterfrom
legend813:fix/hetznercloud-zone-action

Conversation

@legend813

@legend813 legend813 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

What

waitAction for the hetznercloud provider polls the server action endpoint for what is a zone action:

url := fmt.Sprintf("https://api.hetzner.cloud/v1/servers/actions/%d", id)

Record writes (add_rrset_records, set_rrset_records, …) return an action that lives under /v1/zones/actions/{id}. Looking it up under /v1/servers/actions/{id} returns 404 not_found, which handleErrorResponse turns into an update failure — even though the record write itself succeeded.

Why it matters

The DNS record is written correctly, but the update is recorded as failed. Consequences reported in #1136:

  • updates.json is never updated, so the Web UI shows a stale "Current IP" indefinitely
  • the healthcheck compares against that stale state, so the container stays unhealthy
  • reverse proxies that filter on container health drop the Web UI

Reproduction

Against a live Hetzner Cloud DNS zone, using the same action ID returned by a record write:

$ curl -H "Authorization: Bearer $TOKEN" https://api.hetzner.cloud/v1/zones/actions
{"actions":[{"id":<action-id>,"command":"add_rrset_records","status":"success", ...

$ curl -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $TOKEN" \
    https://api.hetzner.cloud/v1/zones/actions/<action-id>
200

$ curl -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $TOKEN" \
    https://api.hetzner.cloud/v1/servers/actions/<action-id>
404

Same ID, both endpoints — only the zone one resolves. On accounts with no cloud servers, /v1/servers/actions is empty, so every lookup necessarily 404s.

Change

One-line fix plus a regression test that asserts the polled path and covers the error action status.

Verified on v2.10.0 (commit 6499618) against a real zone: with the fix, record updates are recorded as successful.

Fixes #1136

Record writes return an action that belongs to the zone, so it must be
polled at /v1/zones/actions/{id}. Polling /v1/servers/actions/{id}
returns 404 not_found, which is turned into an update failure even
though the record write itself succeeded.

As a result updates.json is never updated, the Web UI keeps showing a
stale current IP, and the healthcheck keeps the container unhealthy.

Adds a regression test asserting the polled path.

Fixes qdm12#1136
@qdm12

qdm12 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Isn't this the same as now-merged #1166 ?

@buddhaCode

buddhaCode commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Yes, same change as #1166. The diff is identical, and master already carries it since that merge, so there is nothing left for this PR to apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: hetznercloud provider: action polling 404 marks successful updates as failed, container stays unhealthy

3 participants