Skip to content

fix(hetzner): stop using deprecated Server.Datacenter to avoid nil panic - #951

Merged
cdalar merged 4 commits into
mainfrom
fix/hetzner-list-nil-panic
Jul 2, 2026
Merged

cdalar merged 4 commits into
mainfrom
fix/hetzner-list-nil-panic

Conversation

@cdalar

@cdalar cdalar commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • onctl ls panicked with a nil pointer dereference (SIGSEGV addr=0x28) inside mapHetznerServer
  • Root cause: Hetzner's API has stopped populating the deprecated Server.Datacenter field, so server.Datacenter.Location.Name dereferenced a nil *Datacenter
  • Fix: use server.Location directly (already present on hcloud.Server) instead of going through the deprecated Datacenter.Location path, at all three call sites in pkg/cloud/hetzner.go

Test plan

  • go build ./...
  • go vet ./pkg/cloud/...
  • go test ./pkg/cloud/...

cdalar added 3 commits June 30, 2026 12:49
Uses onctl ssh --upload to transfer the linux/amd64 binary and installs it to /usr/local/bin/onctl.
Hetzner's API has stopped populating the deprecated Datacenter field on
server responses, so server.Datacenter.Location.Name panicked with a nil
pointer dereference in onctl ls. Use server.Location directly instead,
matching hcloud-go's deprecation guidance.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8ff22dc7d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/deploy-controller.sh Resolved
…oller.sh

The script invoked ./onctl to ssh/upload, but make build-amd64 only
produces onctl-amd64 (a linux/amd64 cross-build). From a clean
checkout the host binary didn't exist and the script failed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BADfF7936dPfssXqBXsLx3
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.94%. Comparing base (90cabbc) to head (590504d).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cloud/hetzner.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #951   +/-   ##
=======================================
  Coverage   23.94%   23.94%           
=======================================
  Files          44       44           
  Lines        4418     4418           
=======================================
  Hits         1058     1058           
  Misses       3229     3229           
  Partials      131      131           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cdalar
cdalar merged commit 2454431 into main Jul 2, 2026
17 checks passed
@cdalar
cdalar deleted the fix/hetzner-list-nil-panic branch August 19, 2026 13:53
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.

2 participants

⌂ 换网址