jippi/hashi-ui

Crash on bad payload on api

Open

#357 aperta il 13 ott 2017

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (157 fork)batch import
bughelp wanted

Metriche repository

Star
 (1235 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Hello,

Thx for all your work, hashi-ui is really usefull for me :+1: :)

I made upgrade to 0.22.0 and discover the api... a few tests are ok... but i see a crash when i do a :

curl -s https://my-hashi-ui-url/api/nomad/global -d '{"type":"NOMAD_WATCH_NODE"}'

"S" on NODE was missing... but on server side, this little mistake was a little more critical :

panic: interface conversion: interface {} is nil, not string

goroutine 1348 [running]:
github.com/jippi/hashi-ui/backend/nomad/nodes.(*info).id(...)
	/home/travis/gopath/src/github.com/jippi/hashi-ui/backend/nomad/nodes/info.go:56
github.com/jippi/hashi-ui/backend/nomad/nodes.(*info).Key(0xc420223600, 0xdf7b20, 0xc42031fda0)
	/home/travis/gopath/src/github.com/jippi/hashi-ui/backend/nomad/nodes/info.go:44 +0xba
github.com/jippi/hashi-ui/backend/subscriber.Watch(0xdf87e0, 0xc420223600, 0xdf69e0, 0xc42037eaf0, 0xc42037eaa0, 0xc420494c60, 0xc42074a9c0)
	/home/travis/gopath/src/github.com/jippi/hashi-ui/backend/subscriber/functions.go:31 +0x4c
created by main.(*connection).watch
	/home/travis/gopath/src/github.com/jippi/hashi-ui/backend/connection.go:437 +0xa4
time="2017-10-13T15:04:13+02:00" level=error msg="No longer subscribed to /allocation/877f24a7-051f-ed2b-4a67-6ce67a8de6e2/stream?file=/alloc/logs/hashi-ui-task.stderr.0" connection_id=bafc3956 source=connection

Guida contributor