hashicorp/damon

Segfault while viewing allocation logs

cPanelRicky opened this issue · 2 comments

First off, this project is amazing and will be a staple in my day to day for a long time!

I just built the binary and was testing it out and I left the log viewer open on an allocation for maybe 30-60 seconds while I was reading the projects README when Damon crashed with the error below.

(Note, the TUI crashing left me unable to copypasta the error and it was a bit mangled format-wise in my terminal so I had to hand type it, apologies if the formatting is a bit different)

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation on violation code=0x1 addr=0x10 pc=0x73a1b8]
  goroutine 242 [running]:
      github.com/hcjulz/damon/watcher.(*Watcher).SubscribeToLogs.func1(0xc0004c20c0, 0xc000254190, 0xc0006285a0, 0xc0004a23c0) /workspaces/damon/watcher/logs.go:35 +0x118
      created by github.com/hcjulz/damon/watcher.(*Watcher).SubscribeToLogs /workspaces/damon/watcher/logs.go:31 +0x385

Environment Information

 ➜  consul-cluster git:(master) ✗ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

$ nomad version
Nomad v1.1.3 (8c0c8140997329136971e66e4c2337dfcf932692)

$ nomad server members
Name                        Address      Port  Status  Leader  Protocol  Build  Datacenter  Region
nomad-0.global             10.0.0.2   4648   alive   true         2          1.1.3  awe-prod-1  global
nomad-1.global              10.0.0.3   4648   alive   false       2           1.1.3  awe-prod-1  global
nomad-2.global             10.0.0.4   4648   alive   false       2           1.1.3  awe-prod-1  global

Haven't been able to reproduce the error again since but i'll try to watch more closely when monitoring logs to try and see if I can get some more context.

@cPanelRicky Thank you so much for trying this tool out 👏

This is very helpful, Thx!!
I took a quick look at this and it seems like Nomad returned log frames but without data, which caused this to fail. I have to add a check for that.

This was addressed in PR #22 and shouldn't happen anymore. But if you encounter this issue again please feel free to re-open it again.