Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic on atmos terraform providers lock #794

Closed
mss opened this issue Nov 19, 2024 · 3 comments
Closed

panic on atmos terraform providers lock #794

mss opened this issue Nov 19, 2024 · 3 comments
Labels
bug 🐛 An issue with the system Short List

Comments

@mss
Copy link
Contributor

mss commented Nov 19, 2024

Describe the Bug

I was playing around with lock files and ran into this:

panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/cloudposse/atmos/internal/exec.ProcessStacks({{0x53109b0, 0x1}, {{{0xc000ba6fc0, 0x14}, 0x0, {0xc000a85540, 0x31}, 0x1, 0x1, 0x1, ...}, ...}, ...}, ...)
        /home/runner/work/atmos/atmos/source/internal/exec/utils.go:426 +0x105d
github.com/cloudposse/atmos/internal/exec.ExecuteTerraform({{0x0, 0x0}, {0x7ffdcb1b2d70, 0x14}, {0x0, 0x0}, {0x2ff3220, 0x9}, {0x7ffdcb1b2d5c, 0x4}, ...})
        /home/runner/work/atmos/atmos/source/internal/exec/terraform.go:64 +0x227
github.com/cloudposse/atmos/internal/exec.ExecuteTerraformCmd(0x0?, {0xc00078cb40?, 0x2fe64e4?, 0x7?}, {0x0?, 0x7?, 0x5535980?})
        /home/runner/work/atmos/atmos/source/internal/exec/terraform.go:33 +0xcc
github.com/cloudposse/atmos/cmd.init.func17(0x54fe820, {0xc00078cb40, 0x5, 0x5})
        /home/runner/work/atmos/atmos/source/cmd/terraform.go:32 +0x189
github.com/spf13/cobra.(*Command).execute(0x54fe820, {0xc00078cb40, 0x5, 0x5})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:989 +0xa91
github.com/spf13/cobra.(*Command).ExecuteC(0x54fe540)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/cloudposse/atmos/cmd.Execute()
        /home/runner/work/atmos/atmos/source/cmd/root.go:107 +0x3b1
main.main()
        /home/runner/work/atmos/atmos/source/main.go:10 +0x1e

Expected Behavior

No panic.

Steps to Reproduce

atmos terraform providers lock foo --stack bar

Screenshots

No response

Environment

  • Atmos Version 1.107.1
  • Terraform Version 1.8.5

Additional Context

Looks like I should have executed atmos terraform providers foo --stack bar lock

@mss mss added the bug 🐛 An issue with the system label Nov 19, 2024
@GabisCampana
Copy link

@aknysh

@brenix
Copy link

brenix commented Dec 4, 2024

Same issue on v1.110.0, but with a custom command. Panic occurs on the same code path internal/exec/utils.go:426

panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/cloudposse/atmos/internal/exec.ProcessStacks({{0xc0005c6688, 0x2}, {{{0xc000c91cf8, 0x14}, 0x1, {0xc000c9ae00, 0x31}, 0x1, 0x1, 0x1, ...}, ...}, ...}, ...)
        /home/runner/work/atmos/atmos/source/internal/exec/utils.go:426 +0x105d
github.com/cloudposse/atmos/internal/exec.ExecuteDescribeComponent({0xc0005c6618?, 0x18?}, {0xc0005c6650?, 0x12?}, 0x1)
        /home/runner/work/atmos/atmos/source/internal/exec/describe_component.go:75 +0x1ad
github.com/cloudposse/atmos/cmd.executeCustomCommand({{0xc000c96d9a, 0x2}, {{{0xc000c91128, 0x14}, 0x1, {0xc000c9a540, 0x31}, 0x1, 0x1, 0x1, ...}, ...}, ...}, ...)
        /home/runner/work/atmos/atmos/source/cmd/cmd_utils.go:275 +0x5f4
github.com/cloudposse/atmos/cmd.processCustomCommands.func2(0xc000573b08?, {0xc0004e78f0?, 0x4?, 0x2fdc067?})
        /home/runner/work/atmos/atmos/source/cmd/cmd_utils.go:70 +0x5e
github.com/spf13/cobra.(*Command).execute(0xc000573b08, {0xc0004e7860, 0x3, 0x3})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:989 +0xa91
github.com/spf13/cobra.(*Command).ExecuteC(0x5502e20)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/cloudposse/atmos/cmd.Execute()
        /home/runner/work/atmos/atmos/source/cmd/root.go:107 +0x3b1
main.main()
        /home/runner/work/atmos/atmos/source/main.go:10 +0x1e

Was previously using 1.95.0 which was working fine

@brenix
Copy link

brenix commented Dec 4, 2024

When performing a git bisect, I believe I have narrowed the issue down to this commit: 3342e8e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system Short List
Projects
Status: Done
Development

No branches or pull requests

4 participants