Repository navigation
fix(observability): vmbackup must reach vmsingle on 127.0.0.1, not localhost - #1158
Conversation
…calhost A seventh defect in the sidecar, found by watching the first real rollout after #1157 rather than by reading the manifest: [vmbackup] starting backup to s3://vault-backup/victoria-metrics fatal cannot create snapshot: Get "http://localhost:8428/snapshot/create": dial tcp [::1]:8428: connect: connection refused [vmbackup] ERROR: backup failed, exit 255. Retrying in 1h This is not a startup race. The image is Alpine, busybox resolves `localhost` via /etc/hosts where `::1 localhost` follows `127.0.0.1 localhost`, and it tries IPv6 first; vmsingle listens on IPv4 only. Measured from inside the running sidecar, against a fully healthy vmsingle: wget http://127.0.0.1:8428/health -> OK wget http://localhost:8428/health -> can't connect: Connection refused So every backup would have failed for ever. The `localhost` URLs came unchanged from the original 2026-03 block, which is why this survived: it had never run, so it had never had the chance to fail this way. Two changes: * both snapshot URLs use 127.0.0.1. * a wait loop on 127.0.0.1:8428/health before the first backup. Containers in a pod start together, so even with the address fixed the first attempt can lose the race with vmsingle, and the retry is an hour away. Waiting is deterministic; retrying is not. Worth stating plainly: the alerting shipped in #1157 is what made this visible within minutes instead of at the next restore attempt. The sidecar failed, did not crash, kept the pod ready — 2/2 Running throughout — and published no success timestamp, exactly as designed. Claude-Session: https://claude.ai/code/session_01XfiLHHnDwXvob2smFsRcKN
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Claude encountered an error after 0s —— View job I'll analyze this and get back to you. |
|
Claude finished @mashkovd's task in 1m 53s —— View job Reviewing PR #1158
Verdict: APPROVED (0 P1/P2, 0 P3) Reviewed
Approval posted: #1158 (review) |
There was a problem hiding this comment.
No P1/P2 findings (0 P3). URL fix (localhost→127.0.0.1) is correct — matches VictoriaMetrics IPv4-only listener + Alpine's ::1-first resolution described in the PR. The new pre-loop wget health wait is bounded to container start (no readinessProbe on this sidecar, so it can't block pod readiness / the vmsingle Service), uses the same 127.0.0.1:8428 endpoint verified live, and logs each retry — consistent with the file's existing no-crash/no-set-e sidecar philosophy. Good to merge.
Antigravity (agy) review — informationalModel: gemini-3.1-pro-high · commit Severity: P3 |
Follow-up to #1157 / #1071. A seventh defect in the vmbackup sidecar, found by watching the first real rollout rather than by reading the manifest.
What happened
The sidecar started, ran, and failed:
It is not a startup race
That was my first reading and it is wrong. Measured from inside the running sidecar, against a fully healthy vmsingle in the same pod:
The image is Alpine; busybox resolves
localhostfrom/etc/hostsand tries::1first. vmsingle listens on IPv4 only. So every backup would have failed for ever, not just the first one.The
localhostURLs came unchanged from the original 2026-03 block — which is exactly why this survived six defects' worth of review. The code had never run, so it had never had the chance to fail this way.Changes
127.0.0.1.127.0.0.1:8428/healthbefore the first backup. Containers in a pod start together, so even with the address fixed the first attempt can lose the race with vmsingle, and the retry is an hour away. Waiting is deterministic; retrying is not.What this says about #1157
The alerting shipped there is what made this visible within minutes instead of at the next restore attempt:
2/2 Runningthroughout, vmsingle never left its Service;VictoriaMetricsBackupStalewould have paged at 25h had nobody been looking;That is the design working as intended on its first real fault.
Verification
helm templaterenders andkubeconform -strictpasses (84 resources). The failing and working addresses were both measured from the live sidecar, quoted above. No rule changes, so the vm-rules suite is untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_01XfiLHHnDwXvob2smFsRcKN