Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing password on LCD fails #2649

Closed
1 of 4 tasks
faboweb opened this issue Oct 31, 2018 · 5 comments
Closed
1 of 4 tasks

Changing password on LCD fails #2649

faboweb opened this issue Oct 31, 2018 · 5 comments
Assignees
Labels
C:Keys Keybase, KMS and HSMs T:Bug

Comments

@faboweb
Copy link
Contributor

faboweb commented Oct 31, 2018

Summary of Bug

PUT /keys/default {"name":"default","new_password":"1234567890","old_password":"1234567890"}

results in a panic:

The gaiacli rest-server (LCD) experienced an error: 2018/10/31 18:45:58 http: panic serving 127.0.0.1:64728: interface conversion: string is not error: missing method Error goroutine 40 [running]: net/http.(*conn).serve.func1(0xc0008acd20) /usr/local/go/src/net/http/server.go:1746 +0xd0 panic(0x195e020, 0xc000615560) /usr/local/go/src/runtime/panic.go:513 +0x1b9 github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1.1(0xc00000bb00, 0x1eed6c0, 0xc0001a62c0, 0xbeee987561c04a10, 0x16ad115f2, 0x2626fc0, 0xc0001def00) /go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:177 +0x685 panic(0x1904560, 0xc0001ca750) /usr/local/go/src/runtime/panic.go:513 +0x1b9 github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/common.PanicCrisis(0x1941e20, 0xc0001a6100) /go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/common/errors.go:232 +0xb

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alessio
Copy link
Contributor

alessio commented Nov 1, 2018

Apparently the key base is locked, I think I've identified the bug though. It's in client/lcd/root.go

func createHandler(cdc *codec.Codec) *mux.Router {
	r := mux.NewRouter()

	kb, err := keys.GetKeyBase() //XXX
	if err != nil {
		panic(err)
	}

	cliCtx := context.NewCLIContext().WithCodec(cdc)

	// TODO: make more functional? aka r = keys.RegisterRoutes(r)
	r.HandleFunc("/version", CLIVersionRequestHandler).Methods("GET")
	r.HandleFunc("/node_version", NodeVersionRequestHandler(cliCtx)).Methods("GET")

	keys.RegisterRoutes(r, cliCtx.Indent)
	rpc.RegisterRoutes(cliCtx, r)
	tx.RegisterRoutes(cliCtx, r, cdc)
	auth.RegisterRoutes(cliCtx, r, cdc, "acc")
	bank.RegisterRoutes(cliCtx, r, cdc, kb)
	stake.RegisterRoutes(cliCtx, r, cdc, kb)
	slashing.RegisterRoutes(cliCtx, r, cdc, kb)
	gov.RegisterRoutes(cliCtx, r, cdc)

	return r
}

@alessio alessio added T:Bug C:Keys Keybase, KMS and HSMs labels Nov 1, 2018
@alessio alessio self-assigned this Nov 1, 2018
alessio pushed a commit that referenced this issue Nov 1, 2018
@faboweb
Copy link
Contributor Author

faboweb commented Nov 1, 2018

I get also this error in the log:

gaiacli: E[11-01|12:42:47.313] Panic in RPC HTTP handler                   module=rest-server err="Panicked on a Crisis: leveldb: read-only mode" stack="goroutine 71 [running]:\nruntime/debug.Stack(0xc000b1b680, 0x19066a0, 0xc0001ab8a0)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0xa7\ngithub.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1.1(0xc00000b620, 0x1ef0220, 0xc0001e8310, 0xbeeed78dadd86b70, 0x2062f9340, 0x262b000, 0xc000bbbe00)\n\t/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:174 +0x50c\npanic(0x19066a0, 0xc0001ab8a0)\n\t/usr/local/go/src/runtime/panic.go:513 +0x1b9\ngithub.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/common.PanicCrisis(0x1943f60, 0xc0001aa100)\n\t/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/common/errors.go:232 +0xb8\ngithub.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/db.(*GoLevelDB).SetSync(0xc00000c078, 0xc00003e600,0xa, 0x10, 0xc0001f8700, 0x127, 0x1a5)\n\t/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/libs/db/go_level_db.go:80 +0xc7\ngithub.com/cosmos/cosmos-sdk/crypto/keys.dbKeybase.writeInfo(0x1ef7660, 0xc00000c078, 0x1eef720, 0xc000ac3620, 0xc00003cc2a, 0x5)\n\t/go/src/github.com/cosmos/cosmos-sdk/crypto/keys/keybase.go:460 +0xc5\ngithub.com/cosmos/cosmos-sdk/crypto/keys.dbKeybase.writeLocalKey(0x1ef7660, 0xc00000c078, 0x1ef0960, 0xc00003ce80, 0xc00003cc2a, 0x5, 0xc0001ebf00, 0xa, 0xc000bab450, 0xc000b1b9e0)\n\t/go/src/github.com/cosmos/cosmos-sdk/crypto/keys/keybase.go:441 +0x140\ngithub.com/cosmos/cosmos-sdk/crypto/keys.dbKeybase.Update(0x1ef7660, 0xc00000c078, 0xc00003cc2a, 0x5, 0xc0001ebf20, 0xa, 0xc0001ab830, 0x1, 0xc0001ab830)\n\t/go/src/github.com/cosmos/cosmos-sdk/crypto/keys/keybase.go:423 +0x212\ngithub.com/cosmos/cosmos-sdk/client/keys.UpdateKeyRequestHandler(0x1eee3e0, 0xc00000b620, 0xc0004c2800)\n\t/go/src/github.com/cosmos/cosmos-sdk/client/keys/update.go:87 +0x1e3\nnet/http.HandlerFunc.ServeHTTP(0x1e22d70, 0x1eee3e0, 0xc00000b620, 0xc0004c2800)\n\t/usr/local/go/src/net/http/server.go:1964 +0x44\ngithub.com/cosmos/cosmos-sdk/vendor/github.com/gorilla/mux.(*Router).ServeHTTP(0xc000162af0, 0x1eee3e0, 0xc00000b620, 0xc0004c2800)\n\t/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/gorilla/mux/mux.go:162 +0xf1\ngithub.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x1ee4b20, 0xc000162af0, 0xf4240, 0x1eee3e0, 0xc00000b620, 0xc000bbbe00)\n\t/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:220 +0xcf\ngithub.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x1eee8e0, 0xc000904540, 0xc000bbbe00)\n\t/go/src/github.com/cosmos/cosmos-sdk/vendor/github.com/tendermint/tendermint/rpc/lib/server/http_server.go:193 +0x394\nnet/http.HandlerFunc.ServeHTTP(0xc000a54000, 0x1eee8e0, 0xc000904540, 0xc000bbbe00)\n\t/usr/local/go/src/net/http/server.go:1964 +0x44\nnet/http.serverHandler.ServeHTTP(0xc00002e680, 0x1eee8e0, 0xc000904540, 0xc000bbbe00)\n\t/usr/local/go/src/net/http/server.go:2741 +0xab\nnet/http.(*conn).serve(0xc000bd5720, 0x1eef420, 0xc0000af040)\n\t/usr/local/go/src/net/http/server.go:1847 +0x646\ncreated by net/http.(*Server).Serve\n\t/usr/local/go/src/net/http/server.go:2851 +0x2f5\n"

@alessio
Copy link
Contributor

alessio commented Nov 1, 2018

Link to upstream issue: syndtr/goleveldb#240

alessio pushed a commit that referenced this issue Nov 5, 2018
Update to goleveldb's most recent revision

Should close #2649
@alessio alessio mentioned this issue Nov 5, 2018
5 tasks
@faboweb
Copy link
Contributor Author

faboweb commented Nov 29, 2018

Working on latest Voyager

@faboweb faboweb closed this as completed Nov 29, 2018
@alessio
Copy link
Contributor

alessio commented Feb 6, 2019

I believe this is now fixed once and for all: #3514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:Keys Keybase, KMS and HSMs T:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants