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

Improve UX for software upgrades #14941

Closed
mmulji-ic opened this issue Feb 7, 2023 · 4 comments
Closed

Improve UX for software upgrades #14941

mmulji-ic opened this issue Feb 7, 2023 · 4 comments
Labels
C:x/upgrade T: Dev UX UX for SDK developers (i.e. how to call our code)

Comments

@mmulji-ic
Copy link

mmulji-ic commented Feb 7, 2023

Summary

When performing a software upgrade before the pre-determined height for that release, the SDK application panics with a stack trace.

Problem Definition

This is confusing for users who often interpret this as an error on their part or an software/configuration error. Neither is the case.

Proposal

The error message should better reflect that "Upgrade height is not reached for this version.", perhaps with a link to the software upgrade proposal or the expected height that the software is valid from.

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Feb 7, 2023
@tac0turtle tac0turtle added T: Dev UX UX for SDK developers (i.e. how to call our code) C:x/upgrade T:Sprint and removed needs-triage Issue that needs to be triaged labels Feb 7, 2023
@github-project-automation github-project-automation bot moved this to 📝 Todo in Cosmos-SDK Feb 7, 2023
@alexanderbez
Copy link
Contributor

The Plan.Info is already printed out in the panic message. In fact, we print out all available fields of the Plan (name, upgrade time, and info). I don't really agree the panic isn't useful. It say's UPGRADE NEEDED...that's pretty clear IMO.

@mmulji-ic
Copy link
Author

@alexanderbez we got two similar reports, this is one.

This is with SDK v0.45.12

7:29AM INF starting node with ABCI Tendermint in-process
7:30AM INF service start impl=multiAppConn module=proxy msg={}
7:30AM INF service start connection=query impl=localClient module=abci-client msg={}
7:30AM INF service start connection=snapshot impl=localClient module=abci-client msg={}
7:30AM INF service start connection=mempool impl=localClient module=abci-client msg={}
7:30AM INF service start connection=consensus impl=localClient module=abci-client msg={}
7:30AM INF service start impl=EventBus module=events msg={}
7:30AM INF service start impl=PubSub module=pubsub msg={}
7:31AM INF service start impl=IndexerService module=txindex msg={}
7:31AM INF ABCI Handshake App Info hash=".\u05cdSrp�(��^�N�\x10�N�{^��bn�K��T��\a" height=13980914 module=consensus protocol-version=0 software-version=v8.0.0
7:31AM INF ABCI Replay Blocks appHeight=13980914 module=consensus stateHeight=13980914 storeHeight=13980915
7:31AM INF Replay last block using real app module=consensus
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x156c98d]

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/x/upgrade.BeginBlocker({{0x7ffd54347f48, 0xa}, 0xc0107ab680, {0x253b638, 0xc0108278f0}, {0x255a6b0, 0xc00125dad0}, 0xc010838ed0, {0x2535420, 0xc000694540}, ...}, ...)
	github.com/cosmos/[email protected]/x/upgrade/abci.go:38 +0x100d
github.com/cosmos/cosmos-sdk/x/upgrade.AppModule.BeginBlock(...)
	github.com/cosmos/[email protected]/x/upgrade/module.go:130
github.com/cosmos/cosmos-sdk/types/module.(*Manager).BeginBlock(_, {{0x254e988, 0xc000056028}, {0x255a128, 0xc00ba07400}, {{0xb, 0x0}, {0xc1d6bded50, 0xb}, 0xd554f3, ...}, ...}, ...)
	github.com/cosmos/[email protected]/types/module/module.go:491 +0x3bb
github.com/cosmos/gaia/v8/app.(*GaiaApp).BeginBlocker(_, {{0x254e988, 0xc000056028}, {0x255a128, 0xc00ba07400}, {{0xb, 0x0}, {0xc1d6bded50, 0xb}, 0xd554f3, ...}, ...}, ...)
	github.com/cosmos/gaia/v8/app/app.go:243 +0x85
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).BeginBlock(_, {{0xc1d6ce9160, 0x20, 0x20}, {{0xb, 0x0}, {0xc1d6bded50, 0xb}, 0xd554f3, {0x233d81b7, ...}, ...}, ...})
	github.com/cosmos/[email protected]/baseapp/abci.go:177 +0x97c
github.com/tendermint/tendermint/abci/client.(*localClient).BeginBlockSync(_, {{0xc1d6ce9160, 0x20, 0x20}, {{0xb, 0x0}, {0xc1d6bded50, 0xb}, 0xd554f3, {0x233d81b7, ...}, ...}, ...})
	github.com/tendermint/[email protected]/abci/client/local_client.go:280 +0x118
github.com/tendermint/tendermint/proxy.(*appConnConsensus).BeginBlockSync(_, {{0xc1d6ce9160, 0x20, 0x20}, {{0xb, 0x0}, {0xc1d6bded50, 0xb}, 0xd554f3, {0x233d81b7, ...}, ...}, ...})
	github.com/tendermint/[email protected]/proxy/app_conn.go:81 +0x55
github.com/tendermint/tendermint/state.execBlockOnProxyApp({0x254f788?, 0xc001247e00}, {0x2555008, 0xc017049e60}, 0xc0000010e0, {0x255b948, 0xc02c866198}, 0xd554f2?)
	github.com/tendermint/[email protected]/state/execution.go:307 +0x3dd
github.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(_, {{{0xb, 0x0}, {0x0, 0x0}}, {0xc01733f990, 0xb}, 0x4f5b97, 0xd554f2, {{0xc01dc34260, ...}, ...}, ...}, ...)
	github.com/tendermint/[email protected]/state/execution.go:140 +0x171
github.com/tendermint/tendermint/consensus.(*Handshaker).replayBlock(_, {{{0xb, 0x0}, {0x0, 0x0}}, {0xc01733f990, 0xb}, 0x4f5b97, 0xd554f2, {{0xc01dc34260, ...}, ...}, ...}, ...)
	github.com/tendermint/[email protected]/consensus/replay.go:503 +0x23c
github.com/tendermint/tendermint/consensus.(*Handshaker).ReplayBlocks(_, {{{0xb, 0x0}, {0x0, 0x0}}, {0xc01733f990, 0xb}, 0x4f5b97, 0xd554f2, {{0xc01dc34260, ...}, ...}, ...}, ...)
	github.com/tendermint/[email protected]/consensus/replay.go:416 +0x7ae
github.com/tendermint/tendermint/consensus.(*Handshaker).Handshake(0xc1c6149e70, {0x255c7e8, 0xc0013361a0})
	github.com/tendermint/[email protected]/consensus/replay.go:268 +0x3c8
github.com/tendermint/tendermint/node.doHandshake({_, _}, {{{0xb, 0x0}, {0x0, 0x0}}, {0xc01733f990, 0xb}, 0x4f5b97, 0xd554f2, ...}, ...)
	github.com/tendermint/[email protected]/node/node.go:329 +0x1b8
github.com/tendermint/tendermint/node.NewNode(0xc0012ab400, {0x254b6b0, 0xc000178fa0}, 0xc01085ce70, {0x2536760, 0xc01a026a20}, 0x0?, 0x0?, 0xc01085d0a0, {0x254f788, ...}, ...)
	github.com/tendermint/[email protected]/node/node.go:777 +0x597
github.com/cosmos/cosmos-sdk/server.startInProcess(_, {{0x0, 0x0, 0x0}, {0x2562fe0, 0xc0013a8510}, {0x0, 0x0}, {0x2552de8, 0xc00125dad0}, ...}, ...)
	github.com/cosmos/[email protected]/server/start.go:280 +0x81b
github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0xc0012d4900?, {0xc00133ff50?, 0x0?, 0x3?})
	github.com/cosmos/[email protected]/server/start.go:128 +0x169
github.com/spf13/cobra.(*Command).execute(0xc0012d4900, {0xc0012ff4c0, 0x3, 0x4})
	github.com/spf13/[email protected]/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc00117ec00)
	github.com/spf13/[email protected]/command.go:1044 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	github.com/spf13/[email protected]/command.go:961
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x0?, {0xc001255550, 0x6})
	github.com/cosmos/[email protected]/server/cmd/execute.go:36 +0x1eb
main.main()
	github.com/cosmos/gaia/v8/cmd/gaiad/main.go:16 +0x2c

@alexanderbez
Copy link
Contributor

Yeah @mmulji-ic that's a false negative. That panic is a result of a bad log line, which was fixed and patched already. Not on 0.45.x IIRC. In any case, the app would need an upgrade handler.

@julienrbrt
Copy link
Member

Yes, the log is already present, and the wrong displayed was fixed from v0.46+ (#11969)
As v0.45.x is EOL, there will not be a fix for that there.

@julienrbrt julienrbrt closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2023
@tac0turtle tac0turtle removed this from Cosmos-SDK Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/upgrade T: Dev UX UX for SDK developers (i.e. how to call our code)
Projects
None yet
Development

No branches or pull requests

5 participants
@alexanderbez @tac0turtle @julienrbrt @mmulji-ic and others