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

version 0.22.2 scaffold chain fail #2618

Closed
Frederic-Zhou opened this issue Jun 24, 2022 · 19 comments
Closed

version 0.22.2 scaffold chain fail #2618

Frederic-Zhou opened this issue Jun 24, 2022 · 19 comments
Assignees
Labels
component:scaffold Feature, enhancement, or refactor related to scaffolding.

Comments

@Frederic-Zhou
Copy link

Describe the bug
After update ignite source and rebuild
run:

ignite scaffold chain github.com/username/nameservice --no-module

fail message:

go: github.com/ignite/cli@v0.22.2 requires
	github.com/tendermint/spn@v0.2.1-0.20220610090138-44b136f042c4 requires
	github.com/ignite-hq/cli@v0.22.1-0.20220610070456-1b33c09fceb7: invalid version: unknown revision 1b33c09fceb7
: exit status 1

0.20.3 is fine

@tbruyelle
Copy link
Contributor

tbruyelle commented Jul 4, 2022

Hi @Frederic-Zhou, unfortunately I cannot reproduce your issue. I tried with a binary compiled under the v0.22.2 tag and with the binary packed in the gh release. I was able to scaffold a chain w/o issue.

Can you retry with the binary packed in the gh release ?
https://github.com/ignite/cli/releases/tag/v0.22.2

@Frederic-Zhou
Copy link
Author

Frederic-Zhou commented Jul 7, 2022

Hi @tbruyelle
Here are all the steps I did

● ~/workspace/cosmos/cli(develop) » git pull                                           
Already up to date.
● ~/workspace/cosmos/cli(develop) » git checkout v0.22.2                                 
Note: switching to 'v0.22.2'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at a22808a0 chore: release v0.22.2 (#2608)
● ~/workspace/cosmos/cli(a22808a0) » make install  
			 	              
Installing Ignite CLI...
Ignite CLI version:	development
Ignite CLI build date:	2022-07-07T18:36:56
Ignite CLI source hash:	a22808a031b93c0c4065a303edea88bb90be6a10
Your OS:		darwin
Your arch:		amd64
Your go version:	go version go1.18.2 darwin/amd64
Your uname -a:		Darwin MacBook-Pro.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 x86_64
Your cwd:		/Users/zeta/workspace/cosmos/cli
Is on Gitpod:		false
                
● ~/workspace/cosmos/cli(a22808a0) » cd ..                                           
● ~/workspace/cosmos » ignite scaffold chain github.com/username/appone --no-module
   
go: github.com/ignite/cli@v0.22.2 requires
	github.com/tendermint/spn@v0.2.1-0.20220610090138-44b136f042c4 requires
	github.com/ignite-hq/cli@v0.22.1-0.20220610070456-1b33c09fceb7: invalid version: unknown revision 1b33c09fceb7
: exit status 1

I did download the binary file from https://github.com/ignite/cli/releases/tag/v0.22.2 , and get same error !!

@Frederic-Zhou
Copy link
Author

Frederic-Zhou commented Jul 7, 2022

In my case, this error occurs in versions v0.20.3 above

MacOSX Monterey, Apple M1, go1.18.2 darwin/amd64

@tbruyelle
Copy link
Contributor

Your error occurs when ignite runs go mod download inside your scaffolded chain, and go cannot find github.com/ignite-hq/cli@v0.22.1-0.20220610070456-1b33c09fceb7.

This module is present in the official proxy (https://proxy.golang.org/github.com/ignite-hq/cli/@v/v0.22.1-0.20220610070456-1b33c09fceb7.mod), what do you have in your GOPROXY env please ?

If I remove my module cache and set GOPROXY=direct, I can reproduce your error. I don't know the reason but the version 1b33c09fceb7 doesn't exist anymore in github, so you need to rely on the proxy to fetch it.

On my side it works with GOPROXY="https://proxy.golang.org,direct".

@ilkerkorkut
Copy link

@Frederic-Zhou

I faced with the same problem and It looks like setting the GONOPROXY=none for go env solves the issue(I checked my default GONOPROXY value and it was github.com/*).

@tbruyelle tbruyelle self-assigned this Jul 12, 2022
tbruyelle added a commit that referenced this issue Jul 15, 2022
The change fixes a go command error when scaffolding a chain (see #2618), because go cannot fetch `ignite-hq/cli` despite the github redirection.

To remove `ignite-hq/cli` from the dependency list, I had to : 
- upgrade `spn` to latest (so it depends on `ignite/cli@v0.22.2` rather than `ignite-hq/cli`)
- upgrade go to 1.18 in `go.mod.plush` (or else `ignite/cli@v0.22.2` adds a dependency to an older `spn` which in turn adds a dependency to `ignite-hq/cli`)

Bonus:
- improve `go mod download` error report : add the binary output in addition to `Exit status 1`.
- fix test because of upgrade to ibc-go 3.0.1, where  some parameters can't be null.
@Frederic-Zhou
Copy link
Author

Thanks @tbruyelle and @ilkerkorkut .
I had pull the new source code ,but after I change the GOPROXY export GOPROXY="https://proxy.golang.org,direct"
the new error is go: github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d: invalid proxy URL missing scheme: none : exit status 1

@tbruyelle
Copy link
Contributor

@Frederic-Zhou can you give the output of the commands ignite version and go env please ?
The new error is still related to ignite scaffold chain right ?

@Frederic-Zhou
Copy link
Author

Frederic-Zhou commented Jul 18, 2022

Thanks @tbruyelle
I refer to the way you fix and delete the github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d required in the go.mod.plush file.
The chain has been successfully created, but I don't know if doing this will cause other problems.
image

@Frederic-Zhou
Copy link
Author

ignite version

Ignite CLI version:	development
Ignite CLI build date:	2022-07-18T18:43:26
Ignite CLI source hash:	ffd4b499c704a4165617ed1088bc17b39d24dc57
Your OS:		darwin
Your arch:		amd64
Your go version:	go version go1.18.2 darwin/amd64
Your uname -a:		Darwin MacBook-Pro.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 x86_64
Your cwd:		/Users/zeta/workspace/cosmos/cli
Is on Gitpod:		false

go env

GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/zeta/Library/Caches/go-build"
GOENV="/Users/zeta/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/zeta/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/zeta/go"
GOPRIVATE=""
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/zeta/workspace/cosmos/cli/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7v/mfkwfd0s2gv68b087kpx3dpc0000gn/T/go-build1001591976=/tmp/go-build -gno-record-gcc-switches -fno-common"

@tbruyelle
Copy link
Contributor

The chain has been successfully created, but I don't know if doing this will cause other problems.

So when does the new error occur in this case ?

GOPROXY="https://goproxy.io,direct"

It's not the official proxy, idk if it's reliable.

@Frederic-Zhou
Copy link
Author

Frederic-Zhou commented Jul 18, 2022

The chain has been successfully created, but I don't know if doing this will cause other problems.
So when does the new error occur in this case ?

After removing github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d required.
I built a blog case according to the tutorial, and no new errors occur.

GOPROXY="https://goproxy.io,direct/"
It's not the official proxy, idk if it's reliable.

I also tried setting GOPROXY="https://proxy.golang.org,direct" before removing github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d required.
but same error

@tbruyelle
Copy link
Contributor

On my side I can run some ignite commands inside a chain that depends on github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d. I don't need to replace it with an older version.

What's happen when you run go get github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d inside your chain ?

Additionally, can you share with me the steps to reproduce the new error? Thx.

@Frederic-Zhou
Copy link
Author

Frederic-Zhou commented Jul 19, 2022

Hi @tbruyelle
my steps are:

1. clone repo

● ~/workspace/cosmos » git clone https://github.com/ignite/cli --depth=1                     
Cloning into 'cli'...
remote: Enumerating objects: 1136, done.
remote: Counting objects: 100% (1136/1136), done.
remote: Compressing objects: 100% (874/874), done.
remote: Total 1136 (delta 126), reused 848 (delta 102), pack-reused 0
Receiving objects: 100% (1136/1136), 156.99 MiB | 10.91 MiB/s, done.
Resolving deltas: 100% (126/126), done.
Updating files: 100% (782/782), done.

2. install ignite

● ~/workspace/cosmos » cd cli && make install                         
Installing Ignite CLI...
Ignite CLI version:	development
Ignite CLI build date:	2022-07-19T17:38:52
Ignite CLI source hash:	fe175c961f9061d8d3aadfe9f8c2bcde9cfd6731
Your OS:		darwin
Your arch:		amd64
Your go version:	go version go1.18.2 darwin/amd64
Your uname -a:		Darwin MacBook-Pro.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 x86_64
Your cwd:		/Users/zeta/workspace/cosmos/cli
Is on Gitpod:		false

3. set GOPROXY and scaffold chain

● ~/workspace/cosmos/cli(develop) » export GOPROXY="https://proxy.golang.org,direct"    
● ~/workspace/cosmos/cli(develop) » cd ..                                                                                     
● ~/workspace/cosmos » ignite scaffold chain github.com/username/nameservice --no-module             
go: github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d: Get "https://proxy.golang.org/github.com/ignite/cli/@v/v0.22.3-0.20220711121333-fd07def4098d.mod": dial tcp 142.251.43.17:443: i/o timeout
: exit status 1

4. set other different GOPROXY and scaffold chain, and occur different errors

● ~/workspace/cosmos » export GOPROXY="none"                                           
● ~/workspace/cosmos » ignite scaffold chain github.com/username/nameservice --no-module     
go: github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d: invalid proxy URL missing scheme: none
: exit status 1
● ~/workspace/cosmos » export GOPROXY="https://goproxy.io,direct"         
● ~/workspace/cosmos » ignite scaffold chain github.com/username/nameservice --no-module          
go: github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d: invalid version: unknown revision fd07def4098d
: exit status 1
● ~/workspace/cosmos » export GOPROXY=https://proxy.golang.com.cn,direct        
● ~/workspace/cosmos » ignite scaffold chain github.com/username/nameservice --no-module           
go: github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d: invalid version: unknown revision fd07def4098d
: exit status 1
● ~/workspace/cosmos »          

@tbruyelle
Copy link
Contributor

tbruyelle commented Jul 19, 2022

It seems you can't access URL like https://proxy.golang.org/github.com/ignite/cli/@v/v0.22.3-0.20220711121333-fd07def4098d.mod. On my side I can. Maybe you have access restrictions ?

On the other hand, none of the alternate proxies goproxy.io or proxy.golang.com.cn are up to date...

@Frederic-Zhou
Copy link
Author

Yes, there are a lot of network restrictions in my area,that's too bad.
is there a way I can handle this manually?

@tbruyelle
Copy link
Contributor

tbruyelle commented Jul 19, 2022

On the other hand, none of the alternate proxies goproxy.io or proxy.golang.com.cn are up to date...

Actually, the problem doesn't come from the proxies, but from the version I added in the template (github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d). Indeed this version is no longer fetch-able from the repo, because it was in a branch that has been deleted after the merge to develop. It's present in proxy.golang.org because I ran a go get with this version, but obviously nobody did that using the alternative proxies.

is there a way I can handle this manually?

That said, I may have one fix that should work immediately, if it doesn't, you will have to wait for the next official release v0.22.3, that should arrive very soon anyway.

Change the cli version to github.com/ignite/cli v0.22.3-0.20220715132647-ffd4b499c704 in your go.mod, then run

GOSUMDB=off go mod tidy

This version exists in the repo, unlike the previous one, so whatever the proxy you have configured, you should be able to fetch it. On my side I tried with GOPROXY=https://proxy.golang.com.cn,direct and it worked.

@Frederic-Zhou
Copy link
Author

Frederic-Zhou commented Jul 20, 2022

new error occur

cannot build app:

	go: github.com/ignite/cli@v0.22.3-0.20220715132647-ffd4b499c704: verifying go.mod: github.com/ignite/cli@v0.22.3-0.20220715132647-ffd4b499c704/go.mod: reading https://proxy.golang.com.cn/sumdb/sum.golang.org/lookup/github.com/ignite/cli@v0.22.3-0.20220715132647-ffd4b499c704: 410 Gone
	server response: not found: fetch timed out
: exit status 1

I found this if remove github.com/ignite/cli@v0.22.3-0.20220711121333-fd07def4098d required in the go.mod.plush file of ignite-cli.
and run

ignite scaffold chain github.com/username/nameservice --no-module       

the go.mod file of chain repo will be required is github.com/ignite/cli v0.22.2, and work fine.

image

@tbruyelle
Copy link
Contributor

the go.mod file of chain repo will be required is github.com/ignite/cli v0.22.2, and work fine.

but don't you come back to the original problem?

@Frederic-Zhou
Copy link
Author

Frederic-Zhou commented Jul 21, 2022

Thank you so much for your help, @tbruyelle
My current project was created with v0.20.1, so there is no rush to use the latest version right away. Of course, I still hope to experience the latest version to solve this problem.
In my area, there are indeed many problems with network restrictions, it's pretty bad. I tried the solution you gave, but I still get an I/O timeout error.
Maybe I should wait for you to update the next version, for now, I can learn through v0.20.1

@fadeev fadeev added component:scaffold Feature, enhancement, or refactor related to scaffolding. and removed report labels Sep 17, 2022
@aljo242 aljo242 closed this as completed Nov 28, 2022
Jchicode pushed a commit to Jchicode/cli that referenced this issue Aug 9, 2023
The change fixes a go command error when scaffolding a chain (see ignite#2618), because go cannot fetch `ignite-hq/cli` despite the github redirection.

To remove `ignite-hq/cli` from the dependency list, I had to : 
- upgrade `spn` to latest (so it depends on `ignite/cli@v0.22.2` rather than `ignite-hq/cli`)
- upgrade go to 1.18 in `go.mod.plush` (or else `ignite/cli@v0.22.2` adds a dependency to an older `spn` which in turn adds a dependency to `ignite-hq/cli`)

Bonus:
- improve `go mod download` error report : add the binary output in addition to `Exit status 1`.
- fix test because of upgrade to ibc-go 3.0.1, where  some parameters can't be null.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:scaffold Feature, enhancement, or refactor related to scaffolding.
Projects
None yet
Development

No branches or pull requests

5 participants