Glide: [ERROR] Unable to export dependencies to vendor directory: remove /mnt/shared/go-T/src/github.com/ccgak/vendor/golang.org/x/sys/unix: directory not empty

Created on 27 Oct 2016  路  23Comments  路  Source: Masterminds/glide

When recommand glide update
$glide update
[ERROR] Unable to export dependencies to vendor directory: remove /mnt/shared/go-T/src/github.com/ccgak/vendor/golang.org/x/sys/unix: directory not empty

Most helpful comment

For me, I found it's a filesystem issue. I'm using virtualboxfs, and the core golang libs seems to fail to recursively delete if there are too many files. I did't push upstream and I think virtualboxfs may be to blame, so probably a bit of an edge case.

Anyway I think it's not glide issue, but golang issue.

All 23 comments

Im running into this issue. It does it every other time I run the command.

Same Here. Any update

ditto. Only seem to get this on windows bash shell though, might be related.

Im getting it in an Ubuntu Vagrant machine. Through a Make target, running a series of commands that builds a binary. glide install/update is one of them. My temporary workaround is to remove vendor/ & glide.lock before executing glide install. Didn't have this problem in glide 11.0. Now I'm on 12.3 and having the issue.

Can't sink for this issue.

Same issue here, with different library:

[ERROR] Unable to export dependencies to vendor directory: remove /repos/myproject/vendor/github.com/docker/docker/daemon: directory not empty

after deleting the directory with rm -rf it works fine. Other libraries seems to be ok, not sure why the docker one fails.

Same problem here. None of the above workarounds work for me.

Happens on Mac because of the .DS_Store file. Deleting it via rm .DS_Store fixes the problem.

How to solve this issue, Can't sink for this issue.

Is there any update on this? I literally can't use glide right now.

rm -rf /repos/myproject/vendor/github.com/docker/
glide up

solved it for me. Would like a better solution for long term, but as a workaround this is ok for now.

steps to reproduce would help a lot, if anyone has the time to put them together.

Not sure how helpful this will be, but here is the information on how I saw the error. With glide v0.12.3 on Ubuntu vagrant.

I had the following errors when running glide get github.com/hashicorp/go-getter when package: github.com/docker/docker in glide.yaml had no version:

[ERROR] Error scanning github.com/docker/docker/api/types/blkiodev: open /home/vagrant/.glide/cache/src/https-github.com-docker-docker/api/types/blkiodev: no such file or directory
[ERROR] This error means the referenced package was not found.
[ERROR] Missing file or directory errors usually occur when multiple packages
[ERROR] share a common dependency and the first reference encountered by the scanner
[ERROR] sets the version to one that does not contain a subpackage needed required
[ERROR] by another package that uses the shared dependency. Try setting a
[ERROR] version in your glide.yaml that works for all packages that share this
[ERROR] dependency.
[ERROR] Error scanning github.com/docker/docker/api/types/strslice: open /home/vagrant/.glide/cache/src/https-github.com-docker-docker/api/types/strslice: no such file or directory
[ERROR] This error means the referenced package was not found.
[ERROR] Missing file or directory errors usually occur when multiple packages
[ERROR] share a common dependency and the first reference encountered by the scanner
[ERROR] sets the version to one that does not contain a subpackage needed required
[ERROR] by another package that uses the shared dependency. Try setting a
[ERROR] version in your glide.yaml that works for all packages that share this
[ERROR] dependency.
[ERROR] Error scanning github.com/docker/docker/api/types/network: open /home/vagrant/.glide/cache/src/https-github.com-docker-docker/api/types/network: no such file or directory
[ERROR] This error means the referenced package was not found.
[ERROR] Missing file or directory errors usually occur when multiple packages
[ERROR] share a common dependency and the first reference encountered by the scanner
[ERROR] sets the version to one that does not contain a subpackage needed required
[ERROR] by another package that uses the shared dependency. Try setting a
[ERROR] version in your glide.yaml that works for all packages that share this
[ERROR] dependency.
[ERROR] Error scanning github.com/docker/docker/api/types/registry: open /home/vagrant/.glide/cache/src/https-github.com-docker-docker/api/types/registry: no such file or directory
[ERROR] This error means the referenced package was not found.
[ERROR] Missing file or directory errors usually occur when multiple packages
[ERROR] share a common dependency and the first reference encountered by the scanner
[ERROR] sets the version to one that does not contain a subpackage needed required
[ERROR] by another package that uses the shared dependency. Try setting a
[ERROR] version in your glide.yaml that works for all packages that share this
[ERROR] dependency.
[ERROR] Error scanning github.com/docker/docker/api/types/versions: open /home/vagrant/.glide/cache/src/https-github.com-docker-docker/api/types/versions: no such file or directory
[ERROR] This error means the referenced package was not found.
[ERROR] Missing file or directory errors usually occur when multiple packages
[ERROR] share a common dependency and the first reference encountered by the scanner
[ERROR] sets the version to one that does not contain a subpackage needed required
[ERROR] by another package that uses the shared dependency. Try setting a
[ERROR] version in your glide.yaml that works for all packages that share this
[ERROR] dependency.
[ERROR] Error scanning github.com/docker/docker/pkg/term/windows: open /home/vagrant/.glide/cache/src/https-github.com-docker-docker/pkg/term/windows: no such file or directory
[ERROR] This error means the referenced package was not found.
[ERROR] Missing file or directory errors usually occur when multiple packages
[ERROR] share a common dependency and the first reference encountered by the scanner
[ERROR] sets the version to one that does not contain a subpackage needed required
[ERROR] by another package that uses the shared dependency. Try setting a
[ERROR] version in your glide.yaml that works for all packages that share this
[ERROR] dependency.
[ERROR] Failed to retrieve a list of dependencies: Error resolving imports

When I added a version: ^1.12.0 for package: github.com/docker/docker, I no longer had the above errors, and got the error referenced in this issue:

[ERROR] Unable to export dependencies to vendor directory: remove /vagrant/godev/src/github.com/asteris-llc/converge/vendor/github.com/docker/docker/daemon: directory not empty

Removing vendor and glide.lock, then glide install got me past this.

If You import the sub package directly in your project, so this issue to appear. :)

@penhauer-xiao "steps to reproduce" need more context - please see http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

ideally, steps to reproduce should take me from absolutely clean state, step by step, to the problem you're seeing.

@arichardet thanks, that's most of what i need. other details, though:

  • hashicorp/go-getter does not, itself, import docker/docker, or any of its subpackages. Presumably, then, something else in your project does?
  • Assuming "yes" to the previous, of the docker subpackages listed in that error message (api/types/blkiodev, api/types/strslice, api/types/network, api/types/registry, api/types/version, pkg/term/windows), which is your project currently importing?

if you're able to paste in a full, currently-working glide.lock and glide.yaml, that would also help enormously.

@sdboyer Our project is not directly importing the docker subpackages listed in the error messages; they are dependencies of other imported packages. Here is the glide.yaml and glide.lock. Hope this helps.

glide.yaml:

package: github.com/asteris-llc/converge
import:
- package: github.com/BurntSushi/toml
- package: github.com/braintree/manners
  subpackages:
  - test_helpers
- package: github.com/davecgh/go-spew
  subpackages:
  - spew
- package: github.com/fsnotify/fsnotify
  version: ^1.3.0
- package: github.com/hashicorp/errwrap
- package: github.com/hashicorp/go-multierror
- package: github.com/hashicorp/hcl
  subpackages:
  - hcl/ast
  - hcl/parser
  - hcl/printer
  - hcl/scanner
  - hcl/strconv
  - hcl/token
  - json/parser
  - json/scanner
  - json/token
- package: github.com/hashicorp/logutils
- package: github.com/hashicorp/terraform
  subpackages:
  - dag
  - vendor/github.com/hashicorp/go-multierror
  - vendor/github.com/hashicorp/errwrap
- package: github.com/inconshreveable/mousetrap
- package: github.com/kardianos/osext
- package: github.com/magiconair/properties
  version: ^1.7.0
- package: github.com/mattn/go-isatty
- package: github.com/mitchellh/mapstructure
- package: github.com/pkg/errors
- package: github.com/pmezard/go-difflib
  version: ~1.0.0
  subpackages:
  - difflib
- package: github.com/spf13/cast
- package: github.com/spf13/cobra
- package: github.com/spf13/jwalterweatherman
- package: github.com/spf13/pflag
- package: github.com/spf13/viper
- package: github.com/stretchr/testify
  subpackages:
  - assert
  - require
  - vendor/github.com/davecgh/go-spew/spew
  - vendor/github.com/pmezard/go-difflib/difflib
  - mock
- package: golang.org/x/net
  subpackages:
  - context
- package: golang.org/x/sys
  subpackages:
  - unix
- package: gopkg.in/yaml.v2
- package: github.com/streamrail/concurrent-map
- package: github.com/stretchr/objx
- package: github.com/mitchellh/hashstructure
- package: github.com/fsouza/go-dockerclient
- package: google.golang.org/grpc
  version: ~1.0.0
- package: github.com/grpc-ecosystem/grpc-gateway
  version: ^1.1.0
  subpackages:
  - third_party/googleapis/google/api
- package: github.com/dgrijalva/jwt-go
  version: ^3.0.0
- package: github.com/fgrid/uuid
  version: ^0.1.0
- package: github.com/Sirupsen/logrus
  version: ^0.10.0
- package: github.com/deckarep/golang-set
  version: ~1.5.0
- package: golang.org/x/crypto
  subpackages:
  - openpgp
- package: github.com/arbovm/levenshtein
- package: golang.org/x/sync
  subpackages:
  - errgroup
- package: github.com/docker/docker
  version: ^1.12.0

glide.lock

hash: 16934945ed27f8335045492c5ffea6003f202fa5096e43b7fc438751b62b6fb0
updated: 2016-11-29T14:25:01.184215603-06:00
imports:
- name: github.com/arbovm/levenshtein
  version: 48b4e1c0c4d0b8b1864f1bd2cd31bb20147e4636
- name: github.com/aws/aws-sdk-go
  version: 92ed7a76d078fc5b792a3b5c834274c8dc89d10a
  subpackages:
  - aws
  - aws/awserr
  - aws/awsutil
  - aws/client
  - aws/client/metadata
  - aws/corehandlers
  - aws/credentials
  - aws/credentials/ec2rolecreds
  - aws/credentials/endpointcreds
  - aws/credentials/stscreds
  - aws/defaults
  - aws/ec2metadata
  - aws/request
  - aws/session
  - aws/signer/v4
  - private/endpoints
  - private/protocol
  - private/protocol/query
  - private/protocol/query/queryutil
  - private/protocol/rest
  - private/protocol/restxml
  - private/protocol/xml/xmlutil
  - private/waiter
  - service/s3
  - service/sts
- name: github.com/Azure/go-ansiterm
  version: fa152c58bc15761d0200cb75fe958b89a9d4888e
  subpackages:
  - winterm
- name: github.com/bgentry/go-netrc
  version: 9fd32a8b3d3d3f9d43c341bfe098430e07609480
  subpackages:
  - netrc
- name: github.com/braintree/manners
  version: 82a8879fc5fd0381fa8b2d8033b19bf255252088
  subpackages:
  - test_helpers
- name: github.com/BurntSushi/toml
  version: f0aeabca5a127c4078abb8c8d64298b147264b55
- name: github.com/davecgh/go-spew
  version: 5215b55f46b2b919f50a1df0eaa5886afe4e3b3d
  subpackages:
  - spew
- name: github.com/deckarep/golang-set
  version: 52ba7f28f319e9d560acbf47c7fcf9b9ee7aa7d3
- name: github.com/dgrijalva/jwt-go
  version: d2709f9f1f31ebcda9651b03077758c1f3a0018c
- name: github.com/docker/docker
  version: 1f9b3ef9e9c74c2905780ac5347d018646a20022
  subpackages:
  - api/types
  - api/types/blkiodev
  - api/types/container
  - api/types/filters
  - api/types/mount
  - api/types/network
  - api/types/registry
  - api/types/strslice
  - api/types/swarm
  - api/types/versions
  - opts
  - pkg/archive
  - pkg/fileutils
  - pkg/homedir
  - pkg/idtools
  - pkg/ioutils
  - pkg/jsonlog
  - pkg/jsonmessage
  - pkg/longpath
  - pkg/pools
  - pkg/promise
  - pkg/stdcopy
  - pkg/system
  - pkg/term
  - pkg/term/windows
- name: github.com/docker/go-connections
  version: 1494b6df4050e60923d68cd8cc6a19e7af9f1c01
  subpackages:
  - nat
- name: github.com/docker/go-units
  version: eb879ae3e2b84e2a142af415b679ddeda47ec71c
- name: github.com/fgrid/uuid
  version: 6f72a2d331c927473b9b19f590d43ccb5018c844
- name: github.com/fsnotify/fsnotify
  version: 629574ca2a5df945712d3079857300b5e4da0236
- name: github.com/fsouza/go-dockerclient
  version: 991e78ed454ce7de73ef3c559008095802e51fd2
- name: github.com/go-ini/ini
  version: 2ba15ac2dc9cdf88c110ec2dc0ced7fa45f5678c
- name: github.com/golang/protobuf
  version: 888eb0692c857ec880338addf316bd662d5e630e
  subpackages:
  - jsonpb
  - proto
  - protoc-gen-go/descriptor
  - ptypes/empty
- name: github.com/grpc-ecosystem/grpc-gateway
  version: a8f25bd1ab549f8b87afd48aa9181221e9d439bb
  subpackages:
  - runtime
  - runtime/internal
  - third_party/googleapis/google/api
  - utilities
- name: github.com/hashicorp/errwrap
  version: 7554cd9344cec97297fa6649b055a8c98c2a1e55
- name: github.com/hashicorp/go-cleanhttp
  version: ad28ea4487f05916463e2423a55166280e8254b5
- name: github.com/hashicorp/go-getter
  version: 2fbd997432e72fe36060c8f07ec1eaf98d098177
  subpackages:
  - helper/url
- name: github.com/hashicorp/go-multierror
  version: d30f09973e19c1dfcd120b2d9c4f168e68d6b5d5
- name: github.com/hashicorp/hcl
  version: 6f5bfed9a0a22222fbe4e731ae3481730ba41e93
  subpackages:
  - hcl/ast
  - hcl/parser
  - hcl/printer
  - hcl/scanner
  - hcl/strconv
  - hcl/token
  - json/parser
  - json/scanner
  - json/token
- name: github.com/hashicorp/logutils
  version: 0dc08b1671f34c4250ce212759ebd880f743d883
- name: github.com/hashicorp/terraform
  version: dce175459a9b0bc1f42b1b0f919aae294a73a138
  subpackages:
  - dag
  - vendor/github.com/hashicorp/errwrap
  - vendor/github.com/hashicorp/go-multierror
- name: github.com/inconshreveable/mousetrap
  version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
- name: github.com/jmespath/go-jmespath
  version: bd40a432e4c76585ef6b72d3fd96fb9b6dc7b68d
- name: github.com/kardianos/osext
  version: 29ae4ffbc9a6fe9fb2bc5029050ce6996ea1d3bc
- name: github.com/magiconair/properties
  version: c265cfa48dda6474e208715ca93e987829f572f8
- name: github.com/mattn/go-isatty
  version: 56b76bdf51f7708750eac80fa38b952bb9f32639
- name: github.com/Microsoft/go-winio
  version: ce2922f643c8fd76b46cadc7f404a06282678b34
- name: github.com/mitchellh/go-homedir
  version: 756f7b183b7ab78acdbbee5c7f392838ed459dda
- name: github.com/mitchellh/hashstructure
  version: b098c52ef6beab8cd82bc4a32422cf54b890e8fa
- name: github.com/mitchellh/mapstructure
  version: d2dd0262208475919e1a362f675cfc0e7c10e905
- name: github.com/opencontainers/runc
  version: 9b53b362e2036d3d4c41bca62edf0482b80665a6
  subpackages:
  - libcontainer/system
  - libcontainer/user
- name: github.com/pkg/errors
  version: cc5fbb72d9b1b5f664ff3c11ed7896ee23ad9276
- name: github.com/pmezard/go-difflib
  version: 792786c7400a136282c1664665ae0a8db921c6c2
  subpackages:
  - difflib
- name: github.com/Sirupsen/logrus
  version: d26492970760ca5d33129d2d799e34be5c4782eb
- name: github.com/spf13/cast
  version: 27b586b42e29bec072fe7379259cc719e1289da6
- name: github.com/spf13/cobra
  version: f368244301305f414206f889b1735a54cfc8bde8
- name: github.com/spf13/jwalterweatherman
  version: 33c24e77fb80341fe7130ee7c594256ff08ccc46
- name: github.com/spf13/pflag
  version: cb88ea77998c3f024757528e3305022ab50b43be
- name: github.com/spf13/viper
  version: d8a428b8a30606e1d0b355d91edf282609ade1a6
- name: github.com/streamrail/concurrent-map
  version: 8bf1e9bacbf65b10c81d0f4314cf2b1ebef728b5
- name: github.com/stretchr/objx
  version: cbeaeb16a013161a98496fad62933b1d21786672
- name: github.com/stretchr/testify
  version: c5d7a69bf8a2c9c374798160849c071093e41dd1
  subpackages:
  - assert
  - mock
  - require
  - vendor/github.com/davecgh/go-spew/spew
  - vendor/github.com/pmezard/go-difflib/difflib
- name: golang.org/x/crypto
  version: b35ccbc95a0eaae49fb65c5d627cb7149ed8d1ab
  subpackages:
  - cast5
  - openpgp
  - openpgp/armor
  - openpgp/elgamal
  - openpgp/errors
  - openpgp/packet
  - openpgp/s2k
- name: golang.org/x/net
  version: 4876518f9e71663000c348837735820161a42df7
  subpackages:
  - context
  - context/ctxhttp
  - http2
  - http2/hpack
  - internal/timeseries
  - trace
- name: golang.org/x/sync
  version: 1ae7c7b29e06598039be46c5083819ba6fd7a97e
  subpackages:
  - errgroup
- name: golang.org/x/sys
  version: d4feaf1a7e61e1d9e79e6c4e76c6349e9cab0a03
  subpackages:
  - unix
  - windows
- name: google.golang.org/grpc
  version: 777daa17ff9b5daef1cfdf915088a2ada3332bf0
  subpackages:
  - codes
  - credentials
  - grpclog
  - internal
  - metadata
  - naming
  - peer
  - transport
- name: gopkg.in/yaml.v2
  version: a83829b6f1293c91addabc89d0571c246397bbf4
testImports: []

I can reproduce with the following glide.yaml in an empty folder:

package: test
import:
- package: github.com/docker/docker

and simply run glide up twice:

:/repos/test$ glide up
[WARN]  The name listed in the config file (test) does not match the current location (.)
[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Fetching updates for github.com/docker/docker.
[INFO]  Resolving imports
[INFO]  Downloading dependencies. Please wait...
[INFO]  Setting references for remaining imports
[INFO]  Exporting resolved dependencies...
[INFO]  --> Exporting github.com/docker/docker
[INFO]  Replacing existing vendor dependencies
[INFO]  Project relies on 1 dependencies.

:/repos/test$ glide up
[WARN]  The name listed in the config file (test) does not match the current location (.)
[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Fetching updates for github.com/docker/docker.
[INFO]  Resolving imports
[INFO]  Downloading dependencies. Please wait...
[INFO]  Setting references for remaining imports
[INFO]  Exporting resolved dependencies...
[INFO]  --> Exporting github.com/docker/docker
[INFO]  Replacing existing vendor dependencies
[ERROR] Unable to export dependencies to vendor directory: remove /repos/test/vendor/github.com/docker/docker/daemon: directory not empty

With the workaround:

:/repos/test$ rm -rf /repos/test/vendor/github.com/docker/docker/daemon
:/repos/test$ glide up

it works, but fails again with same error as above on second attempt

I think all of these issues can be reproduced with this glide.yaml:

package: .
import:
- package: github.com/docker/docker
  version: master

Workaround:

rm -rf vendor && glide up

Using this a lot these days .... :(

Any fix for this? Keep running into it.

@joshmello
The following is my solution, more than a few times, usually in the first 2 or 3 can be deleted
for i := 0; i < 20; i++ { err = os.RemoveAll(p) if err != nil { msg.Warn("Unable to clear the cache: %d: %s", i, err) continue } break }

@penhauer-xiao why did you close the issue? I can't see why glide doesn't just force delete this crappy file :(

For me, I found it's a filesystem issue. I'm using virtualboxfs, and the core golang libs seems to fail to recursively delete if there are too many files. I did't push upstream and I think virtualboxfs may be to blame, so probably a bit of an edge case.

Anyway I think it's not glide issue, but golang issue.

Was this page helpful?
0 / 5 - 0 ratings