Skip to content

tm-monitor: Error management in http_server #3791

@sabau

Description

@sabau

Error management in http_handle led to panic.
The outome was an empty answer as RPC and logged:

Just to debug I tried changing rpc/lib/server/http_server.go#165 from e.(error) to errors.New(e.(string)) and the errors started being displayed as RPC reply

Tendermint version (use tendermint version or git rev-parse --verify HEAD if installed from source): 0.32.0-2515f0e1

ABCI app (name for built-in, URL for self-written if it's publicly available):

Environment:

  • OS (e.g. from /etc/os-release): MacOS
  • Install tools:
  • Others:

What happened:
from a fresh clone of the repo
I ran tm-monitor against one or more local nodes.

On the browser I navigate to any link at localhost:26670 and I got either errors or empty reply

What you expected to happen:
To see the status of a node or of the network

Have you tried the latest version: yes

How to reproduce it (as minimally and precisely as possible):

make get_tools
make install
cd tools/tm-monitor
make install

tendermint init
tendermint node --proxy_app=kvstore

tm-monitor localhost:26657

Logs (paste a small part showing an error (< 10 lines) or link a pastebin, gist, etc. containing more of the log file):

2019/07/12 15:42:13 http: panic serving [::1]:63426: interface conversion: string is not error: missing method Error
goroutine 178 [running]:
net/http.(*conn).serve.func1(0xc000aca8c0)
        /usr/local/Cellar/go/1.12.5/libexec/src/net/http/server.go:1769 +0x139
panic(0x176b7a0, 0xc000b9e6f0)
        /usr/local/Cellar/go/1.12.5/libexec/src/runtime/panic.go:522 +0x1b5
github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1.1(0xc000ac7400, 0x1a6d240, 0x2005040, 0xbf42416d600791d8, 0x1c2a1bc77, 0x1fe81c0, 0xc000c3a000)
        /Users/sabau/.go/src/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:165 +0x69a
panic(0x17283c0, 0x1a4c070)
        /usr/local/Cellar/go/1.12.5/libexec/src/runtime/panic.go:522 +0x1b5
reflect.Value.call(0x1739380, 0xc00093e900, 0x13, 0x183afa9, 0x4, 0xc000ac7460, 0x1, 0x1, 0x172edc0, 0xc00001ac01, ...)
        /usr/local/Cellar/go/1.12.5/libexec/src/reflect/value.go:367 +0x151d
reflect.Value.Call(0x1739380, 0xc00093e900, 0x13, 0xc000ac7460, 0x1, 0x1, 0x0, 0x0, 0x14a80d9)
        /usr/local/Cellar/go/1.12.5/libexec/src/reflect/value.go:308 +0xa4
github.com/tendermint/tendermint/rpc/lib/server.makeHTTPHandler.func2(0x1a6a100, 0xc000ac7400, 0xc000c3a000)
        /Users/sabau/.go/src/github.com/tendermint/tendermint/rpc/lib/server/handlers.go:279 +0x314
net/http.HandlerFunc.ServeHTTP(0xc0009a2e40, 0x1a6a100, 0xc000ac7400, 0xc000c3a000)
        /usr/local/Cellar/go/1.12.5/libexec/src/net/http/server.go:1995 +0x44
net/http.(*ServeMux).ServeHTTP(0xc00001ac00, 0x1a6a100, 0xc000ac7400, 0xc000c3a000)
        /usr/local/Cellar/go/1.12.5/libexec/src/net/http/server.go:2375 +0x1d6
github.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x1a59da0, 0xc00001ac00, 0xf4240, 0x1a6a100, 0xc000ac7400, 0xc000c3a000)
        /Users/sabau/.go/src/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:208 +0xd0
github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x1a6a640, 0xc0001202a0, 0xc000c3a000)
        /Users/sabau/.go/src/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:181 +0x317
net/http.HandlerFunc.ServeHTTP(0xc0009a3020, 0x1a6a640, 0xc0001202a0, 0xc000c3a000)
        /usr/local/Cellar/go/1.12.5/libexec/src/net/http/server.go:1995 +0x44
net/http.serverHandler.ServeHTTP(0xc00095a5b0, 0x1a6a640, 0xc0001202a0, 0xc000c3a000)
        /usr/local/Cellar/go/1.12.5/libexec/src/net/http/server.go:2774 +0xa8
net/http.(*conn).serve(0xc000aca8c0, 0x1a6c7c0, 0xc000986540)
        /usr/local/Cellar/go/1.12.5/libexec/src/net/http/server.go:1878 +0x851
created by net/http.(*Server).Serve
        /usr/local/Cellar/go/1.12.5/libexec/src/net/http/server.go:2884 +0x2f4

Config (you can paste only the changes you've made):

node command runtime flags:

/dump_consensus_state output for consensus bugs

Anything else we need to know:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions