odin
odin copied to clipboard
[BUG] Panic during odin log
Describe the bug Deploying a new job, then pulling logs via the CLI results in a panic (SIGSEGV).
To Reproduce
-
odin deploy -f test.job.yaml
-
odin log -i {job_id}
vagrant@vagrant:~/odin$ odin log -i dea194794589
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x79c764]
goroutine 1 [running]:
github.com/theycallmemac/odin/odin-cli/pkg/commands.logJob(0x7ffda66ec793, 0xc, 0x868da6, 0x5)
/home/vagrant/odin/odin-cli/pkg/commands/log.go:53 +0x154
github.com/theycallmemac/odin/odin-cli/pkg/commands.glob..func7(0xbb6c80, 0xc00000e720, 0x0, 0x2)
/home/vagrant/odin/odin-cli/pkg/commands/log.go:25 +0xda
github.com/spf13/cobra.(*Command).execute(0xbb6c80, 0xc00000e6e0, 0x2, 0x2, 0xbb6c80, 0xc00000e6e0)
/home/vagrant/go/pkg/mod/github.com/spf13/[email protected]/command.go:844 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xbb79a0, 0x443a8a, 0xb7f4c0, 0xc000000180)
/home/vagrant/go/pkg/mod/github.com/spf13/[email protected]/command.go:945 +0x317
github.com/spf13/cobra.(*Command).Execute(...)
/home/vagrant/go/pkg/mod/github.com/spf13/[email protected]/command.go:885
github.com/theycallmemac/odin/odin-cli/pkg/commands.Execute()
/home/vagrant/odin/odin-cli/pkg/commands/root.go:33 +0x31
main.main()
/home/vagrant/odin/odin-cli/cmd/odin/odin.go:6 +0x20
Expected behavior I believe just no output, until the job runs the first time.
Screenshots n/a
Desktop (please complete the following information):
- OS: Ubuntu 18 LTS (vagrant on macOS)
Yes it looks like a panic is generated until a job is finally run. This should be an easy enough fix. I think the CLI is quite prone to panics like this so a sweep of the tool might be in order.
@ttymck strangely enough I'm unable to duplicate this issue. When I run odin log -i {job-id}
, a panic is not generated.
Can you confirm you are using the v1.0.0 release and not the code in the master branch?
@theycallmemac I am getting the same error as above on Ubuntu 20.04 on a DigitalOcean droplet. I can confirm that I am using tagged v1.0.0 release
git checkout tags/v1.0.0 Note: switching to 'tags/v1.0.0'.
HEAD is now at 081323d
as per last commit on that tag.