Masterminds / glide

Package Management for Golang
https://glide.sh
Other
8.15k stars 541 forks source link

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

Open ITSecMedia opened 7 years ago

ITSecMedia commented 7 years ago

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 commented 7 years ago

[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 commented 7 years ago

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.

gzq0616 commented 7 years ago

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)

}

wangxfholly commented 7 years ago

[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环境

hcwhan commented 7 years ago

me too, win10 X64

Ticore commented 7 years ago

889 test pass in windows 7, 10

silversurfer34 commented 7 years ago

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)

ITSecMedia commented 7 years ago

@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.

silversurfer34 commented 7 years ago

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)

iuouiyiuty commented 7 years ago

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

slgxmh commented 7 years ago

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

swiftdv8 commented 7 years ago

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"

iVincentX commented 6 years ago

i replaced glide.exe to 0.12.3, it works

zyuyou commented 6 years ago

@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 . .

pashifika commented 6 years ago

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.

Victsz commented 6 years ago

Checkout 4b407b34822cd21100f0b12f14a00eec21867166 solve this issue.

neither 0.13.1 nor 0.13.2 can work

Eddie-he commented 6 years ago

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)

StarpTech commented 6 years ago

Same issue here.

iRbouh commented 6 years ago

I had to downgrade to 0.12.3 to solve this issue!

joenali commented 6 years ago

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

StarpTech commented 6 years ago

Anybody working on this?

xiaoxin01 commented 6 years ago

0.12.3 worked on win10 64bit 0.13.1 not work.

lbtsm commented 6 years ago

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

Praveen-Upadhyay commented 6 years ago

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

modeyang commented 6 years ago

0.12.3 work for me +1

andrewlader commented 6 years ago

Windows 10 64-bit.

silsuer commented 6 years ago

@silversurfer34 thanks for your help, I have resolved it

fengkongling commented 6 years ago

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

gosp commented 6 years ago

why the modification wasn't merged into master branch?

wuyanxin commented 6 years ago

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

itowlson commented 6 years ago

...but seems like 0.13.1 doesn't - I see the same error there.

mei-rune commented 6 years ago

me too on the windows7 and windows10 glide version v0.13.1

kedare commented 6 years ago

Same issue, at the end I just migrated the project do dep to unblock it (a simple dep init imports everything from glide)

vincent-awen commented 5 years ago

the same issue on windows7 and glide v0.13.2-dev

Leonid-Ostapenko commented 4 years ago

I have the same issue on v0.13.3

tudousiZzz commented 3 years ago

Why not update to the warehouse? I encountered this problem again in 2021