8000 `publish`: failure: key not found · Issue #2775 · ignite/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

publish: failure: key not found #2775

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

Closed
lumtis opened this issue Aug 24, 2022 · 7 comments · Fixed by #2781
Closed

publish: failure: key not found #2775

lumtis opened this issue Aug 24, 2022 · 7 comments · Fixed by #2781

Comments

@lumtis
Copy link
Contributor
lumtis commented Aug 24, 2022

Describe the bug
Some recent changes seem to have broken the publish command.
The command works if a chain has already been published, therefore the issue might be related to creating a coordinator

To reproduce

ignite n chain publish https://github.com/lubtd/planet --local

✔ Source code fetched
✔ Blockchain set up
✔ Chain's binary built
✔ Blockchain initialized
✔ Genesis initialized
rpc error: code = NotFound desc = rpc error: code = NotFound desc = account spn1daefnhnupn85e8vv0yc5epmnkcr5epkqncn2le not found: key not found
@tbruyelle
Copy link
Contributor

I investigated a bit since the node command made significant changes to cosmosclient.

I can confirm the error happens when the publish commands tries to create the missing coordinator. During this tx creation, AccountRetriever.EnsureExists is invoked with that coord address (because that address is used to sign the TX), and it returns an error because the account doesn't exist in SPN.

What I don't understand is in v0.23 it was the same behavior, so I suppose the address of the coordinator should be a SPN account prior to the publish command, right ? Why it's no longer an account ? IDK!

@lumtis
Copy link
Contributor Author
lumtis commented Aug 25, 2022

Thanks for investigating this

In the codebase, at least previously, if no accounts are detected, we check if faucet is enabled. If there is a faucet, which is the case when using spn locally, we first request tokens from the faucet which will create the account

@lumtis
Copy link
Contributor Author
lumtis commented Aug 25, 2022

Maybe the refactoring changed the faucet logic

@tbruyelle
Copy link
Contributor

In the codebase, at least previously, if no accounts are detected, we check if faucet is enabled

Which codebase, spn or cli ?

@lumtis
Copy link
Contributor Author
lumtis commented Aug 25, 2022

In the codebase, at least previously, if no accounts are detected, we check if faucet is enabled

Which codebase, spn or cli ?

In cosmosclient

func (c *Client) makeSureAccountHasTokens(ctx context.Context, address string) error {

@tbruyelle
Copy link
Contributor

@lubtd OK you're right, in v0.23, makeSureAccountHasTokens was invoked before AccountRetriever.EnsureExists, but it's no longer the case in develop. If you're not working on it I can try to fix that.

@lumtis
Copy link
Contributor Author
lumtis commented Aug 25, 2022

@lubtd OK you're right, in v0.23, makeSureAccountHasTokens was invoked before AccountRetriever.EnsureExists, but it's no longer the case in develop. If you're not working on it I can try to fix that.

I have some stuff today and was planning working on this tomorrow. If you see the issue and the fix is quick, no problem with you tackling this!

@tbruyelle tbruyelle self-assigned this Aug 25, 2022
@lumtis lumtis removed their assignment Aug 25, 2022
tbruyelle added a commit that referenced this issue Aug 25, 2022
Fix #2775

This change restores the behavior we used to have in 0.23, and which has
changed with the refac of cosmosclient with the `node` command feat.

Calling the faucet (when it is specically enabled) will ensure the
account that broadcasts the tx exists in the target chain.

Because the `node` command has a `--generate-only` flag, and because we
don't want to create a new account when it's set, this flag is now
propagated in the cosmosclient struct. Therefore, the faucet isn't
called when the flag is set. This doesn't affect the `network` command
because it doesn't use that flag.
tbruyelle added a commit that referenced this issue Aug 25, 2022
Fix #2775

This change restores the behavior we used to have in 0.23, and which has
changed with the refac of cosmosclient with the `node` command feat.

Calling the faucet (when it is specifically enabled) will ensure the
account that broadcasts the tx exists in the target chain.

Because the `node` command has a `--generate-only` flag, and because we
don't want to create a new account when it's set, this flag is now
propagated to the cosmosclient struct. Therefore, the faucet isn't
called when the flag is set. This doesn't affect the `network` command
because it doesn't use that flag.
tbruyelle added a commit that referenced this issue Aug 31, 2022
Fix #2775

This change restores the behavior we used to have in 0.23, and which has
changed with the refac of cosmosclient with the `node` command feat.

Calling the faucet (when it is specifically enabled) will ensure the
account that broadcasts the tx exists in the target chain.

Because the `node` command has a `--generate-only` flag, and because we
don't want to create a new account when it's set, this flag is now
propagated to the cosmosclient struct. Therefore, the faucet isn't
called when the flag is set. This doesn't affect the `network` command
because it doesn't use that flag.

* test link issue in CL

* gh doesn't autolink issues in repo's file

* Update changelog.md

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>

* Solve TODO: validate tx msgs

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>
ilgooz pushed a commit that referenced this issue Sep 6, 2022
* fix(cosmosclient): call the faucet prior to create the tx

Fix #2775

This change restores the behavior we used to have in 0.23, and which has
changed with the refac of cosmosclient with the `node` command feat.

Calling the faucet (when it is specifically enabled) will ensure the
account that broadcasts the tx exists in the target chain.

Because the `node` command has a `--generate-only` flag, and because we
don't want to create a new account when it's set, this flag is now
propagated to the cosmosclient struct. Therefore, the faucet isn't
called when the flag is set. This doesn't affect the `network` command
because it doesn't use that flag.

* test link issue in CL

* gh doesn't autolink issues in repo's file

* Update changelog.md

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>

* Solve TODO: validate tx msgs

* test: cosmosclient.New

* test: cosmosclient.WaitForBlockHeight

* wip: test cosmosclient.Account

* test: cosmosclient.Account

* test: improve cosmosclient.WaitForBlockHeight

* test: cosmosclient.Address

* test: cosmosclient.Status

* refac: cosmosclient.Address

- dont need to use sdkconfig prefix since we have can just call
  account.Address(prefix)
- improve error message by using GetByName directly

* refac: no need for private account func

* restore cosmosaccount.Keyring public

* style: rename var

* add CL entry

* Update changelog.md

Co-authored-by: Alex Johnson <alex@shmeeload.xyz>

* style: var names

* merged too fast

* style: remove WithWaitBlockDuration option

In favor of a parameter in WaitForBlockHeight

* oups

* use black box testing only

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>
Co-authored-by: Alex Johnson <alex@shmeeload.xyz>
Jchicode pushed a commit to Jchicode/cli that referenced this issue Aug 9, 2023
Fix ignite#2775

This change restores the behavior we used to have in 0.23, and which has
changed with the refac of cosmosclient with the `node` command feat.

Calling the faucet (when it is specifically enabled) will ensure the
account that broadcasts the tx exists in the target chain.

Because the `node` command has a `--generate-only` flag, and because we
don't want to create a new account when it's set, this flag is now
propagated to the cosmosclient struct. Therefore, the faucet isn't
called when the flag is set. This doesn't affect the `network` command
because it doesn't use that flag.

* test link issue in CL

* gh doesn't autolink issues in repo's file

* Update changelog.md

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>

* Solve TODO: validate tx msgs

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>
Jchicode pushed a commit to Jchicode/cli that referenced this issue Aug 9, 2023
* fix(cosmosclient): call the faucet prior to create the tx

Fix ignite#2775

This change restores the behavior we used to have in 0.23, and which has
changed with the refac of cosmosclient with the `node` command feat.

Calling the faucet (when it is specifically enabled) will ensure the
account that broadcasts the tx exists in the target chain.

Because the `node` command has a `--generate-only` flag, and because we
don't want to create a new account when it's set, this flag is now
propagated to the cosmosclient struct. Therefore, the faucet isn't
called when the flag is set. This doesn't affect the `network` command
because it doesn't use that flag.

* test link issue in CL

* gh doesn't autolink issues in repo's file

* Update changelog.md

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>

* Solve TODO: validate tx msgs

* test: cosmosclient.New

* test: cosmosclient.WaitForBlockHeight

* wip: test cosmosclient.Account

* test: cosmosclient.Account

* test: improve cosmosclient.WaitForBlockHeight

* test: cosmosclient.Address

* test: cosmosclient.Status

* refac: cosmosclient.Address

- dont need to use sdkconfig prefix since we have can just call
  account.Address(prefix)
- improve error message by using GetByName directly

* refac: no need for private account func

* restore cosmosaccount.Keyring public

* style: rename var

* add CL entry

* Update changelog.md

Co-authored-by: Alex Johnson <alex@shmeeload.xyz>

* style: var names

* merged too fast

* style: remove WithWaitBlockDuration option

In favor of a parameter in WaitForBlockHeight

* oups

* use black box testing only

Co-authored-by: Lucas Btd <lucas.bertrand.22@gmail.com>
Co-authored-by: Alex Johnson <alex@shmeeload.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0