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

cmd/go: go mod init hangs #47081

Closed
capsci opened this issue Jul 7, 2021 · 6 comments
Closed

cmd/go: go mod init hangs #47081

capsci opened this issue Jul 7, 2021 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@capsci
Copy link

capsci commented Jul 7, 2021

What version of Go are you using (go version)?

$ go version
go version go1.16.5 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ksomani/.cache/go-build"
GOENV="/home/ksomani/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ksomani/go/pkg/mod"
GONOPROXY="github.mycompany.com/*"
GONOSUMDB="github.mycompany.com/*"
GOOS="linux"
GOPATH="/home/ksomani/go"
GOPRIVATE="github.mycompany.com/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/sandbox/ksomani/workspaces/reposetup/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3573017286=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go mod init dummy

What did you expect to see?

go: creating new go.mod: module dummy
> ls
go.mod

What did you see instead?

go: creating new go.mod: module dummy


The command never returns and go.mod is not created

@mknyszek
Copy link
Contributor

mknyszek commented Jul 7, 2021

I can't reproduce this. I think we're going to need more information about your environment in order to help. In the directory you're creating a new module, is it hosted on some unorthodox or non-local filesystem? Can you pinpoint where the command is hanging? strace or getting a core dump of the stuck processes could help.

CC @bcmills

@mknyszek mknyszek added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Jul 7, 2021
@mknyszek mknyszek added this to the Backlog milestone Jul 7, 2021
@mknyszek mknyszek changed the title go mod commands stuck cmd/go: go mod init hangs Jul 7, 2021
@josharian
Copy link
Contributor

Maybe a dup of #38939?

@capsci
Copy link
Author

capsci commented Jul 8, 2021

@mknyszek

My company uses ZFS; and our home dirs and sandboxes are hosted on network

I'm able to run go mod init from other machines(logged in as myself) but not on my machine.

Here is strace output of hung go mod init dummy:

flock(3, LOCK_EX <detached ...>

Hope this helps, please let me know if you need more details.

When getting strace; I discovered multiple hung go mod tidy commands; killing those processes didn't help either
Attaching output for your reference

> ps -ef | grep go
ksomani   36472      1  0 Jul07 ?        00:00:02 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.065258780.mod
ksomani   37421      1  0 Jul06 ?        00:00:04 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.487540394.mod
ksomani   47939      1  0 Jun30 ?        00:00:11 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.634984851.mod
ksomani   49833      1  0 Jun27 ?        00:00:19 go mod tidy -modfile=/tmp/go.3ac7ddcc025d51bedcd660e388867de6a5bb3485591f33e1b8437ace0b780062.262117442.mod
ksomani   59576      1  0 Jun29 ?        00:00:11 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.753131597.mod
ksomani   81208      1  0 Jun29 ?        00:00:12 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.249969067.mod
ksomani   90613      1  0 Jun29 ?        00:00:12 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.009742224.mod
ksomani   96503      1  0 Jun29 ?        00:00:13 go list -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.930869340.mod -mod=mod -f {{.Module.Path}}@{{.Module.Version}} github.mycompany.com/development/bat-go-clients/rest
ksomani  111215 110637  0 07:24 pts/1    00:00:00 go mod init dummy
ksomani  111224  98333  0 07:24 pts/0    00:00:00 grep go
ksomani  111387      1  0 Jun29 ?        00:00:14 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.043367555.mod
ksomani  142411      1  0 Jul01 ?        00:00:13 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.211454661.mod
ksomani  155476      1  0 Jul02 ?        00:00:08 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.913074614.mod
ksomani  163365      1  0 Jun25 ?        00:00:26 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.985711555.mod
ksomani  201862      1  0 Jun29 ?        00:00:12 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.956490545.mod
ksomani  203448      1  0 Jul02 ?        00:00:10 go mod tidy -modfile=/tmp/go.3ac7ddcc025d51bedcd660e388867de6a5bb3485591f33e1b8437ace0b780062.413551457.mod
ksomani  213375      1  0 Jun28 ?        00:00:14 go mod tidy -modfile=/tmp/go.51d8d07de887072737045b8ca8bf021ac1ccfee581dbc6b6c3a784fa32f78944.423992863.mod

@capsci
Copy link
Author

capsci commented Jul 8, 2021

@mknyszek
FYI, my other go mod commands hang as well; like go mod tidy
But go build and go test run fine

@capsci
Copy link
Author

capsci commented Jul 8, 2021

A little google search on output of strace made me believe the problem is with the FileSystem

For some reason; I decided to reboot my machine and problem disappeared(I'm still not sure what changed).

I'm all set and unblocked for now, thanks for your help @mknyszek :)

@ianlancetaylor
Copy link
Contributor

Thanks for following up. Closing because there doesn't seem to be anything to do.

@golang golang locked and limited conversation to collaborators Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants