Fix No such key segfault
#14 (closed) - so I close this one
This is specific fix in error handling, which is was later broadly addressed bypossibly the same error as #12
2019/12/31 14:36:27 handler.go:121: No such key support@yapeal.ch/lAbEj_o5PYXRf7gJUvU1Dokjt_d1RRYH3Mw9Xa01XKk=
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x10660388]
goroutine 37958 [running]:
code.vereign.com/code/key-storage-agent/handler.(*KeyStorageServerImpl).GetKey(0xc42039e000, 0x108fa280, 0xc4206a6180, 0xc420839500, 0x0, 0x0, 0x0)
/srv/src/code.vereign.com/code/key-storage-agent/handler/handler.go:124 +0xb88
code.vereign.com/code/key-storage-agent/vendor/code.vereign.com/code/viam-apis/key-storage-agent/api._KeyStorage_GetKey_Handler.func1(0x108fa280, 0xc4206a6180, 0x107dfd20, 0xc420839500, 0x106ecba0, 0xc4202de560, 0x108fa280, 0xc4206a6180)
/srv/src/code.vereign.com/code/key-storage-agent/vendor/code.vereign.com/code/viam-apis/key-storage-agent/api/api.pb.go:1405 +0x84
code.vereign.com/code/key-storage-agent/server.unaryInterceptor(0x108fa280, 0xc4206a6120, 0x107dfd20, 0xc420839500, 0xc4200152a0, 0xc4200152c0, 0xc4206a6030, 0x1073aea0, 0x10e131d0, 0x1082a0c0)
/srv/src/code.vereign.com/code/key-storage-agent/server/server.go:106 +0x18c
code.vereign.com/code/key-storage-agent/vendor/code.vereign.com/code/viam-apis/key-storage-agent/api._KeyStorage_GetKey_Handler(0x107f7780, 0xc42039e000, 0x108fa280, 0xc4206a6120, 0xc420584c60, 0x1087d740, 0x0, 0x0, 0xc420034730, 0x42)
/srv/src/code.vereign.com/code/key-storage-agent/vendor/code.vereign.com/code/viam-apis/key-storage-agent/api/api.pb.go:1407 +0x160
code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc420001c80, 0x108fd1a0, 0xc42059d380, 0xc42045e600, 0xc420030ff0, 0x10d99f00, 0x0, 0x0, 0x0)
/srv/src/code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc/server.go:1024 +0x450
code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc.(*Server).handleStream(0xc420001c80, 0x108fd1a0, 0xc42059d380, 0xc42045e600, 0x0)
/srv/src/code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc/server.go:1313 +0xcb8
code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc420038100, 0xc420001c80, 0x108fd1a0, 0xc42059d380, 0xc42045e600)
/srv/src/code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc/server.go:722 +0x90
created by code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
/srv/src/code.vereign.com/code/key-storage-agent/vendor/google.golang.org/grpc/server.go:720 +0x90
Edited by Damyan Mitev