golang / dep

Go dependency management tool experiment (deprecated)
https://golang.github.io/dep/
BSD 3-Clause "New" or "Revised" License
12.85k stars 1.05k forks source link

Dep freezes (can't handle file locking) #1685

Closed Nykakin closed 6 years ago

Nykakin commented 6 years ago

What version of dep are you using (dep version)?

dep:
 version     : v0.4.1
 build date  : 2018-01-24
 git hash    : 37d9ea0a
 go version  : go1.9.1
 go compiler : gc
 platform    : linux/amd64

What dep command did you run?

$ dep ensure -v
dep: WARNING: branch, version, revision, or source should be provided for "github.com/Pallinder/go-randomdata"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/davecgh/go-spew"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/go-chi/jwtauth"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/go-chi/render"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/go-playground/locales"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/go-playground/universal-translator"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/rubenv/sql-migrate"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/spf13/viper"
dep: WARNING: branch, version, revision, or source should be provided for "golang.org/x/crypto"
dep: WARNING: branch, version, revision, or source should be provided for "gopkg.in/volatiletech/null.v6"
Gopkg.lock was already in sync with imports and Gopkg.toml
(1/47) Wrote github.com/pmezard/go-difflib@v1.0.0
(2/47) Wrote github.com/renstrom/shortuuid@v2.0.3
(3/47) Wrote github.com/etgryphon/stringUp@master
(4/47) Wrote github.com/Pallinder/go-randomdata@master
(5/47) Wrote github.com/davecgh/go-spew@v1.1.0
(6/47) Wrote github.com/satori/go.uuid@v1.2.0
(7/47) Wrote github.com/spf13/cast@v1.1.0
(8/47) Wrote gopkg.in/yaml.v2@v2
(9/47) Wrote github.com/rubenv/sql-migrate@master
(10/47) Wrote github.com/dgrijalva/jwt-go@v3.1.0
(11/47) Wrote github.com/volatiletech/sqlboiler@v2.6.0
(12/47) Wrote go.uber.org/atomic@v1.3.1
(13/47) Wrote go.uber.org/multierr@v1.1.0
(14/47) Wrote golang.org/x/crypto@d9133f5469342136e669e85192a26056b587f503
(15/47) Wrote golang.org/x/sys@99f16d856c9836c42d24e7ab64ea72916925fa97
(16/47) Wrote github.com/spf13/afero@v1.0.2
(17/47) Wrote gopkg.in/natefinch/lumberjack.v2@v2.1
(18/47) Wrote golang.org/x/text@master
(19/47) Wrote github.com/volatiletech/inflect@master
(20/47) Wrote github.com/spf13/jwalterweatherman@master
(21/47) Wrote go.uber.org/zap@v1.7.1
(22/47) Wrote gopkg.in/go-playground/validator.v9@v9.9.4
(23/47) Wrote gopkg.in/gorp.v1@v1.7.1
(24/47) Wrote github.com/spf13/pflag@4c012f6dcd9546820e378d0bdda4d8fc772cdfea
(25/47) Wrote gopkg.in/volatiletech/null.v6@v6.4
(26/47) Wrote github.com/spf13/viper@4dddf7c62e16bce5807744018f5b753bfe21bbd2
(27/47) Wrote github.com/go-chi/cors@v1.0.0
(28/47) Wrote github.com/stretchr/testify@v1.2.1
(29/47) Wrote github.com/fsnotify/fsnotify@v1.4.7
(30/47) Wrote github.com/go-chi/chi@v3.3.2
(31/47) Wrote github.com/go-chi/render@7bbdb19f4016118d23bc31d6d33dc1dd517c6b2e
(32/47) Wrote github.com/go-chi/jwtauth@v3.1.3
(33/47) Wrote github.com/go-sql-driver/mysql@v1.3
(34/47) Wrote github.com/aws/aws-sdk-go@v1.12.72
(35/47) Wrote github.com/go-playground/universal-translator@master
(36/47) Wrote github.com/guregu/null@v3.3.0
(37/47) Wrote github.com/go-ini/ini@v1.32.0
(38/47) Wrote github.com/go-playground/locales@v0.11.2
(39/47) Wrote github.com/jmespath/go-jmespath@0b12d6b5
(40/47) Wrote github.com/hashicorp/hcl@master
(41/47) Wrote github.com/lib/pq@master
(42/47) Wrote github.com/magiconair/properties@master
(43/47) Wrote github.com/leebenson/conform@1.2.0
(44/47) Wrote github.com/mitchellh/mapstructure@master
(45/47) Wrote github.com/pelletier/go-toml@v1.1.0
(46/47) Wrote github.com/pkg/errors@v0.8.0
^CSignal received: waiting for 1 ops to complete...
^C^C

What did you expect to see?

Correctly generated vendor catalog with dependencies.

What did you see instead?

dep freezes forever. strace shows:

$ sudo strace -fp 19253
strace: Process 19253 attached with 25 threads
[pid 19347] futex(0xc42072e110, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19346] futex(0xc420188810, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19325] futex(0xc4203b1610, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19324] futex(0xc4202fc810, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19322] futex(0xc4203b0f10, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19319] futex(0xc4203b0b90, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19310] futex(0xc420902b90, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19308] futex(0xc420427990, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19303] futex(0xc420427610, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19302] futex(0xc420902810, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19294] futex(0xc420427290, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19285] futex(0xc4202fd610, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19284] futex(0xc420902490, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19264] futex(0xc420188490, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19263] futex(0xc420188110, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19262] waitid(P_PID, 19309,  <unfinished ...>
[pid 19261] futex(0xc420030f10, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19260] epoll_wait(4,  <unfinished ...>
[pid 19259] futex(0xc420030b90, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19258] futex(0xc4202fc110, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19257] futex(0xc42005e110, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19256] futex(0xc420030810, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19255] futex(0xc3d0e0, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19254] restart_syscall(<... resuming interrupted futex ...> <unfinished ...>
[pid 19253] futex(0xc1e130, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19254] <... restart_syscall resumed> ) = -1 ETIMEDOUT (Connection timed out)
[pid 19254] pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=20000}, NULL) = 0 (Timeout)
[pid 19254] futex(0xc1d578, FUTEX_WAIT, 0, {tv_sec=60, tv_nsec=0}) = -1 ETIMEDOUT (Connection timed out)
[pid 19254] futex(0xc420188110, FUTEX_WAKE, 1 <unfinished ...>
[pid 19263] <... futex resumed> )       = 0
[pid 19254] <... futex resumed> )       = 1
[pid 19263] epoll_wait(4,  <unfinished ...>
[pid 19254] pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=20000}, NULL <unfinished ...>
[pid 19263] <... epoll_wait resumed> [], 128, 0) = 0
[pid 19263] futex(0xc4203b0b90, FUTEX_WAKE, 1 <unfinished ...>
[pid 19319] <... futex resumed> )       = 0
[pid 19263] <... futex resumed> )       = 1
[pid 19319] futex(0xc4203b0f10, FUTEX_WAKE, 1 <unfinished ...>
[pid 19254] <... pselect6 resumed> )    = 0 (Timeout)
[pid 19322] <... futex resumed> )       = 0
[pid 19319] <... futex resumed> )       = 1
[pid 19322] futex(0xc4203b0f10, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 19319] futex(0xc1d590, FUTEX_WAKE, 1 <unfinished ...>
(...)

Setting DEPNOLOCK=1 does not help. I've found this in strace now:

read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
read(3, "", 4096)                       = 0
close(3)                                = 0
wait4(23936, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 23936
rt_sigaction(SIGTSTP, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fa0ecc3e140}, {sa_handler=0x7fa0ed228210, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fa0ecc3e140}, 8) = 0
poll([{fd=0, events=POLLIN}], 1, 0)     = 0 (Timeout)
poll([{fd=0, events=POLLIN}], 1, 0)     = 0 (Timeout)
poll([{fd=0, events=POLLIN}], 1, 0)     = 0 (Timeout)
write(1, "\33[1;232H7\33[4;19H7\33[5;14H6\33[6d\0107\33"..., 56) = 56
rt_sigaction(SIGTSTP, {sa_handler=0x7fa0ed228210, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fa0ecc3e140}, NULL, 8) = 0
nanosleep({tv_sec=1, tv_nsec=0}, ^Cstrace: Process 19603 detached
 <detached ...>

This is Linux.

$ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.10
Release:    17.10
Codename:   artful
$ uname -a
Linux test-pc 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Nykakin commented 6 years ago

Problem solved. It turned out ssh-agent was not enabled and as a result dep couldn't get some libraries from private repositories through SSH.

I believe some diagnostic message would be of use here.