bitfinexcom / bitfinex-api-go

BITFINEX Go trading API - Bitcoin, Litecoin, and Ether exchange
https://www.bitfinex.com/
MIT License
310 stars 220 forks source link

v2: panic: interface conversion: interface {} is nil, not []interface {} #67

Open preexo opened 6 years ago

preexo commented 6 years ago

Looks like some message couldn't be decoded.

Not sure how to tackle this, anyone an idea? Should we be catching this before it get's through the switch into notificationFromRaw?

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 11 [running]:
github.com/bitfinexcom/bitfinex-api-go/v2.notificationFromRaw(0x1081e880, 0x8, 0x8, 0x0, 0x0, 0x1097e261, 0xf, 0x0, 0x0, 0x0, ...)
        /home/pi/go/src/github.com/bitfinexcom/bitfinex-api-go/v2/private_types.go:916 +0x590
github.com/bitfinexcom/bitfinex-api-go/v2.(*bfxWebsocket).convertRaw(0x10856c40, 0x1097e260, 0x1, 0x1081e880, 0x8, 0x8, 0x1083bee8, 0x341040)
        /home/pi/go/src/github.com/bitfinexcom/bitfinex-api-go/v2/websocket_private.go:140 +0x1dc
github.com/bitfinexcom/bitfinex-api-go/v2.(*bfxWebsocket).handlePrivateDataMessage(0x10856c40, 0x1095c5a0, 0x3, 0x4, 0x10ccc548, 0x1, 0x0, 0x0)
        /home/pi/go/src/github.com/bitfinexcom/bitfinex-api-go/v2/websocket_private.go:27 +0xe0
github.com/bitfinexcom/bitfinex-api-go/v2.(*bfxWebsocket).handleMessage(0x10856c40, 0x108b1800, 0x73, 0x600, 0x600, 0x0)
        /home/pi/go/src/github.com/bitfinexcom/bitfinex-api-go/v2/websocket_service.go:251 +0x214
github.com/bitfinexcom/bitfinex-api-go/v2.(*bfxWebsocket).receiver(0x10856c40)
        /home/pi/go/src/github.com/bitfinexcom/bitfinex-api-go/v2/websocket_service.go:157 +0xc8
created by github.com/bitfinexcom/bitfinex-api-go/v2.(*bfxWebsocket).connect
        /home/pi/go/src/github.com/bitfinexcom/bitfinex-api-go/v2/websocket_service.go:121 +0x194
preexo commented 6 years ago

I was wrong, it is still hapenning.

panic: interface conversion: interface {} is nil, not []interface {}

goroutine 8 [running]:
bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2.NewNotificationFromRaw(0xc4203a2000, 0x8, 0x8, 0x0, 0xc420252250, 0xf, 0x0, 0x0, 0x0, 0x0, ...)
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/types.go:1025 +0xa0e
bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket.(*Client).convertRaw(0xc42016c000, 0xc420252231, 0x1, 0xc4203a2000, 0x8, 0x8, 0x14b3cd8, 0xc4202d6000)
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket/channels.go:307 +0x2d5
bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket.(*Client).handlePrivateDataMessage(0xc42016c000, 0xc420252231, 0x1, 0xc4203a2000, 0x8, 0x8, 0x13e1901, 0xc42021c300, 0x0, 0x0)
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket/channels.go:182 +0x7e
bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket.(*Client).handlePrivateChannel(0xc42016c000, 0xc42014e700, 0x3, 0x4, 0x0, 0x0)
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket/channels.go:107 +0xdb
bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket.(*Client).handleChannel(0xc42016c000, 0xc420376c00, 0x6d, 0x600, 0x1, 0x20)
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket/channels.go:46 +0x347
bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket.(*Client).handleMessage(0xc42016c000, 0xc420376c00, 0x6d, 0x600, 0x0, 0x0)
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket/client.go:299 +0x110
bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket.(*Client).listenUpstream(0xc42016c000)
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket/client.go:259 +0x164
created by bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket.(*Client).Connect
        /Users/tim/Projects/go-workspace/src/bitbucket.org/preexo/bitfinex2/vendor/github.com/bitfinexcom/bitfinex-api-go/v2/websocket/client.go:228 +0x8b
jvatianou-connamara commented 6 years ago

for now marking help wanted and in the backlog. may promote to bug eventually though.