cli
cli copied to clipboard
Upgrade error: `SetIndex requires index to not be set`
Describe the bug
When you start with a clean Ignite v0.28.3 App and try to add wasm
module using a software upgrade you get this error:
SetIndex requires index to not be set
6:27AM INF adding a new module: 06-solomachine module=server
6:27AM INF adding a new module: 07-tendermint module=server
6:27AM INF adding a new module: capability module=server
6:27AM INF Closing application.db module=server
6:27AM INF Closing snapshots/metadata.db module=server
panic: SetIndex requires index to not be set
goroutine 1 [running]:
github.com/cosmos/ibc-go/modules/capability/keeper.Keeper.InitializeIndex({{_, _}, {_, _}, {_, _}, _, _, _}, {{0x4044ed0, ...}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cosmos/ibc-go/modules/[email protected]/keeper/keeper.go:163 +0x1f4
github.com/cosmos/ibc-go/modules/capability.InitGenesis({{0x4044ed0, 0x5d7d3e0}, {0x4060a50, 0xc00092bc40}, {{0x0, 0x0}, {0xc00127b790, 0x6}, 0x78, {0x150edf7f, ...}, ...}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cosmos/ibc-go/modules/[email protected]/genesis.go:13 +0xee
github.com/cosmos/ibc-go/modules/capability.AppModule.InitGenesis({{{0x4087400, 0xc000d88a60}}, {{0x405ff10, 0xc000d88a60}, {0x401c1d8, 0xc001766490}, {0x401c200, 0xc0017664f0}, 0xc001741ef0, 0xc001741f20, ...}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cosmos/ibc-go/modules/[email protected]/module.go:127 +0x187
github.com/cosmos/cosmos-sdk/types/module.Manager.RunMigrations({0xc000b703f0, {0xc0011bac00, 0x1b, 0x20}, {0xc0011bac00, 0x1b, 0x20}, {0xc0011c8d80, 0x1, 0x1}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/types/module/module.go:732 +0x96d
ignite-wasm/app.(*App).StickyFingers.func1({0x4044f08, 0xc001599c08}, {{0xc001f36888, 0x12}, {0x0, 0x0, 0x0}, 0x78, {0xc000c240b0, 0xa9}, ...}, ...)
/home/raul/ignite-wasm/app/upgrades.go:42 +0x253
cosmossdk.io/x/upgrade/keeper.Keeper.ApplyUpgrade({{0xc0009101c8, 0x17}, 0xc000a1e3f0, {0x400c9e0, 0xc000a8f6e0}, {0x405ff10, 0xc000d88a60}, 0xc000a1e420, {0x400c7e0, 0xc001360d88}, ...}, ...)
/home/raul/go/pkg/mod/cosmossdk.io/x/[email protected]/keeper/keeper.go:469 +0x111
cosmossdk.io/x/upgrade.PreBlocker({0x4044f08, 0xc001599508}, 0xc0001799d0)
/home/raul/go/pkg/mod/cosmossdk.io/x/[email protected]/abci.go:106 +0xd0c
cosmossdk.io/x/upgrade.AppModule.PreBlock(...)
/home/raul/go/pkg/mod/cosmossdk.io/x/[email protected]/module.go:161
github.com/cosmos/cosmos-sdk/types/module.(*Manager).PreBlock(_, {{0x4044ed0, 0x5d7d3e0}, {0x4060a50, 0xc00092bc40}, {{0x0, 0x0}, {0xc00127b790, 0x6}, 0x78, ...}, ...})
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/types/module/module.go:758 +0x18e
github.com/cosmos/cosmos-sdk/runtime.(*App).PreBlocker(...)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/runtime/app.go:159
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).preBlock(0xc001360d88, 0xc000c13c80)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:706 +0xc4
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).internalFinalizeBlock(0xc001360d88, {0x4044ed0, 0x5d7d3e0}, 0xc000c13c80)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/abci.go:756 +0xdda
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).FinalizeBlock(0xc001360d88, 0xc000c13c80)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/abci.go:884 +0x16e
github.com/cosmos/cosmos-sdk/server.cometABCIWrapper.FinalizeBlock(...)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/cmt_abci.go:44
github.com/cometbft/cometbft/abci/client.(*localClient).FinalizeBlock(0x40615d0?, {0x40451e0?, 0x5d7d3e0?}, 0x7fccc2b40e98?)
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/abci/client/local_client.go:185 +0xcd
github.com/cometbft/cometbft/proxy.(*appConnConsensus).FinalizeBlock(0xc00097fbf0, {0x40451e0, 0x5d7d3e0}, 0xc000c13c80)
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/proxy/app_conn.go:104 +0x170
github.com/cometbft/cometbft/state.(*BlockExecutor).ApplyBlock(_, {{{0xb, 0x0}, {0xc000bc6498, 0x6}}, {0xc000bc64d0, 0x6}, 0x1, 0x77, {{0xc000cc5fc0, ...}, ...}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/state/execution.go:213 +0x5c5
github.com/cometbft/cometbft/consensus.(*Handshaker).replayBlock(_, {{{0xb, 0x0}, {0xc000bc6498, 0x6}}, {0xc000bc64d0, 0x6}, 0x1, 0x77, {{0xc000cc5fc0, ...}, ...}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/consensus/replay.go:534 +0x24e
github.com/cometbft/cometbft/consensus.(*Handshaker).ReplayBlocksWithContext(_, {_, _}, {{{0xb, 0x0}, {0xc000bc6498, 0x6}}, {0xc000bc64d0, 0x6}, 0x1, ...}, ...)
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/consensus/replay.go:433 +0x77a
github.com/cometbft/cometbft/consensus.(*Handshaker).HandshakeWithContext(0xc000dd53e0, {0x4045138, 0xc0019590e0}, {0x40641d0, 0xc0013d42a0})
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/consensus/replay.go:274 +0x425
github.com/cometbft/cometbft/node.doHandshake({_, _}, {_, _}, {{{0xb, 0x0}, {0xc000bc6498, 0x6}}, {0xc000bc64d0, 0x6}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/node/setup.go:182 +0x1a9
github.com/cometbft/cometbft/node.NewNodeWithContext({0x4045138, 0xc0019590e0}, 0xc001383040, {0x40237b0, 0xc000401680}, 0xc000d88320, {0x400c220, 0xc00097e510}, 0xc000dd6248, 0x3982fb8, ...)
/home/raul/go/pkg/mod/github.com/cometbft/[email protected]/node/node.go:350 +0x5b7
github.com/cosmos/cosmos-sdk/server.startCmtNode({0x4045138, 0xc0019590e0}, 0xc001383040, {0x40874c8, 0xc000ac7008}, 0xc001611b60)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:368 +0x42f
github.com/cosmos/cosmos-sdk/server.startInProcess(_, {{{0xc00113cf10, 0x6}, 0x0, {0xc00113d5e0, 0x7}, {0x311039a, 0x1}, {0x311039a, 0x1}, ...}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:314 +0x188
github.com/cosmos/cosmos-sdk/server.start(_, {{0x0, 0x0, 0x0}, {0x4068870, 0xc001687a40}, 0x0, {0x0, 0x0}, {0x4087400, ...}, ...}, ...)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:232 +0x2f3
github.com/cosmos/cosmos-sdk/server.StartCmdWithOptions.func2.1()
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:190 +0x5e
github.com/cosmos/cosmos-sdk/server.wrapCPUProfile(0xc001611b60, 0xc000dcda08)
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:566 +0x1b3
github.com/cosmos/cosmos-sdk/server.StartCmdWithOptions.func2(0xc0014b4908, {0x5d7d3e0?, 0x0?, 0x0?})
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/start.go:189 +0x212
github.com/spf13/cobra.(*Command).execute(0xc0014b4908, {0x5d7d3e0, 0x0, 0x0})
/home/raul/go/pkg/mod/github.com/spf13/[email protected]/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc00135f808)
/home/raul/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
/home/raul/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/home/raul/go/pkg/mod/github.com/spf13/[email protected]/command.go:1032
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0xc00135f808, {0x0, 0x0}, {0xc0009101c8, 0x17})
/home/raul/go/pkg/mod/github.com/cosmos/[email protected]/server/cmd/execute.go:34 +0x187
main.main()
/home/raul/ignite-wasm/cmd/ignite-wasmd/main.go:15 +0x33
The error ‘SetIndex requires index to not be set’ indicates that the index is already set when trying to set it again. This usually happens in the context of index initialisation in the IBC capability module.
To reproduce Steps to reproduce the behavior:
- Scaffold a new v0.28.3 chain with:
ignite s chain ignite-wasm
- Run it and create an upgrade software proposal. Vote it
- Add
wasm
module to the same using theignite wasm add
command. - Create a simple upgrade_handler
- Run the new version
Here are the previous steps:
https://github.com/RaulBernal/ignite-wasm/compare/v1.0.0...v2.0.0
What version are you using?
Ignite CLI version: v28.3.0
Ignite CLI build date: 2024-03-20T15:31:07Z
Ignite CLI source hash: 159abdca88605ed82cb4aabd52618db91069b7af
Ignite CLI config version: v1
Cosmos SDK version: v0.50.5
Your OS: darwin
Your arch: amd64
Your Node.js version: v20.11.1
Your go version: go version go1.22.1 darwin/arm64
Your uname -a: Darwin iMac-de-Raul.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103 x86_64
Your cwd: /Users/xxxx/SDK/ignite_wasm/ignite-wasm
Is on Gitpod: false
FWIW someone else encountered the same issue on Discord, see this thread: https://discord.com/channels/893126937067802685/1235849519120252928/1237801874279759993. I'll check more in depth what's up.