adrianlzt/piclimbing

go panic

Opened this issue · 1 comments

Sometimes one of the goroutines crashes with this panic:

json: error calling MarshalJSON for type json.RawMessage: invalid character 'N' looking for beginning of value

goroutine 120 [running]:
runtime/debug.Stack(0x1, 0x0, 0x0)
        /usr/lib/go/src/runtime/debug/stack.go:24 +0x78
runtime/debug.PrintStack()
        /usr/lib/go/src/runtime/debug/stack.go:16 +0x14
github.com/99designs/gqlgen/graphql.DefaultRecover(0x11856f8, 0x268b860, 0x376ea0, 0x26e5ca0, 0x26e5c60, 0x199)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/recovery.go:16 +0x8c
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1.1(0x1818a80, 0x11856f8, 0x268b860, 0x6afcc40, 0x268b720)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:231 +0x58
panic(0x376ea0, 0x26e5ca0)
        /usr/lib/go/src/runtime/panic.go:969 +0x118
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).sendResponse(0x6afcc40, 0x13ab696, 0x1, 0x26e5c60)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:256 +0x104
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1(0x1818a80, 0x11856f8, 0x268b860, 0x6afcc40, 0x268b720, 0x6a561f8)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:242 +0xbc
created by github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:228 +0x564

Another with the same error:

E0716 17:58:32.237694     705 capture_linux.go:29]  "msg"="reading from the load cell, ingoring this measure. Wait 1s to retry" "error"="read /sys/devices/platform/hx711/iio:device0/in_voltage0_raw: input/output error"
json: error calling MarshalJSON for type json.RawMessage: invalid character 'N' looking for beginning of value

goroutine 206 [running]:
runtime/debug.Stack(0x1, 0x0, 0x0)
        /usr/lib/go/src/runtime/debug/stack.go:24 +0x78
runtime/debug.PrintStack()
        /usr/lib/go/src/runtime/debug/stack.go:16 +0x14
github.com/99designs/gqlgen/graphql.DefaultRecover(0x11856f8, 0x38de400, 0x376ea0, 0x38f43c0, 0x38f4380, 0x199)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/recovery.go:16 +0x8c
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1.1(0x38cc6c0, 0x11856f8, 0x38de400, 0x7af6310, 0x38de2c0)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:231 +0x58
panic(0x376ea0, 0x38f43c0)
        /usr/lib/go/src/runtime/panic.go:969 +0x118
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).sendResponse(0x7af6310, 0x13ab692, 0x1, 0x38f4380)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:256 +0x104
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1(0x38cc6c0, 0x11856f8, 0x38de400, 0x7af6310, 0x38de2c0, 0x7b02590)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:242 +0xbc
created by github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:228 +0x564
json: error calling MarshalJSON for type json.RawMessage: invalid character 'N' looking for beginning of value

goroutine 231 [running]:
runtime/debug.Stack(0x1, 0x0, 0x0)
        /usr/lib/go/src/runtime/debug/stack.go:24 +0x78
runtime/debug.PrintStack()
        /usr/lib/go/src/runtime/debug/stack.go:16 +0x14
github.com/99designs/gqlgen/graphql.DefaultRecover(0x11856f8, 0x28ca540, 0x376ea0, 0x28cb560, 0x28cb3e0, 0x199)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/recovery.go:16 +0x8c
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1.1(0x7b7afc0, 0x11856f8, 0x28ca540, 0x7af6070, 0x280ce60)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:231 +0x58
panic(0x376ea0, 0x28cb560)
        /usr/lib/go/src/runtime/panic.go:969 +0x118
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).sendResponse(0x7af6070, 0x13ab692, 0x1, 0x28cb3e0)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:256 +0x104
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1(0x7b7afc0, 0x11856f8, 0x28ca540, 0x7af6070, 0x280ce60, 0x2810e08)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:242 +0xbc
created by github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:228 +0x564
json: error calling MarshalJSON for type json.RawMessage: invalid character 'N' looking for beginning of value

goroutine 255 [running]:
runtime/debug.Stack(0x1, 0x0, 0x0)
        /usr/lib/go/src/runtime/debug/stack.go:24 +0x78
runtime/debug.PrintStack()
        /usr/lib/go/src/runtime/debug/stack.go:16 +0x14
github.com/99designs/gqlgen/graphql.DefaultRecover(0x11856f8, 0x7b74440, 0x376ea0, 0x7b746c0, 0x7b74680, 0x199)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/recovery.go:16 +0x8c
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1.1(0x7b7b740, 0x11856f8, 0x7b74440, 0x7af64d0, 0x7b74300)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:231 +0x58
panic(0x376ea0, 0x7b746c0)
        /usr/lib/go/src/runtime/panic.go:969 +0x118
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).sendResponse(0x7af64d0, 0x13ab692, 0x1, 0x7b74680)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:256 +0x104
github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe.func1(0x7b7b740, 0x11856f8, 0x7b74440, 0x7af64d0, 0x7b74300, 0x2811010)
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:242 +0xbc
created by github.com/99designs/gqlgen/graphql/handler/transport.(*wsConnection).subscribe
        /home/adrian/go/pkg/mod/github.com/adrianlzt/gqlgen@v0.11.3-1/graphql/handler/transport/websocket.go:228 +0x564
        ````