The error message is printed out by lotus cli helper when an error is returned from a CLI Action:
fmt.Fprintf(os.Stderr, "ERROR: %s\n\n", err)
The format of the error message %!s(PANIC=...nil pointer indicates that fmt.Fprintf encountered a nil pointer when trying to call the Error() method on the golang error object that was passed to it. This is most likely because the error object wraps a nil error. An example golang Test that reproduces this behaviour:
type myerr struct {
err error
}
func (e *myerr) Error() string {
// if e.err is nil, this will panic
return e.err.Error()
}
func TestPrintErr(t *testing.T) {
fmt.Printf("%s\n", &myerr{})
}
=== RUN TestPrintErr
%!s(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)
--- PASS: TestPrintErr (0.00s)
As described in https://github.com/filecoin-project/boost/issues/1193 when go-jsonrpc encounters some errors it turns them into
%!s(PANIC=...nil pointer
lotus users have encountered this error message when making API calls that time out:
The error message is printed out by lotus cli helper when an error is returned from a CLI Action:
The format of the error message
%!s(PANIC=...nil pointer
indicates that fmt.Fprintf encountered a nil pointer when trying to call theError()
method on the golangerror
object that was passed to it. This is most likely because theerror
object wraps a nil error. An example golang Test that reproduces this behaviour:It looks like the underlying implementation of go-jsonrpc is returning an error object that wraps a nil error. My best guess is that this bug was introduced in https://github.com/filecoin-project/go-jsonrpc/pull/72