Dep: [error] dep ensure: Access is denied.

Created on 26 Oct 2017  路  13Comments  路  Source: golang/dep

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

dep:
version : devel
build date :
git hash :
go version : go1.9.1
go compiler : gc
platform : windows/amd64

What dep command did you run?

dep ensure

What did you expect to see?

install all dependencies

What did you see instead?

Error:
grouped write of manifest, lock and vendor: link error: cannot rename C:\Users\sandra\AppData\Local\Tempdep823257486\vendor to C:\Users\sandra\go\src\github.com\shp\auditlog-svc\vendor: rename C:\Users\sandra\AppData\Local\Tempdep823257486\vendor C:\Users\sandra\go\src\github.com\shp\auditlog-svc\vendor: Access is denied.

Most helpful comment

Same here (I think), happens is the vendor directory is open explorer

All 13 comments

I think we had this one before. What's the Windows release you are using?

we'd love to help, but need more info - if we don't hear back in the next week or two, we may close this issue to keep the queue tidier.

I'm experiencing this issue also when trying to run an update on a package:

dep ensure -update path/to/package

Ive tried running the above command from an admin cmd.exe and an admin gitbash terminal with the same result

the error I get is:
dep ensure -update path/to/package
grouped write of manifest, lock and vendor: link error: cannot rename drive:\path\to\vendor to drive:\path\to\vendor.orig: rename drive:\path\to\vendor drive:\path\to\vendor.orig: Access is denied.

I'm on Windows 10 Pro and I was running the tip of master (i think this would generally be what people pick up on Windows since the only instructions in readme for windows install is to run go get - might be worth adding a link to the tagged downloads in the repo, although windows downloads seem to have incorrect names (not dep) and no .exe file extension)

Might be related to this issue in Windows with directory read-only flags (although it references win7):
https://answers.microsoft.com/en-us/windows/forum/windows_7-files/cannot-change-read-only-file-attributes-using/b02b2254-cd4d-4e50-a68a-cae8c748d086?auth=1

but I tried running attrib -r +s vendor as suggested there and that didn't help, folder still appeared as read-only (non-directory contents do not), if you actually inspect the permissions on the folder everone has permissions to do everthing by default #windowssecurity but read-only flag appears set and keeps popping back no matter how many time you unset (as described in above issue).

I tried checking out some tagged releases of dep to see if any work:

v0.3.2 - doesnt work, same issue
v0.3.1 - doesnt work, same issue
v0.3.0 - same issue, no windows download link on this one, so I'm guessing Windows support wasn't strong prior to this

My current workaround is to delete the vendor folder, manually update by global dependencies and then run init - kinda does away with the whole dep management bit though :(

Let me know if any other info I can provide to help

I realized I had earlier attempted to do this on a mounted and encrypted volume and wanted to rule that out as a possible cause.

I've just run a second attempt with a different repo on a different machine using master of dep (2b7a08040ebc4699bfbd38128e9887eeb3092168) this time repo and dep were on a local drive (C:) within my admin users home folder.

To reproduce On Win10 64 bit: just dep init a project with a dependency on a repo you have control of, release an update to the dependency and run: dep ensure -update

I had a problem identical to that @dwall80 @SandraAlex13 and I solved it by running the command attrib -r + s vendor

Same here (I think), happens is the vendor directory is open explorer

I am having the same issue.

Windows 10 (Build 1607).

dep:
 version     : v0.3.2
 build date  : 2017-10-19
 git hash    : 8ddfc8a
 go version  : go1.9
 go compiler : gc
 platform    : windows/amd64

When I run dep ensure I get the following error:
grouped write of manifest, lock and vendor: link error: cannot rename C:\Users\username\AppData\Local\Temp\dep412730570\vendor to C:\Users\username\projects\go\project-path\vendor: rename C:\Users\username\AppData\Local\Temp\dep412730570\vendor C:\Users\username\projects\go\project-path\vendor: Access is denied.

I tried running dep ensure from both cmd and git bash, both as administrator and regular user.

  • Deleting vendor does not help.
  • Changing vendor attributes (through attrib -r +s vendor) doesn't help.
  • Closing all applications and running just the command prompt (either cmd or git bash as either regular user or as an admin) doesn't help.
  • Deleting Gopkg.lock doesn't help.

I have experienced this problem _intermittently_. For me it would only happen if I ran dep ensure or dep prune back to back in a short time window. Then I noticed that whenever I got the error SublimeText was showing a % number in its status bar.

From this I surmise that after dep ensure adds a bunch of files to my vendor folder Sublime begins (re)indexing the vendor folder. When I run dep prune while Sublime is crawling the vendor folder I get an error.

I've noticed that dep likes to mv vendor to vendor.orig before rebuilding the vendor folder. That will almost always cause problems on Windows if any other process has any files in the vendor tree open at the time.

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

Windows 7 Pro
by default I get this error:

C:\Projects\Go\src\github.com\Juev\project>dep ensure
grouped write of manifest, lock and vendor: link error: cannot rename C:\Temp\dep160412370\vendor to C:\Projects\Go\src\github.com\Juev\project\vendor: rename C:\Temp\dep160412370\vendor C:\Projects\Go\src\github.com\Juev\project\
vendor: Access is denied.

If I create directory vendor by hand, then I use command:

attrib -R +S vendor

I got the same issue.
If I run this command again, dep ensure work without error.

But if understand correctly, its only workaround.

Same error here on Windows 10, using the attrib -R +S vendor workaround worked for me.

I have this problem if I run dep ensure while I am in the vendor directory. So running the dep ensure command from the /vendor/ subdir doesn't work for me. Windows 7, Gitbash shell.

really not much of a way around that particular one. I would accept a PR that prevents dep commands from being run within the vendor dir, on windows at least.

On March 26, 2018 1:28:47 PM EDT, Michael Hewitt notifications@github.com wrote:

I have this problem if I run dep ensure while I am in the vendor
directory. So running the dep ensure command from the /vendor/ subdir
doesn't work for me. Windows 7, Gitbash shell.

--
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub:
https://github.com/golang/dep/issues/1318#issuecomment-376246449

As other's reported running attrib -R +S vendor fixed my error.

I'm curious. Does anyone know if this issue is only Window's related and how does the attrib command resolve this?

Thanks @lucashenriqueteixeira!

Was this page helpful?
0 / 5 - 0 ratings