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

Blog tutorial fails when using feat/sdk-ibc-upgrade branch #2699

Closed
jeronimoalbi opened this issue Aug 4, 2022 · 9 comments
Closed

Blog tutorial fails when using feat/sdk-ibc-upgrade branch #2699

jeronimoalbi opened this issue Aug 4, 2022 · 9 comments
Labels
type:bug Something isn't working
Milestone

Comments

@jeronimoalbi
Copy link
Member

This issue is related to #2677

Description

The blog tutorial fails when the app is initialised with the error:

Cosmos SDK's version is: stargate - v0.46.0

πŸ› οΈ  Building proto...
πŸ“¦ Installing dependencies...
πŸ› οΈ  Building the blockchain...
πŸ’Ώ Initializing the app...
json: cannot unmarshal string into Go value of type []chaincmdrunner.Account

To reproduce

  • Checkout the feat/sdk-ibc-upgrade and compile Ignite CLI using make
  • Scaffold the blog chain app: ignite scaffold chain blog
  • Add a replace statement to the blog/go.mod so the chain app uses the local CLI repository (the path may be different for you): replace github.com/ignite/cli => ../cli
  • Start the chain: ignite chain serve

What version are you using?

Ignite CLI version:	development
Ignite CLI build date:	2022-08-04T12:05:30
Ignite CLI source hash:	9a493eb8bec23f10424dc867d1d66b92a3d86c06
Your OS:		darwin
Your arch:		arm64
Your go version:	go version go1.18.1 darwin/arm64
Your uname -a:		Darwin Protostar.home 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64 arm Darwin
Your cwd:		/Users/jeronimoalbi/Projects/tutorials/blog
Is on Gitpod:		false
@jeronimoalbi jeronimoalbi added the type:bug Something isn't working label Aug 4, 2022
@jeronimoalbi jeronimoalbi added this to the Priority milestone Aug 4, 2022
@aljo242
Copy link
Contributor

aljo242 commented Aug 4, 2022

@jeronimoalbi, I'm not able to reproduce this error following the same steps:

Ignite CLI version:     development
Ignite CLI build date:  2022-08-04T12:28:15
Ignite CLI source hash: 9a493eb8bec23f10424dc867d1d66b92a3d86c06
Your OS:                linux
Your arch:              amd64
Your go version:        go version go1.19 linux/amd64
Your uname -a:          Linux cozart-dev 5.18.15-arch1-2 #1 SMP PREEMPT_DYNAMIC Mon, 01 Aug 2022 18:58:16 +0000 x86_64 GNU/Linux
Your cwd:               /home/cozart/go/src/ignite/cli
Is on Gitpod:           false

@jeronimoalbi
Copy link
Member Author

Issue fixed in #2701

@jeronimoalbi jeronimoalbi closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2022
@dungtt-astra
Copy link

I've got the same error:
Cosmos SDK's version is: stargate - v0.46.1

πŸ› οΈ Building proto...
πŸ“¦ Installing dependencies...
πŸ› οΈ Building the blockchain...
πŸ’Ώ Initializing the app...
json: cannot unmarshal string into Go value of type []chaincmdrunner.Account

Anyone have any ideas to solve it. Thanks

@jeronimoalbi
Copy link
Member Author

Anyone have any ideas to solve it. Thanks

Thanks @dungtran8tiki, would you add a comment with the output you get when running ignite version?

Also it would be great if you could give more context that would help us to reproduce the issue.

@dungtt-astra
Copy link

dungtt-astra commented Oct 2, 2022

My ignite version:
Ignite CLI version: development
Ignite CLI build date: 2022-10-01T15:56:18
Ignite CLI source hash: 6995021
Your OS: darwin
Your arch: amd64
Your go version: go version go1.19.1 darwin/amd64
Your uname -a: Darwin LAP02459s-MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 x86_64
Your cwd: /Users/lap02459/sourcecode/aliassend
Is on Gitpod: false

How to produce this error:

  1. Using Ignite to create a simple chain
  2. in go.mod update as follows
    replace (
    github.com/cosmos/cosmos-sdk => /Users/lap02459/sourcecode/localCosmos-sdk
    github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
    )
  3. in codec.go
    replace
    var (
    Amino = codec.NewLegacyAmino()
    ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
    )
    by
    var (
    Amino = codec.NewLegacyAmino()
    ModuleCdc = codec.NewAminoCodec(Amino)
    )

func init() {
RegisterCodec(Amino)
cryptocodec.RegisterCrypto(Amino)
}

note: please import --- cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"

Using "ignite chain build" then build ok, run "ignite chain serve" for the first time might be ok. But stop and re-run "ignite chain serve" will get "json: cannot unmarshal string into Go value of type []chaincmdrunner.Account"

@dungtt-astra
Copy link

Hello @jeronimoalbi ,
when I use ignite to create a new chain on different folder but the same name. I delete ~/.<chain_name>. Then "ignite chain serve" also raise the error "json: cannot unmarshal string into Go value of type []chaincmdrunner.Account". I wonder that ignite stored some environment variables (or config parameters for this chain) some where else? Please give me some hint to solve this issue. Thank you

@dungtt-astra
Copy link

Debugging ignite source code, I found that CheckAccountExist() return error, since it cannot find the keys for account in config.yml.
To fix it, we simply re-create account. <yourchain_name> keys add <account_name>

@jeronimoalbi
Copy link
Member Author

@dungtran8tiki I didn't manage to reproduce the issue, out of curiosity what branch or tag are you using in /Users/lap02459/sourcecode/localCosmos-sdk?

@dungtt-astra
Copy link

it's cosmos-sdk, I put it at my local computer to add some debug log to track&learn code flow of cosmos.

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

No branches or pull requests

3 participants