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

[Bug]: panic: failed to get executionContext from context #21924

Closed
1 task done
alpe opened this issue Sep 26, 2024 · 6 comments · Fixed by #22192
Closed
1 task done

[Bug]: panic: failed to get executionContext from context #21924

alpe opened this issue Sep 26, 2024 · 6 comments · Fixed by #22192
Assignees
Labels
C:server/v2 stf C:server/v2 Issues related to server/v2 T:Bug

Comments

@alpe
Copy link
Contributor

alpe commented Sep 26, 2024

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

This affects simdv2 only:

When starting a node from a state dump or using my sims branch, I run into this panic:

panic: failed to get executionContext from context

goroutine 128 [running]:
cosmossdk.io/server/v2/stf.eventService.EventManager(...)
        cosmossdk.io/server/v2/[email protected]/core_event_service.go:27
cosmossdk.io/x/authz/keeper.Keeper.SaveGrant({{{0x14d04bce0, 0x14001522700}, {0x103554710, 0x105448380}, {0x103540aa0, 0x105448380}, {0x103554738, 0x105448380}, {0x1035409c0, 0x140015a8720}, ...}, ...}, ...)
        cosmossdk.io/x/[email protected]/keeper/keeper.go:218 +0x3fc
cosmossdk.io/x/authz/keeper.Keeper.InitGenesis({{{0x14d04bce0, 0x14001522700}, {0x103554710, 0x105448380}, {0x103540aa0, 0x105448380}, {0x103554738, 0x105448380}, {0x1035409c0, 0x140015a8720}, ...}, ...}, ...)
        cosmossdk.io/x/[email protected]/keeper/genesis.go:35 +0x224
cosmossdk.io/x/authz/module.AppModule.InitGenesis({{0x1035c5d68, 0x1400168ee50}, {{{0x14d04bce0, 0x14001522700}, {0x103554710, 0x105448380}, {0x103540aa0, 0x105448380}, {0x103554738, 0x105448380}, ...}, ...}, ...}, ...)
        cosmossdk.io/x/[email protected]/module/module.go:132 +0xb0
cosmossdk.io/runtime/v2.(*MM[...]).InitGenesisJSON(0x0, {0x10357e3f0?, 0x14001668330}, 0x14001a0fef0, 0x14001a0fec0)
        cosmossdk.io/runtime/[email protected]/manager.go:168 +0x50c
cosmossdk.io/runtime/v2.(*AppBuilder[...]).Build.func2.1()
        cosmossdk.io/runtime/[email protected]/builder.go:186 +0x5c
cosmossdk.io/runtime/v2/services.(*genesisContext).Run(0x14001beb6c0, {0x10357e3f0?, 0x14001a0fe30?}, 0x14
002ea02a8)
        cosmossdk.io/runtime/[email protected]/services/genesis.go:41 +0x5c
cosmossdk.io/runtime/v2.(*AppBuilder[...]).Build.func2({0x10353f008, 0x14001a0fe90}, 0x14001a0fec0?)
        cosmossdk.io/runtime/[email protected]/builder.go:185 +0x21c
cosmossdk.io/server/v2/appmanager.AppManager[...].InitGenesis(0x10359f2c0, {0x10357e3f0, 0x14001a0fe30}, 0
x14001846b80, {0x140008cea80, 0x67cc, 0x6a80}, {0x103551720, 0x1400136ad90})
        cosmossdk.io/server/v2/[email protected]/appmanager.go:47 +0x140
cosmossdk.io/server/v2/cometbft.(*Consensus[...]).InitChain(0x1035daf00, {0x10357e4d0, 0x105448380}, 0x140
021b0b60)
        cosmossdk.io/server/v2/[email protected]/abci.go:277 +0x434
github.com/cometbft/cometbft/abci/client.(*localClient).InitChain(0x12c368188?, {0x10357e4d0?, 0x105448380
?}, 0x1055b4108?)
        github.com/cometbft/[email protected]/abci/client/local_client.go:
125 +0xe4
github.com/cometbft/cometbft/proxy.(*appConnConsensus).InitChain(0x14001488c60, {0x10357e4d0, 0x105448380}
, 0x140021b0b60)

Cosmos SDK Version

main

How to reproduce?

It can be reproduced by exporting/importing grants for example. I have this system test to do so: #21913
You would find the stacktrace in the server logs

@alpe alpe added the T:Bug label Sep 26, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Cosmos-SDK Sep 26, 2024
@julienrbrt julienrbrt added C:server/v2 Issues related to server/v2 C:server/v2 stf labels Sep 26, 2024
@julienrbrt
Copy link
Member

We tried yesterday with latest main, but we were unable to reproduce.
Export genesis works, but import genesis is blocked by #21678
That branch is giving https://github.com/cosmos/cosmos-sdk/actions/runs/11047632110/job/30689253949?pr=21678, but the tests are failing there, so I don't think we need to track it here, as it is happening only there.

@julienrbrt julienrbrt closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to 🥳 Done in Cosmos-SDK Sep 27, 2024
@alpe
Copy link
Contributor Author

alpe commented Sep 30, 2024

Reopening the issue as the system test linked in #21913 is still failing.

#21678 is addressing the valset but in the POC, I have used a different module to show that it is not valset only. I assume any module emitting events during genesis phase will run into this

@alpe alpe reopened this Sep 30, 2024
@github-project-automation github-project-automation bot moved this from 🥳 Done to 📋 Backlog in Cosmos-SDK Sep 30, 2024
@julienrbrt
Copy link
Member

Yes, correct! It should indeed stay open. @kocubinski had a solution for it.

@kocubinski kocubinski self-assigned this Oct 1, 2024
@julienrbrt
Copy link
Member

Should be fixed with latest main @alpe. Could you retry?

@alpe
Copy link
Contributor Author

alpe commented Oct 9, 2024

It is still failing.
Some more details:
During depinject phase, the stf.EventService is wired into the appmodulev2.Environment.
In genesis phase, the Environment.EventService.EventManager(ctx) is called in module like bank/send.go#283 and causes an error in stf/utils because it is not an executionContext type.

@kocubinski
Copy link
Member

Looks fixed by #22192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:server/v2 stf C:server/v2 Issues related to server/v2 T:Bug
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

3 participants