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

Runtime error when rm non-existing pod with uuid-file option #2678

Closed
cvasseur opened this Issue May 24, 2016 · 0 comments

Comments

Projects
None yet
2 participants
@cvasseur

cvasseur commented May 24, 2016

Environment

$ rkt version
rkt Version: 1.6.0
appc Version: 0.8.1
Go Version: go1.6.1
Go OS/Arch: linux/amd64
Features: -TPM

Got the following error

$ echo "f08587be-126b-4541-8529-0b9f22ad4b83" > /tmp/uuid

$ rkt rm --uuid-file=/tmp/uuid
rm: cannot get pod: pod "f08587be-126b-4541-8529-0b9f22ad4b83" not found
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x30 pc=0x43380a]

goroutine 1 [running, locked to thread]:
panic(0xd0d280, 0xc820010120)
    /usr/lib/go/src/runtime/panic.go:464 +0x3e6
main.removePod(0x0, 0xe2e960)
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/rkt/rm.go:94 +0x3a
main.runRm(0x1478aa0, 0xc820139d60, 0x0, 0x1, 0x0)
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/rkt/rm.go:78 +0x227
main.runWrapper.func1(0x1478aa0, 0xc820139d60, 0x0, 0x1)
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/rkt/rkt.go:197 +0x43
main.ensureSuperuser.func1(0x1478aa0, 0xc820139d60, 0x0, 0x1)
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/rkt/rkt.go:211 +0x160
github.com/spf13/cobra.(*Command).execute(0x1478aa0, 0xc820139d30, 0x1, 0x1, 0x0, 0x0)
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/Godeps/_workspace/src/github.com/spf13/cobra/command.go:572 +0x85a
github.com/spf13/cobra.(*Command).ExecuteC(0x14766a0, 0x1478aa0, 0x0, 0x0)
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/Godeps/_workspace/src/github.com/spf13/cobra/command.go:662 +0x53f
github.com/spf13/cobra.(*Command).Execute(0x14766a0, 0x0, 0x0)
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/Godeps/_workspace/src/github.com/spf13/cobra/command.go:618 +0x2d
main.main()
    /opt/build-rkt/gopath/src/github.com/coreos/rkt/rkt/main.go:32 +0x98

$ echo $?
2

It works fine without uuid-file option

$ rkt rm f08587be-126b-4541-8529-0b9f22ad4b83
rm: unable to resolve UUID: no matches found for "f08587be-126b-4541-8529-0b9f22ad4b83"

$ echo $?
0

Expected behavior

$ echo "f08587be-126b-4541-8529-0b9f22ad4b83" > /tmp/uuid
$ rkt rm --uuid-file=/tmp/uuid
rm: unable to resolve UUID: no matches found for "f08587be-126b-4541-8529-0b9f22ad4b83"

$ echo $?
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment