Skip to content

fix(deploy): nil pointer dereference when creating new machines during deploy#4750

Open
jphenow wants to merge 1 commit intomasterfrom
fix/nil-oldmachine-deploy-panic
Open

fix(deploy): nil pointer dereference when creating new machines during deploy#4750
jphenow wants to merge 1 commit intomasterfrom
fix/nil-oldmachine-deploy-panic

Conversation

@jphenow
Copy link
Member

@jphenow jphenow commented Feb 27, 2026

Summary

  • Fixes a nil pointer dereference panic in updateMachineWChecks that occurs when scaling up (creating new machines with no corresponding old machine).
  • When oldMachine is nil (new machine being created), the health check wait log message at plan.go:562 accessed oldMachine.ID, causing a SIGSEGV. Changed to use machine.ID (the return value from updateOrCreateMachine) which is guaranteed non-nil at that point.
  • Adds TestUpdateMachinesWithNewMachine to exercise this exact code path: deploying with a new machine in the app state that has no old machine counterpart, with smoke checks enabled.

…g deploy

When scaling up (oldMachine=nil), updateMachineWChecks accessed
oldMachine.ID for the health check wait log message, causing a panic.
Use the machine returned from updateOrCreateMachine instead, which is
guaranteed non-nil at that point.
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