ekristen / aws-nuke

Remove all the resources from an AWS account
https://ekristen.github.io/aws-nuke/
MIT License
256 stars 26 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #385

Closed Ryce closed 2 weeks ago

Ryce commented 1 month ago

aws-nuke run

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1024e212c]

goroutine 1 [running]:
main.main.func1()
    github.com/ekristen/aws-nuke/v3/main.go:28 +0x60
panic({0x107c13680?, 0x10cdd67b0?})
    runtime/panic.go:785 +0x124
github.com/ekristen/libnuke/pkg/config.(*Config).ResolveDeprecations(0x14000028000)
    github.com/ekristen/libnuke@v0.19.2/pkg/config/config.go:240 +0x6c
github.com/ekristen/libnuke/pkg/config.New({{0x1064a45a1, 0xb}, 0x140003ff030, 0x14000012ea0, 0x0, 0x0})
    github.com/ekristen/libnuke@v0.19.2/pkg/config/config.go:118 +0x2cc
github.com/ekristen/aws-nuke/v3/pkg/config.New({{0x1064a45a1, 0xb}, 0x140003ff030, 0x14000012ea0, 0x0, 0x0})
    github.com/ekristen/aws-nuke/v3/pkg/config/config.go:18 +0x44
github.com/ekristen/aws-nuke/v3/pkg/commands/nuke.execute(0x1400013e3c0)
    github.com/ekristen/aws-nuke/v3/pkg/commands/nuke/nuke.go:74 +0x3bc
github.com/urfave/cli/v2.(*Command).Run(0x140004122c0, 0x1400013e3c0, {0x140003fbe50, 0x1, 0x1})
    github.com/urfave/cli/v2@v2.27.5/command.go:276 +0x600
github.com/urfave/cli/v2.(*Command).Run(0x140004129a0, 0x1400013e280, {0x14000146000, 0x2, 0x2})
    github.com/urfave/cli/v2@v2.27.5/command.go:269 +0x83c
github.com/urfave/cli/v2.(*App).RunContext(0x14000018000, {0x108efcc90, 0x10ce17740}, {0x14000146000, 0x2, 0x2})
    github.com/urfave/cli/v2@v2.27.5/app.go:333 +0x51c
github.com/urfave/cli/v2.(*App).Run(...)
    github.com/urfave/cli/v2@v2.27.5/app.go:307
main.main()
    github.com/ekristen/aws-nuke/v3/main.go:50 +0x1e0

This is just on the run command, nothing special happening here

ekristen commented 1 month ago

You only ran aws-nuke run? What version? What does your config.yaml look like? There must have been one in the directory in which you ran the command.

ekristen commented 1 month ago

@Ryce please provide your config.yaml.

shblue21 commented 2 weeks ago

I am having the same problem. It's a windows environment, the config and commands I used, and the error is below.

Is the problem related to this #321 issue?

C:\Users\shblu\Downloads\aws-nuke-v3.29.2-windows-amd64>aws-nuke.exe nuke -c config.yaml --profile personal
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xf59e0d]

goroutine 1 [running]:
main.main.func1()
        github.com/ekristen/aws-nuke/v3/main.go:28 +0x54
panic({0x5f15d20?, 0xb8be620?})
        runtime/panic.go:914 +0x21f
github.com/ekristen/libnuke/pkg/config.(*Config).ResolveDeprecations(0xc00009c100)
        github.com/ekristen/libnuke@v0.21.1/pkg/config/config.go:240 +0x8d
github.com/ekristen/libnuke/pkg/config.New({{0xc00011c0c0, 0xb}, 0xc000422150, 0xc0000a4c30, 0x0, 0x0})
        github.com/ekristen/libnuke@v0.21.1/pkg/config/config.go:118 +0x30f
github.com/ekristen/aws-nuke/v3/pkg/config.New({{0xc00011c0c0, 0xb}, 0xc000422150, 0xc0000a4c30, 0x0, 0x0})
        github.com/ekristen/aws-nuke/v3/pkg/config/config.go:18 +0x49
github.com/ekristen/aws-nuke/v3/pkg/commands/nuke.execute(0xc0000982c0)
        github.com/ekristen/aws-nuke/v3/pkg/commands/nuke/nuke.go:78 +0x5f6
github.com/urfave/cli/v2.(*Command).Run(0xc0000ae000, 0xc0000982c0, {0xc00009a140, 0x5, 0x5})
        github.com/urfave/cli/v2@v2.27.5/command.go:276 +0x9dd
github.com/urfave/cli/v2.(*Command).Run(0xc00043e580, 0xc000098180, {0xc000142000, 0x6, 0x8})
        github.com/urfave/cli/v2@v2.27.5/command.go:269 +0xc2e
github.com/urfave/cli/v2.(*App).RunContext(0xc00022c000, {0x7a5e850?, 0xb930320}, {0xc000142000, 0x6, 0x8})
        github.com/urfave/cli/v2@v2.27.5/app.go:333 +0x5db
github.com/urfave/cli/v2.(*App).Run(...)
        github.com/urfave/cli/v2@v2.27.5/app.go:307
main.main()
        github.com/ekristen/aws-nuke/v3/main.go:50 +0x1f2
regions:
  - global

accounts:
  "0964xxxxxxxx":
ekristen commented 2 weeks ago

@shblue21 your config is invalid, add {} to the end of the account at a minimum to get started. I'll try and put some guards in in the mean time.

regions:
  - global

accounts:
  "0964xxxxxxxx": {}
ekristen commented 2 weeks ago

:tada: This issue has been resolved in version 3.29.3 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: