runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.68k stars 1.05k forks source link

Specifying a wrong directory should not crash #1463

Open wosc opened 3 years ago

wosc commented 3 years ago

On atlantis 0.16.0, if I mistype the directory in atlantis plan -d this-does-not-exist, I'm greeted with

Error: goroutine panic. This is a bug.

runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:212 (0x4494c9)
/usr/local/go/src/runtime/signal_unix.go:695 (0x449318)
/go/src/github.com/runatlantis/atlantis/server/events/project_command_builder.go:481 (0xf482f3)
/go/src/github.com/runatlantis/atlantis/server/events/project_command_builder.go:434 (0xf47d83)
/go/src/github.com/runatlantis/atlantis/server/events/project_command_builder.go:329 (0xf4680f)
/go/src/github.com/runatlantis/atlantis/server/events/project_command_builder.go:223 (0xf454be)
/go/src/github.com/runatlantis/atlantis/server/events/project_command_builder.go:89 (0xf42cc7)
/go/src/github.com/runatlantis/atlantis/server/events/command_runner.go:301 (0xf2e2dc)
/usr/local/go/src/runtime/asm_amd64.s:1373 (0x4636e0)

It would be more understandable, if the error said something like "no such file or directory" instead.

majormoses commented 3 years ago

Ya we ran into that as well. It should also be recoverable without needing to restart the service/process.

nitrocode commented 1 year ago

I do not believe this is still an issue. If a directory does not exist, it will return a pr status with a red x in github.