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

A more informative error message when syncing from block 1 #2685

Closed
CharlieMc0 opened this issue Aug 12, 2024 · 3 comments · Fixed by #2925
Closed

A more informative error message when syncing from block 1 #2685

CharlieMc0 opened this issue Aug 12, 2024 · 3 comments · Fixed by #2925
Assignees
Labels
bug Something isn't working improvement

Comments

@CharlieMc0
Copy link
Member

Is your feature request related to a problem? Please describe.

When node operators attempt to start their node from block 1 they get an unclear error message like

panic: json: cannot unmarshal array into Go value of type map[string]json.RawMessage

Example Issue: #2682

Describe the solution you'd like
Instead, if someone attempts to start at block 1 it should give them an informative error message like
You cannot sync testnet or mainnet from block 1 using this version. You should sync your node from a snapshot

Motivation and Context
Many node operators run into this problem, get confused, and ask for help in Discord.

@CharlieMc0 CharlieMc0 changed the title A more informative error message A more informative error message when syncing from block 1 Aug 12, 2024
@CharlieMc0 CharlieMc0 added the bug Something isn't working label Aug 12, 2024
@CharlieMc0 CharlieMc0 added this to the September Release milestone Aug 12, 2024
@kingpinXD
Copy link
Contributor

I think it's a good idea to refactor the message , to make it meaningful
It would be better, though, if we could also come up with a doc or a process to follow for someone who wants to sync from block 1. Is that something we have ever tested?
It would be a good idea to spend some time on a sprint to test this to see if it's possible.

@lumtis
Copy link
Member

lumtis commented Sep 23, 2024

Do you know what is the actual error and what message should be printed for this specific case here?

@kingpinXD
Copy link
Contributor

The error I got when trying to sync a node using
https://www.zetachain.com/docs/nodes/start-here/setup/

12:22PM INF initializing blockchain state from genesis.json module=server
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1035759b0]

goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/x/gov.InitGenesis({{0x105ab67b0, 0x1077946c0}, {0x105ad06d0, 0x140009d2580}, {{0x0, 0x0}, {0x140016040e0, 0x10}, 0x0, {0x0, ...}, ...}, ...}, ...)
        /Users/tanmay/go/pkg/mod/github.com/cosmos/[email protected]/x/gov/genesis.go:15 +0xc0
github.com/cosmos/cosmos-sdk/x/gov.AppModule.InitGenesis({{{_, _}, {_, _, _}}, _, {_, _}, {_, _}, ...}, ...)
        /Users/tanmay/go/pkg/mod/github.com/cosmos/[email protected]/x/gov/module.go:304 +0xcc
github.com/cosmos/cosmos-sdk/types/module.(*Manager).InitGenesis(_, {{0x105ab67b0, 0x1077946c0}, {0x105ad06d0, 0x140009d2580}, {{0x0, 0x0}, {0x140016040e0, 0x10}, 0x0, ...}, ...}, ...)
        /Users/tanmay/go/pkg/mod/github.com/cosmos/[email protected]/types/module/module.go:357 +0x290
github.com/zeta-chain/node/app.(*App).InitChainer(_, {{0x105ab67b0, 0x1077946c0}, {0x105ad06d0, 0x140009d2580}, {{0x0, 0x0}, {0x140016040e0, 0x10}, 0x0, ...}, ...}, ...)
        /Users/tanmay/IdeaProjects/kingpinXD/zeta-node/app/app.go:892 +0x1d8
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).InitChain(0x140007370e0, {{0x0, 0xedcc373b0, 0x0}, {0x140016040e0, 0x10}, 0x14000694860, {0x1077946c0, 0x0, 0x0}, ...})
        /Users/tanmay/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/abci.go:78 +0x408
github.com/cometbft/cometbft/abci/client.(*localClient).InitChainSync(0x14000d4f800, {{0x0, 0xedcc373b0, 0x0}, {0x140016040e0, 0x10}, 0x14000694860, {0x1077946c0, 0x0, 0x0}, ...})
        /Users/tanmay/go/pkg/mod/github.com/cometbft/[email protected]/abci/client/local_client.go:275 +0x184
github.com/cometbft/cometbft/proxy.(*appConnConsensus).InitChainSync(0x140006af008, {{0x0, 0xedcc373b0, 0x0}, {0x140016040e0, 0x10}, 0x14000694860, {0x1077946c0, 0x0, 0x0}, ...})
        /Users/tanmay/go/pkg/mod/github.com/cometbft/[email protected]/proxy/app_conn.go:85 +0x1a8
github.com/cometbft/cometbft/consensus.(*Handshaker).ReplayBlocksWithContext(_, {_, _}, {{{0xb, 0x0}, {0x10448693d, 0x6}}, {0x140016040e0, 0x10}, 0x1, ...}, ...)
        /Users/tanmay/go/pkg/mod/github.com/cometbft/[email protected]/consensus/replay.go:336 +0xbac
github.com/cometbft/cometbft/consensus.(*Handshaker).HandshakeWithContext(0x14001bd3db8, {0x105ab6d60, 0x1077946c0}, {0x105ad5650, 0x14001b2e000})
        /Users/tanmay/go/pkg/mod/github.com/cometbft/[email protected]/consensus/replay.go:274 +0x314
github.com/cometbft/cometbft/node.doHandshake({_, _}, {_, _}, {{{0xb, 0x0}, {0x10448693d, 0x6}}, {0x140016040e0, 0x10}, ...}, ...)
        /Users/tanmay/go/pkg/mod/github.com/cometbft/[email protected]/node/node.go:449 +0x118
github.com/cometbft/cometbft/node.NewNodeWithContext({0x105ab6d60, 0x1077946c0}, 0x14000a6f1e0, {0x105a980f8, 0x140019e81e0}, 0x140019f1f50, {0x105a828e0, 0x14000631680}, 0x140015f7008, 0x105a6f3a0, ...)
        /Users/tanmay/go/pkg/mod/github.com/cometbft/[email protected]/node/node.go:929 +0x3fc
github.com/cometbft/cometbft/node.NewNode(0x1074e7db0?, {0x105a980f8?, 0x140019e81e0?}, 0x37?, {0x105a828e0?, 0x14000631680?}, 0x105a828c0?, 0x140013f5c00?, 0x0?, {0x105ab6820?, ...}, ...)
        /Users/tanmay/go/pkg/mod/github.com/cometbft/[email protected]/node/node.go:849 +0x84
github.com/zeta-chain/node/server.startInProcess(_, {{0x0, 0x0, 0x0}, {0x105ad3420, 0x14000a2d200}, 0x0, {0x1400148d4f0, 0x10}, {0x105adee00, ...}, ...}, ...)
        /Users/tanmay/IdeaProjects/kingpinXD/zeta-node/server/start.go:417 +0x2334
github.com/zeta-chain/node/server.StartCmd.func2(0x14000f38608, {0x1077946c0?, 0x0?, 0x0?})
        /Users/tanmay/IdeaProjects/kingpinXD/zeta-node/server/start.go:159 +0x284
github.com/spf13/cobra.(*Command).execute(0x14000f38608, {0x1077946c0, 0x0, 0x0})
        /Users/tanmay/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x140013caf08)
        /Users/tanmay/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/tanmay/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /Users/tanmay/go/pkg/mod/github.com/spf13/[email protected]/command.go:1032
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x140013caf08, {0x0, 0x0}, {0x14001148120, 0x18})
        /Users/tanmay/go/pkg/mod/github.com/cosmos/[email protected]/server/cmd/execute.go:33 +0x148
main.main()
        /Users/tanmay/IdeaProjects/kingpinXD/zeta-node/cmd/zetacored/main.go:20 +0x3c

The linked pr should fix that problem.

@CharlieMc0 , I was not able to replicate the exact error message you created the issue for but the recover function I added should catch any panic from initializing the state from genesis.
If you have the steps to replicate the error , I can try it on my branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working improvement
Projects
None yet
3 participants