golang / dep

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

safe write of manifest and lock: error while writing out vendor tree: failed to write dep tree #1065

Closed dlsniper closed 7 years ago

dlsniper commented 7 years ago

Dep version: f1346974068313371d889e120ec9e01f5ba43642

How to reproduce this:

go get -u -v github.com/gobuffalo/buffalo/...
cd $GOPATH/src/<some-folder>
buffalo new go4260 --with-dep

Output:

Buffalo version v0.9.3

--> go get -u golang.org/x/tools/cmd/goimports
--> go install golang.org/x/tools/cmd/goimports
--> go get -u github.com/golang/dep/cmd/dep
--> go install github.com/golang/dep/cmd/dep
--> go get -u github.com/motemen/gore
--> go install github.com/motemen/gore
--> /home/florin/go/src/github.com/dlsniper/go4260/README.md
--> /home/florin/go/src/github.com/dlsniper/go4260/actions/actions_test.go
--> /home/florin/go/src/github.com/dlsniper/go4260/actions/app.go
--> /home/florin/go/src/github.com/dlsniper/go4260/actions/home.go
--> /home/florin/go/src/github.com/dlsniper/go4260/actions/home_test.go
--> /home/florin/go/src/github.com/dlsniper/go4260/actions/render.go
--> /home/florin/go/src/github.com/dlsniper/go4260/.codeclimate.yml
--> /home/florin/go/src/github.com/dlsniper/go4260/.gitignore
--> /home/florin/go/src/github.com/dlsniper/go4260/grifts/init.go
--> /home/florin/go/src/github.com/dlsniper/go4260/locales/all.en-us.yaml
--> /home/florin/go/src/github.com/dlsniper/go4260/main.go
--> /home/florin/go/src/github.com/dlsniper/go4260/templates/_flash.html
--> /home/florin/go/src/github.com/dlsniper/go4260/templates/application.html
--> /home/florin/go/src/github.com/dlsniper/go4260/templates/index.html
--> /home/florin/go/src/github.com/dlsniper/go4260/.buffalo.dev.yml
--> goimports -w actions/actions_test.go actions/app.go actions/home.go actions/home_test.go actions/render.go grifts/init.go main.go
--> /home/florin/go/src/github.com/dlsniper/go4260/assets/images/logo.svg
--> /home/florin/go/src/github.com/dlsniper/go4260/assets/css/application.scss
--> /home/florin/go/src/github.com/dlsniper/go4260/assets/js/application.js
--> /home/florin/go/src/github.com/dlsniper/go4260/.babelrc
--> /home/florin/go/src/github.com/dlsniper/go4260/public/assets/.gitignore
--> /home/florin/go/src/github.com/dlsniper/go4260/webpack.config.js
--> yarn init --no-progress -y
yarn init v0.27.5
### 
[ yarn output omitted for brevity]
###
Done in 29.27s.
--> goimports -w actions/actions_test.go actions/app.go actions/home.go actions/home_test.go actions/render.go grifts/init.go main.go
--> /home/florin/go/src/github.com/dlsniper/go4260/models/models.go
--> /home/florin/go/src/github.com/dlsniper/go4260/models/models_test.go
--> /home/florin/go/src/github.com/dlsniper/go4260/grifts/db.go
--> go get github.com/markbates/pop/...
--> go install github.com/markbates/pop/soda
--> database.yml
--> goimports -w actions/actions_test.go actions/app.go actions/home.go actions/home_test.go actions/render.go grifts/db.go grifts/init.go main.go models/models.go models/models_test.go
--> goimports -w actions/actions_test.go actions/app.go actions/home.go actions/home_test.go actions/render.go grifts/db.go grifts/init.go main.go models/models.go models/models_test.go
--> /home/florin/go/src/github.com/dlsniper/go4260/Dockerfile
--> /home/florin/go/src/github.com/dlsniper/go4260/.dockerignore
--> goimports -w actions/actions_test.go actions/app.go actions/home.go actions/home_test.go actions/render.go grifts/db.go grifts/init.go main.go models/models.go models/models_test.go
--> goimports -w actions/actions_test.go actions/app.go actions/home.go actions/home_test.go actions/render.go grifts/db.go grifts/init.go main.go models/models.go models/models_test.go
--> dep init
  Locking in master (feef008) for transitive dep github.com/sergi/go-diff
  Locking in v1.1.4 (69483b4) for transitive dep github.com/stretchr/testify
  Locking in v2.1.0 (25f3d42) for transitive dep github.com/gobuffalo/plush
  Locking in v0.2.0 (c37440a) for transitive dep github.com/pelletier/go-buffruneio
  Using ^3.32.1 as constraint for direct dep github.com/markbates/pop
  Locking in v3.32.1 (148e524) for direct dep github.com/markbates/pop
  Locking in v1.3 (a0583e0) for transitive dep github.com/go-sql-driver/mysql
  Locking in master (91d0d9c) for transitive dep github.com/shurcooL/github_flavored_markdown
  Locking in master (541ff5e) for transitive dep github.com/shurcooL/sanitized_anchor_name
  Locking in master (a0792a0) for transitive dep github.com/shurcooL/go-goon
  Locking in master (f0d1606) for transitive dep github.com/microcosm-cc/bluemonday
  Locking in master (1aed211) for transitive dep github.com/shurcooL/octiconssvg
  Locking in v1.2.0 (ea4d1f6) for transitive dep github.com/gorilla/websocket
  Locking in v1.0 (a720dfa) for transitive dep github.com/fatih/structs
  Locking in v1.1 (667fe4e) for transitive dep github.com/gorilla/securecookie
  Locking in master (57efc9c) for transitive dep golang.org/x/net
  Locking in master (81e9090) for transitive dep golang.org/x/crypto
  Locking in v1.8.1 (3e70a1a) for transitive dep github.com/nicksnyder/go-i18n
  Locking in v1.5.0 (570b54c) for transitive dep github.com/fatih/color
  Locking in v3.0 (99ca9dc) for transitive dep github.com/monoculum/formam
  Using master as constraint for direct dep github.com/markbates/grift
  Locking in master (8e706d9) for direct dep github.com/markbates/grift
  Using ^1.0.0 as constraint for direct dep github.com/gobuffalo/packr
  Locking in v1.0.0 (e9ca0e5) for direct dep github.com/gobuffalo/packr
  Locking in master (6cacb66) for transitive dep github.com/markbates/inflect
  Locking in v1.2.0 (ca5e381) for transitive dep github.com/mattn/go-sqlite3
  Locking in v1.0.3 (f006c2a) for transitive dep github.com/sirupsen/logrus
  Locking in v1.3.3 (31a58af) for transitive dep github.com/markbates/refresh
  Locking in v1.1.0 (879c588) for transitive dep github.com/satori/go.uuid
  Locking in v1.1 (1ea2538) for transitive dep github.com/gorilla/context
  Locking in master (e422674) for transitive dep github.com/lib/pq
  Locking in master (d9bd385) for transitive dep github.com/jmoiron/sqlx
  Locking in master (2d6f6f8) for transitive dep golang.org/x/sys
  Locking in v1.1 (726cc8b) for transitive dep github.com/joho/godotenv
  Using ^0.9.3 as constraint for direct dep github.com/gobuffalo/buffalo
  Locking in v0.9.3 (b68b2b7) for direct dep github.com/gobuffalo/buffalo
  Locking in master (a3969c6) for transitive dep github.com/mattn/anko
  Using master as constraint for direct dep github.com/gobuffalo/suite
  Locking in master (cadc8b8) for direct dep github.com/gobuffalo/suite
  Locking in master (805cee6) for transitive dep github.com/daviddengcn/go-colortext
  Locking in v1.1.0 (346938d) for transitive dep github.com/davecgh/go-spew
  Locking in v1.0.0 (792786c) for transitive dep github.com/pmezard/go-difflib
  Locking in v1.4.0 (bcd8bc7) for transitive dep github.com/gorilla/mux
  Locking in master (d2cdc73) for transitive dep github.com/markbates/willie
  Locking in v0.0.9 (167de6b) for transitive dep github.com/mattn/go-colorable
  Locking in v1.5 (4048872) for transitive dep github.com/russross/blackfriday
  Locking in master (b8bc1bf) for transitive dep github.com/mitchellh/go-homedir
  Locking in master (b4702c9) for transitive dep github.com/markbates/validate
  Locking in v2 (eb3733d) for transitive dep gopkg.in/yaml.v2
  Locking in master (3833324) for transitive dep github.com/dustin/go-humanize
  Locking in master (f4cad6c) for transitive dep github.com/sourcegraph/annotate
  Locking in v1.4.2 (629574c) for transitive dep github.com/fsnotify/fsnotify
  Locking in master (800e180) for transitive dep github.com/markbates/hmax
  Using ^1.1.0 as constraint for direct dep github.com/gobuffalo/envy
  Locking in v1.1.0 (45f72f3) for direct dep github.com/gobuffalo/envy
  Locking in v1.0.0 (c6f054f) for transitive dep github.com/gobuffalo/tags
  Locking in master (85cf7b3) for transitive dep github.com/shurcooL/go
  Locking in v0.8.0 (645ef00) for transitive dep github.com/pkg/errors
  Locking in v1.5 (cc29540) for transitive dep github.com/ajg/form
  Locking in master (0576708) for transitive dep github.com/markbates/going
  Locking in v1.1 (ca9ada4) for transitive dep github.com/gorilla/sessions
  Locking in master (09bb405) for transitive dep github.com/shurcooL/highlight_diff
  Locking in v0.0.2 (fc9e8d8) for transitive dep github.com/mattn/go-isatty
  Locking in master (78fb10f) for transitive dep github.com/shurcooL/highlight_go
  Locking in master (bd320f5) for transitive dep github.com/sourcegraph/syntaxhighlight
  Locking in v1.0.0 (5ccdfb1) for transitive dep github.com/pelletier/go-toml
  Locking in master (1c7f653) for transitive dep github.com/serenize/snaker
safe write of manifest and lock: error while writing out vendor tree: failed to write dep tree
--> goimports -w go4260/actions/actions_test.go go4260/actions/app.go go4260/actions/home.go go4260/actions/home_test.go go4260/actions/render.go go4260/grifts/db.go go4260/grifts/init.go go4260/main.go go4260/models/models.go go4260/models/models_test.go
Usage:
  buffalo new [name] [flags]

Flags:
      --api                  skip all front-end code and configure for an API server
      --ci-provider string   specify the type of ci file you would like buffalo to generate [none, travis, gitlab-ci] (default "none")
      --db-type string       specify the type of database you want to use [postgres, mysql, sqlite3] (default "postgres")
      --docker string        specify the type of Docker file to generate [none, multi, standard] (default "multi")
  -f, --force                delete and remake if the app already exists
  -h, --help                 help for new
      --skip-pop             skips adding pop/soda to your app
      --skip-webpack         skips adding Webpack to your app
      --skip-yarn            skip to use npm as the asset package manager
  -v, --verbose              verbosely print out the go get/install commands
      --with-dep             adds github.com/golang/dep to your app

Error: exit status 1
sdboyer commented 7 years ago

ach, with our recent refactor of the vendor writer, we lose crucial context when running without -v. is it possible for you to rerun with dep init -v, and share the error outputs? without it, we don't actually know what the writer is failing on ๐Ÿ˜ข

/cc @ibrasho

F21 commented 7 years ago

Ran into this myself on Windows 10 64-bit.

Log:

$ dep init -v
Getting direct dependencies...
Checked 5 directories for packages.
Found 7 direct dependencies.
Root project is "github.com/F21/someproject"
 1 transitively valid internal packages
 7 external packages imported from 7 projects
(0)   โœ“ select (root)
(1)     ? attempt github.com/hashicorp/go-cleanhttp with 1 pkgs; 1 versions to try
(1)         try github.com/hashicorp/go-cleanhttp@master
(1)     โœ“ select github.com/hashicorp/go-cleanhttp@master w/1 pkgs
(2)     ? attempt github.com/cenkalti/backoff with 1 pkgs; 3 versions to try
(2)         try github.com/cenkalti/backoff@v1.1.0
(2)     โœ“ select github.com/cenkalti/backoff@v1.1.0 w/1 pkgs
(3)     ? attempt golang.org/x/net with 1 pkgs; 5 versions to try
(3)         try golang.org/x/net@master
(3)     โœ“ select golang.org/x/net@master w/1 pkgs
(4)     ? attempt github.com/Sirupsen/logrus with 1 pkgs; 46 versions to try
(4)         try github.com/Sirupsen/logrus@v1.0.3
(4)     โœ“ select github.com/Sirupsen/logrus@v1.0.3 w/1 pkgs
(5)     ? attempt golang.org/x/crypto with 1 pkgs; 1 versions to try
(5)         try golang.org/x/crypto@master
(5)     โœ“ select golang.org/x/crypto@master w/1 pkgs
(6)     ? attempt golang.org/x/sys with 1 pkgs; 1 versions to try
(6)         try golang.org/x/sys@master
(6)     โœ“ select golang.org/x/sys@master w/1 pkgs
(7)     ? revisit golang.org/x/sys to add 1 pkgs
(7)       โœ“ include 1 more pkgs from golang.org/x/sys@master
(7)     ? attempt github.com/pkg/errors with 1 pkgs; 11 versions to try
(8)         try github.com/pkg/errors@v0.8.0
(8)     โœ“ select github.com/pkg/errors@v0.8.0 w/1 pkgs
(8)     ? attempt github.com/go-sql-driver/mysql with 1 pkgs; 18 versions to try
(9)         try github.com/go-sql-driver/mysql@v1.3
(9)     โœ“ select github.com/go-sql-driver/mysql@v1.3 w/1 pkgs
(9)     ? attempt github.com/prometheus/client_golang with 1 pkgs; 15 versions to try
(10)      try github.com/prometheus/client_golang@v0.8.0
(10)  โœ“ select github.com/prometheus/client_golang@v0.8.0 w/1 pkgs
(10)  ? attempt github.com/golang/protobuf with 1 pkgs; 1 versions to try
(11)      try github.com/golang/protobuf@master
(11)  โœ“ select github.com/golang/protobuf@master w/1 pkgs
(11)  ? attempt github.com/prometheus/common with 2 pkgs; 2 versions to try
(12)      try github.com/prometheus/common@master
(12)  โœ“ select github.com/prometheus/common@master w/3 pkgs
(12)  ? attempt github.com/prometheus/procfs with 1 pkgs; 2 versions to try
(13)      try github.com/prometheus/procfs@master
(13)  โœ“ select github.com/prometheus/procfs@master w/2 pkgs
(13)  ? attempt github.com/matttproud/golang_protobuf_extensions with 1 pkgs; 6 versions to try
(14)      try github.com/matttproud/golang_protobuf_extensions@v1.0.0
(14)  โœ“ select github.com/matttproud/golang_protobuf_extensions@v1.0.0 w/1 pkgs
(14)  ? attempt github.com/prometheus/client_model with 1 pkgs; 3 versions to try
(15)      try github.com/prometheus/client_model@master
(15)  โœ“ select github.com/prometheus/client_model@master w/1 pkgs
(15)  ? attempt github.com/beorn7/perks with 1 pkgs; 5 versions to try
(16)      try github.com/beorn7/perks@master
(16)  โœ“ select github.com/beorn7/perks@master w/1 pkgs
(16)  ? attempt github.com/hashicorp/vault with 1 pkgs; 72 versions to try
(17)      try github.com/hashicorp/vault@v0.8.1
(17)  โœ“ select github.com/hashicorp/vault@v0.8.1 w/4 pkgs
(17)  ? revisit golang.org/x/net to add 1 pkgs
(18)    โœ“ include 4 more pkgs from golang.org/x/net@master
(17)  ? attempt github.com/hashicorp/go-multierror with 1 pkgs; 1 versions to try
(19)      try github.com/hashicorp/go-multierror@master
(19)  โœ“ select github.com/hashicorp/go-multierror@master w/1 pkgs
(18)  ? attempt github.com/hashicorp/errwrap with 1 pkgs; 1 versions to try
(20)      try github.com/hashicorp/errwrap@master
(20)  โœ“ select github.com/hashicorp/errwrap@master w/1 pkgs
(19)  ? attempt github.com/hashicorp/go-rootcerts with 1 pkgs; 1 versions to try
(21)      try github.com/hashicorp/go-rootcerts@master
(21)  โœ“ select github.com/hashicorp/go-rootcerts@master w/1 pkgs
(20)  ? attempt github.com/mitchellh/go-homedir with 1 pkgs; 1 versions to try
(22)      try github.com/mitchellh/go-homedir@master
(22)  โœ“ select github.com/mitchellh/go-homedir@master w/1 pkgs
(21)  ? attempt github.com/mitchellh/mapstructure with 1 pkgs; 1 versions to try
(23)      try github.com/mitchellh/mapstructure@master
(23)  โœ“ select github.com/mitchellh/mapstructure@master w/1 pkgs
(22)  ? attempt golang.org/x/text with 2 pkgs; 1 versions to try
(24)      try golang.org/x/text@master
(24)  โœ“ select golang.org/x/text@master w/9 pkgs
(23)  ? attempt github.com/fatih/structs with 1 pkgs; 3 versions to try
(25)      try github.com/fatih/structs@v1.0
(25)  โœ“ select github.com/fatih/structs@v1.0 w/1 pkgs
(24)  ? attempt github.com/hashicorp/hcl with 2 pkgs; 5 versions to try
(26)      try github.com/hashicorp/hcl@master
(26)  โœ“ select github.com/hashicorp/hcl@master w/9 pkgs
(25)  ? attempt github.com/sethgrid/pester with 1 pkgs; 2 versions to try
(27)      try github.com/sethgrid/pester@master
(27)  โœ“ select github.com/sethgrid/pester@master w/1 pkgs
(26)  ? attempt github.com/golang/snappy with 1 pkgs; 2 versions to try
(28)      try github.com/golang/snappy@master
(28)  โœ“ select github.com/golang/snappy@master w/1 pkgs
  โœ“ found solution with 53 packages from 26 projects

Solver wall times by segment:
         b-list-pkgs: 1m23.2663966s
              b-gmal: 1m21.5306715s
     b-list-versions:  1m4.0274955s
     b-source-exists:    7.6149477s
  b-deduce-proj-root:    1.4501824s
         select-atom:     25.0007ms
            new-atom:     12.4992ms
             satisfy:      9.5041ms
         select-root:           2ms
            add-atom:       500.1ยตs
               other:            0s

  TOTAL: 3m57.9391978s

  Locking in master (6bb64b3) for transitive dep github.com/hashicorp/go-rootcerts
  Locking in master (ac87088) for transitive dep golang.org/x/text
  Locking in master (553a641) for transitive dep github.com/golang/snappy
  Locking in master (57efc9c) for transitive dep golang.org/x/net
  Locking in master (2d6f6f8) for transitive dep golang.org/x/sys
  Using ^0.8.0 as constraint for direct dep github.com/pkg/errors
  Locking in v0.8.0 (645ef00) for direct dep github.com/pkg/errors
  Using ^0.8.1 as constraint for direct dep github.com/hashicorp/vault
  Locking in v0.8.1 (8d76a41) for direct dep github.com/hashicorp/vault
  Locking in master (e645f4e) for transitive dep github.com/prometheus/procfs
  Locking in master (4c0e845) for transitive dep github.com/beorn7/perks
  Locking in master (83588e7) for transitive dep github.com/hashicorp/go-multierror
  Locking in master (b8bc1bf) for transitive dep github.com/mitchellh/go-homedir
  Using master as constraint for direct dep github.com/hashicorp/go-cleanhttp
  Locking in master (3573b8b) for direct dep github.com/hashicorp/go-cleanhttp
  Using ^1.0.3 as constraint for direct dep github.com/Sirupsen/logrus
  Locking in v1.0.3 (f006c2a) for direct dep github.com/Sirupsen/logrus
  Using ^0.8.0 as constraint for direct dep github.com/prometheus/client_golang
  Locking in v0.8.0 (c5b7fcc) for direct dep github.com/prometheus/client_golang
  Locking in master (ab9f9a6) for transitive dep github.com/golang/protobuf
  Locking in v1.0 (a720dfa) for transitive dep github.com/fatih/structs
  Locking in v1.0.0 (3247c84) for transitive dep github.com/matttproud/golang_protobuf_extensions
  Locking in master (6f38060) for transitive dep github.com/prometheus/client_model
  Locking in master (7554cd9) for transitive dep github.com/hashicorp/errwrap
  Locking in master (d0303fe) for transitive dep github.com/mitchellh/mapstructure
  Locking in master (8f6b134) for transitive dep github.com/hashicorp/hcl
  Locking in master (a86a2d8) for transitive dep github.com/sethgrid/pester
  Using ^1.1.0 as constraint for direct dep github.com/cenkalti/backoff
  Locking in v1.1.0 (61153c7) for direct dep github.com/cenkalti/backoff
  Locking in master (81e9090) for transitive dep golang.org/x/crypto
  Using ^1.3.0 as constraint for direct dep github.com/go-sql-driver/mysql
  Locking in v1.3 (a0583e0) for direct dep github.com/go-sql-driver/mysql
  Locking in master (61f87aa) for transitive dep github.com/prometheus/common
Writing out golang.org/x/text@master
Writing out github.com/hashicorp/hcl@master
Writing out github.com/Sirupsen/logrus@v1.0.3
Writing out github.com/beorn7/perks@master
Writing out github.com/prometheus/client_model@master
Writing out github.com/cenkalti/backoff@v1.1.0
Writing out github.com/hashicorp/vault@v0.8.1
Writing out github.com/fatih/structs@v1.0
Writing out github.com/pkg/errors@v0.8.0
Writing out github.com/go-sql-driver/mysql@v1.3
Writing out github.com/golang/protobuf@master
Writing out github.com/prometheus/client_golang@v0.8.0
Writing out github.com/golang/snappy@master
Writing out github.com/sethgrid/pester@master
Writing out github.com/hashicorp/errwrap@master
Writing out github.com/prometheus/common@master
Writing out github.com/hashicorp/go-cleanhttp@master
Writing out github.com/mitchellh/mapstructure@master
Writing out github.com/prometheus/procfs@master
Writing out github.com/hashicorp/go-rootcerts@master
Writing out github.com/matttproud/golang_protobuf_extensions@v1.0.0
Writing out golang.org/x/net@master
Writing out golang.org/x/sys@master
Writing out golang.org/x/crypto@master
Writing out github.com/mitchellh/go-homedir@master
Writing out github.com/hashicorp/go-multierror@master
Failed to write dep tree. The following errors occurred:
 *  failed to export github.com/hashicorp/vault: : command killed after 10s of no activity
safe write of manifest and lock: error while writing out vendor tree: failed to write dep tree
F21 commented 7 years ago

As a temporary fix, I changed defaultCmdTimeout to something larger (200 * time.Second).

sdboyer commented 7 years ago

@F21 yeah, that's gonna be a different issue - this one was an actual error while writing (of some kind, we don't know what), whereas yours was a timeout.