Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Fixing panic in ECS runner uninstall when EFS is missing #4829

Merged
merged 3 commits into from
Jul 6, 2023

Conversation

izaaklauer
Copy link
Contributor

@izaaklauer izaaklauer commented Jul 5, 2023

This fixes a panic when uninstalling a runner if the EFS filesystem is not found or has been deleted out-of-band.

Panic stacktrace:

(venv) ➜  learn-hcp-waypoint-runners git:(main) ✗ waypoint runner uninstall -platform=ecs -id=ecs-runner
 ! Uninstalling runner...
 + Finding runner in ECS services...
 ! Deleting runner file system
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x106e94234]

goroutine 1 [running]:
github.com/hashicorp/waypoint/internal/runnerinstall.(*ECSRunnerInstaller).Uninstall(0x14000dd4090, {0x1083212c0, 0x140008bc840}, 0x14001282a10)
        /home/runner/work/waypoint/waypoint/internal/runnerinstall/ecs.go:400 +0xa34
github.com/hashicorp/waypoint/internal/cli.(*RunnerUninstallCommand).Run(0x1400010dc80, {0x140004bc530, 0x2, 0x5})
        /home/runner/work/waypoint/waypoint/internal/cli/runner_uninstall.go:134 +0x338
github.com/mitchellh/cli.(*CLI).Run(0x140002a2500)
        /home/runner/go/pkg/mod/github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x4a8
github.com/hashicorp/waypoint/internal/cli.Main({0x1400006e0a0?, 0x1048a184c?, 0x107a7fd80?})
        /home/runner/work/waypoint/waypoint/internal/cli/main.go:127 +0x510
main.main()
        /home/runner/work/waypoint/waypoint/cmd/waypoint/main.go:14 +0xa8

How do I test this?

  • Install a runner to ECS
  • Find and manually delete the backing EFS filesystem
  • Uninstall the ECS runner
  • Observe no panic!

@izaaklauer izaaklauer changed the title Do not panic if EFS not found Fixing panic in ECS runner uninstall when EFS is missing Jul 5, 2023
@izaaklauer izaaklauer marked this pull request as ready for review July 5, 2023 16:16
@izaaklauer izaaklauer requested a review from a team as a code owner July 5, 2023 16:16
.changelog/4829.txt Outdated Show resolved Hide resolved
Co-authored-by: Joe <83741749+paladin-devops@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants