When terragrunt is called with a command that requires a subcommand, but no subcommand is provided, terragrunt errors with a "slice bounds out of range" error as below:
$ terragrunt state
[terragrunt] [**] 2017/06/21 11:37:48 Running command: terraform --version
[terragrunt] 2017/06/21 11:37:48 Reading Terragrunt config file at **/terraform.tfvars
[terragrunt] 2017/06/21 11:37:48 runtime.errorString runtime error: slice bounds out of range
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/errors/errors.go:72 (0x461801)
/usr/local/go/src/runtime/asm_amd64.s:479 (0x45632c)
call32: NO_LOCAL_POINTERS; \
/usr/local/go/src/runtime/panic.go:458 (0x428b93)
gopanic:
/usr/local/go/src/runtime/panic.go:34 (0x4274ed)
panicslice: panicCheckMalloc(sliceError)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/cli/cli_app.go:202 (0x45cb01)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/cli/cli_app.go:182 (0x45c410)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/cli/cli_app.go:163 (0x45c105)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/vendor/github.com/urfave/cli/app.go:485 (0x48ac34)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/vendor/github.com/urfave/cli/app.go:259 (0x488a4f)
/home/ubuntu/.go_workspace/src/github.com/gruntwork-io/terragrunt/main.go:20 (0x4010c4)
/usr/local/go/src/runtime/proc.go:183 (0x42a864)
main: }
/usr/local/go/src/runtime/asm_amd64.s:2086 (0x458e51)
goexit: MOVQ DI, (R8)
[terragrunt] 2017/06/21 11:37:48 Unable to determine underlying exit code, so Terragrunt will exit with error code 1
This happens for the following commands
terragrunt stateterragrunt force-unlockterragrunt debugAh, definitely a bug. Thanks for reporting. Probably a straight forward fix by checking bounds here: https://github.com/gruntwork-io/terragrunt/blob/master/cli/cli_app.go#L194-L207. PRs welcome, if anyone has a few minutes!
I was stuck on doing a "terragrunt force-unlock" and this helped be realize that you need to specify the lock ID as an argument to "terragrunt force-unlock". Cheers!
+1
Fixed with https://github.com/gruntwork-io/terragrunt/pull/420 and merged in as of terragrunt v0.14.1
Thx @sarkis!
Most helpful comment
I was stuck on doing a "terragrunt force-unlock" and this helped be realize that you need to specify the lock ID as an argument to "terragrunt force-unlock". Cheers!