jippi/hashi-ui

Crash on bad payload on api

开放

#357 创建于 2017年10月13日

 (1 条评论) (0 个反应) (0 位负责人)JavaScript (144 个派生)batch import
bughelp wanted

仓库指标

星标
 (1,223 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南