glide icon indicating copy to clipboard operation
glide copied to clipboard

[ERROR] Unable to export dependencies to vendor directory: Error moving files: exit status 1. output: Access is denied. 0 dir(s) moved.

Open ITSecMedia opened this issue 7 years ago • 36 comments

I've tried it 20 times, current glide doesn't work here no more on Windows 10 x64 I cleared caches, re-opened explorer, killed all handles, removed vendor ....

ITSecMedia avatar Jul 11 '17 07:07 ITSecMedia

[INFO] Replacing existing vendor dependencies ... at that time glide already created a new empty vendor folder ... [ERROR] Unable to export dependencies to vendor directory: Error moving files: exit status 1. output: Access is denied. 0 dir(s) moved.

ITSecMedia avatar Jul 11 '17 07:07 ITSecMedia

In

github.com/Masterminds/glide/path/winbug.go

function "func CustomRename(o, n string) error" replace the following line

cmd := exec.Command("cmd.exe", "/c", "copy", o, n)

to

cmd := exec.Command("robocopy.exe", o, n, "/e")

That solved the problem, at last on my machine.

ITSecMedia avatar Jul 11 '17 09:07 ITSecMedia

func CustomRemoveAll(p string) error {

// Handle the windows case first
if runtime.GOOS == "windows" {
	msg.Debug("Detected Windows. Removing files using windows command")
	cmd := exec.Command("cmd.exe", "/c", fmt.Sprintf("rd /s /q %s", p))
	output, err := cmd.CombinedOutput()
	if err != nil {
		return fmt.Errorf("Error removing files: %s. output: %s", err, output)
	}
} else if detectWsl() {
	cmd := exec.Command("rm", "-rf", p)
	output, err2 := cmd.CombinedOutput()
	msg.Debug("Detected Windows Subsystem for Linux. Removing files using subsystem command")
	if err2 != nil {
		return fmt.Errorf("Error removing files: %s. output: %s", err2, output)
	}
}
return os.RemoveAll(p)

}

gzq0616 avatar Jul 17 '17 10:07 gzq0616

[INFO] --> Adding github.com/parnurzeal/gorequest to your configuration with th e version ^0.2.15 [INFO] Downloading dependencies. Please wait... [INFO] --> Fetching updates for github.com/parnurzeal/gorequest [INFO] Resolving imports [INFO] Downloading dependencies. Please wait... [INFO] --> Detected semantic version. Setting version for github.com/parnurzeal /gorequest to v0.2.15 [INFO] Exporting resolved dependencies... [INFO] --> Exporting github.com/parnurzeal/gorequest [INFO] Replacing existing vendor dependencies [ERROR] Unable to export dependencies to vendor directory: Error moving files: e xit status 1. output:

最新版的glide还是有这个问题 windows环境

wangxfholly avatar Jul 24 '17 07:07 wangxfholly

me too, win10 X64

hcwhan avatar Jul 26 '17 08:07 hcwhan

#889 test pass in windows 7, 10

Ticore avatar Jul 31 '17 07:07 Ticore

Hello, I had the same issue here on win10, I solved it by removing windows UAC (setting it at the lower level - which is not recommanded)

silversurfer34 avatar Aug 04 '17 12:08 silversurfer34

@silversurfer34 check my comment above.

Patch file github.com/Masterminds/glide/path/winbug.go according to the instructions above, recompile Glide and your problem is solved.

ITSecMedia avatar Aug 04 '17 12:08 ITSecMedia

As ITSecMedia said, the good ay to solve the issue is to patch winbug.go file (you can use this https://github.com/Masterminds/glide/pull/889/commits/cc37dc711a3191c2b91b01b9593c685660eeb9af) then recompile it (look at the makefile for the command if you are on windows)

silversurfer34 avatar Aug 19 '17 10:08 silversurfer34

I modified the winbug.go ,and run "go get -u github.com/Masterminds/glide " again,then "glide install" command can works

iuouiyiuty avatar Aug 28 '17 09:08 iuouiyiuty

I meet this problem too. And I replaced glide.exe to old version, it works.I think it is a bug in current version.

slgxmh avatar Sep 06 '17 02:09 slgxmh

Robocopy fix from ITSecMedia above works for me - "I know, why don't we merge that in?", "yeh, good idea, been broken for a couple months, 1 line fix right there"

swiftdv8 avatar Oct 05 '17 12:10 swiftdv8

i replaced glide.exe to 0.12.3, it works

iVincentX avatar Oct 10 '17 03:10 iVincentX

@ITSecMedia Thank you for your solution. but robocopy return 1 when files were copied successfully, and os/exec throw an error which was exit status 1 . .

zyuyou avatar Nov 20 '17 07:11 zyuyou

D:\Work\Golang_Share\bin\glide.exe get github.com/smallnest/rpcx [INFO] Preparing to install 1 package. [INFO] Attempting to get package github.com/smallnest/rpcx [INFO] --> Gathering release information for github.com/smallnest/rpcx [INFO] The package github.com/smallnest/rpcx appears to have Semantic Version releases (http://semver.org). [INFO] The latest release is v3.0-rc2. You are currently not using a release. Would you like [INFO] to use this release? Yes (Y) or No (N) y [INFO] The package github.com/smallnest/rpcx appears to use semantic versions (http://semver.org). [INFO] Would you like to track the latest minor or patch releases (major.minor.patch)? [INFO] The choices are: [INFO] - Tracking minor version releases would use '>= 3.0.0-rc2, < 4.0.0' ('^3.0.0-rc2') [INFO] - Tracking patch version releases would use '>= 3.0.0-rc2, < 3.1.0' ('~3.0.0-rc2') [INFO] - Skip using ranges [INFO] For more information on Glide versions and ranges see https://glide.sh/docs/versions [INFO] Minor (M), Patch (P), or Skip Ranges (S)? m [INFO] --> Adding github.com/smallnest/rpcx to your configuration with the version ^3.0.0-rc2 [INFO] Downloading dependencies. Please wait... [INFO] --> Fetching updates for github.com/smallnest/rpcx [INFO] Resolving imports [INFO] Downloading dependencies. Please wait... [INFO] --> Fetching updates for github.com/Masterminds/semver [INFO] --> Fetching updates for gopkg.in/yaml.v2 [INFO] --> Fetching updates for github.com/codegangsta/cli [INFO] --> Fetching updates for github.com/Masterminds/vcs [INFO] --> Fetching updates for github.com/mitchellh/go-homedir [INFO] --> Detected semantic version. Setting version for github.com/smallnest/rpcx to v3.0 [INFO] Exporting resolved dependencies... [INFO] --> Exporting github.com/smallnest/rpcx [INFO] --> Exporting github.com/codegangsta/cli [INFO] --> Exporting github.com/Masterminds/vcs [INFO] --> Exporting github.com/Masterminds/semver [INFO] --> Exporting github.com/mitchellh/go-homedir [INFO] --> Exporting gopkg.in/yaml.v2 [INFO] Replacing existing vendor dependencies [ERROR] Unable to export dependencies to vendor directory: Error removing files: exit status 123. output: �t�@�C�� ���A�f�B���N�g�����A�܂��̓{�����[�� ���x���̍\�����Ԉ����Ă��܂��B

OS: Windows 10 64bit (1709 16299.64) last ver is error exit, 0.12.3 is worked.

pashifika avatar Nov 21 '17 06:11 pashifika

Checkout 4b407b34822cd21100f0b12f14a00eec21867166 solve this issue.

neither 0.13.1 nor 0.13.2 can work

Victsz avatar Jan 09 '18 13:01 Victsz

D:\GoglandProjects\src\github.com\Eddie-he\watchdog>glide install [INFO] Lock file (glide.lock) does not exist. Performing update. [INFO] Downloading dependencies. Please wait... [INFO] --> Fetching updates for github.com/coreos/etcd [ERROR] Update failed for github.com/coreos/etcd: Unable to retrieve local repo information: exit status 1 [ERROR] Failed to do initial checkout of config: Unable to retrieve local repo information: exit status 1

D:\GoglandProjects\src\github.com\Eddie-he\watchdog>glide --version glide version 0.13.2-dev

The version glide doesn't work.(win7 x86_64)

Eddie-he avatar Jan 25 '18 16:01 Eddie-he

Same issue here.

StarpTech avatar Feb 02 '18 20:02 StarpTech

I had to downgrade to 0.12.3 to solve this issue!

iRbouh avatar Feb 03 '18 01:02 iRbouh

it works with glide.exe 0.12.3 on Windows 7 64Bit

joenali avatar Feb 08 '18 01:02 joenali

Anybody working on this?

StarpTech avatar Feb 15 '18 22:02 StarpTech

0.12.3 worked on win10 64bit 0.13.1 not work.

xiaoxin01 avatar Feb 24 '18 03:02 xiaoxin01

@ITSecMedia In your way, my project, only created vendor file,but Not created .lock file, why?

lbtsm avatar Mar 13 '18 01:03 lbtsm

Same for me 0.12.3 worked on win10 64bit but latest release 0.13.1 did not work

Praveen-Upadhyay avatar Mar 20 '18 05:03 Praveen-Upadhyay

0.12.3 work for me +1

modeyang avatar Mar 26 '18 06:03 modeyang

Windows 10 64-bit.

  • 0.13.1 fail
  • 0.12.3 works!!

andrewlader avatar Apr 07 '18 01:04 andrewlader

@silversurfer34 thanks for your help, I have resolved it

silsuer avatar Apr 08 '18 11:04 silsuer

i have already modify my winbug.go;but still failed. windows 10 64-bit @ ITSecMedia func CustomRename(o, n string) error {

// Handking windows cases first
if runtime.GOOS == "windows" {
	msg.Debug("Detected Windows. Moving files using windows command")
	// cmd := exec.Command("cmd.exe", "/c", "move", o, n)
	cmd := exec.Command("robocopy.exe", o, n, "/e")
	// cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\") //新增这一行代码  
	output, err := cmd.CombinedOutput()
	if err != nil {
		return fmt.Errorf("Error moving files: %s. output: %s", err, output)
	}

	return nil
} else if detectWsl() {
	cmd := exec.Command("mv", o, n)
	output, err2 := cmd.CombinedOutput()
	msg.Debug("Detected Windows Subsystem for Linux. Removing files using subsystem command")
	if err2 != nil {
		return fmt.Errorf("Error moving files: %s. output: %s", err2, output)
	}

	return nil
}

return os.Rename(o, n)

}

[INFO] Loading mirrors from mirrors.yaml file [INFO] Lock file (glide.lock) does not exist. Performing update. [INFO] Loading mirrors from mirrors.yaml file [INFO] Downloading dependencies. Please wait... [INFO] --> Fetching updates for golang.org/x/sys [INFO] --> Fetching updates for github.com/gin-gonic/gin [INFO] --> Detected semantic version. Setting version for github.com/gin-gonic/gin to v1.2 [INFO] Resolving imports [INFO] --> Fetching updates for github.com/gin-contrib/sse [INFO] --> Fetching updates for github.com/mattn/go-isatty [INFO] --> Fetching updates for github.com/golang/protobuf [INFO] --> Fetching updates for github.com/ugorji/go [INFO] --> Fetching updates for gopkg.in/go-playground/validator.v8 [INFO] --> Fetching updates for gopkg.in/yaml.v2 [INFO] Downloading dependencies. Please wait... [INFO] Setting references for remaining imports [INFO] Exporting resolved dependencies... [INFO] --> Exporting github.com/gin-gonic/gin [INFO] --> Exporting golang.org/x/sys [INFO] --> Exporting github.com/gin-contrib/sse [INFO] --> Exporting github.com/mattn/go-isatty [INFO] --> Exporting github.com/golang/protobuf [INFO] --> Exporting github.com/ugorji/go [INFO] --> Exporting gopkg.in/go-playground/validator.v8 [INFO] --> Exporting gopkg.in/yaml.v2 [INFO] Replacing existing vendor dependencies [ERROR] Unable to export dependencies to vendor directory: Error moving files: exit status 1. output:

ROBOCOPY :: Windows �Ŀɿ��ļ�����

��ʼʱ��: 2018��4��10�� 17:37:05 Դ: C:\Users\FENGKO~1\AppData\Local\Temp\glide-vendor945057275\vendor
Ŀ��: D:\myproject\godemo\src\vendor\

  �ļ�: *.*

  ѡ��: *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30

      ��Ŀ¼           0    C:\Users\FENGKO~1\AppData\Local\Temp\glide-vendor945057275\vendor\
      ��Ŀ¼           0    C:\Users\FENGKO~1\AppData\Local\Temp\glide-vendor945057275\vendor\github.com\
      ��Ŀ¼           0    C:\Users\FENGKO~1\AppData\Local\Temp\glide-vendor945057275\vendor\github.com\gin-contrib\
      ��Ŀ¼           8    C:\Users\FENGKO~1\AppData\Local\Temp\glide-vendor945057275\vendor\github.com\gin-contrib\sse\

100% ���ļ� 215 .travis.yml 100% ���ļ� 1112 LICENSE 100% ���ļ� 1802 README.md 100% ���ļ� 3854 sse-decoder.go 100% ���ļ� 2260 sse-decoder_test.go 100% ���ļ� 2366 sse-encoder.go 100% ���ļ� 5477 sse_test.go 100% ���ļ� 419 writer.go ��Ŀ¼ 0 C:\Users\FENGKO~1\AppData\Local\Temp\glide-vendor945057275\vendor\github.com\gin-gonic
��Ŀ¼ 46 C:\Users\FENGKO~1\AppData\Local\Temp\glide-vendor945057275\vendor\github.com\gin-gonic\gin
100% ���ļ� 56 .gitignore 100% ���ļ� 584 .travis.yml

fengkongling avatar Apr 10 '18 09:04 fengkongling

why the modification wasn't merged into master branch?

gosp avatar Apr 26 '18 14:04 gosp

0.12.3 works https://github.com/Masterminds/glide/releases/tag/v0.12.3

wuyanxin avatar Jun 11 '18 08:06 wuyanxin