Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 7 permission denied #60

Closed
pearcec opened this issue May 21, 2014 · 17 comments
Closed

Windows 7 permission denied #60

pearcec opened this issue May 21, 2014 · 17 comments
Milestone

Comments

@pearcec
Copy link

pearcec commented May 21, 2014

Get the following error during provisioning pe_bootstrap for role master. Anyone have any thoughts?

ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #
ERROR vagrant: An error occurred while trying to download the given resource (ht
tp://localhostm/repos/Puppet//puppet-enterprise-3.1.0-el-6-x86_64
.tar.gz),
and the transfer could not complete. The error message generated was "Permission
 denied - (C:/Users/pearcec/AppData/Local/Temp/open-uri20140520-5004-1hx7fqn, C
:/Users/pearcec/.vagrant.d/pe_builds/puppet-enterprise-3.1.0-el-6-x86_64.tar.gz
)".
ERROR vagrant: C:/Users/pearcec/.vagrant.d/gems/gems/vagrant-pe_build-0.8.7/lib
/pe_build/transfer/open_uri.rb:29:in `rescue in copy'
 INFO interface: error: An error occurred while trying to download the given res
ource (http://localhost/repos/Puppet//puppet-enterprise-3.1.0-el
-6-x86_64.tar.gz),
and the transfer could not complete. The error message generated was "Permission
 denied - (C:/Users/pearcec/AppData/Local/Temp/open-uri20140520-5004-1hx7fqn, C
:/Users/pearcec/.vagrant.d/pe_builds/puppet-enterprise-3.1.0-el-6-x86_64.tar.gz
)".
An error occurred while trying to download the given resource (http://localhost/repos/Puppet//puppet-enterprise-3.1.0-el-6-x86_64.tar.gz),
and the transfer could not complete. The error message generated was "Permission
 denied - (C:/Users/pearcec/AppData/Local/Temp/open-uri20140520-5004-1hx7fqn, C
:/Users/pearcec/.vagrant.d/pe_builds/puppet-enterprise-3.1.0-el-6-x86_64.tar.gz
)".
 INFO interface: Machine: error-exit ["PEBuild::Transfer::OpenURI::DownloadFaile
d", "An error occurred while trying to download the given resource (http://localhost/repos/Puppet//puppet-enterprise-3.1.0-el-6-x86_64.tar.gz),\
nand the transfer could not complete. The error message generated was \"Permissi
on denied - (C:/Users/pearcec/AppData/Local/Temp/open-uri20140520-5004-1hx7fqn,
 C:/Users/pearcec/.vagrant.d/pe_builds/puppet-enterprise-3.1.0-el-6-x86_64.tar.
gz)\"."]
@adrienthebo
Copy link
Member

What happens when you try to create a file by hand in C:/Users/pearcec/.vagrant.d/pe_builds/ ?

@pearcec
Copy link
Author

pearcec commented May 21, 2014

Yea I tried that. It created just fine.

On Wed, May 21, 2014 at 11:29 AM, Adrien Thebo notifications@github.comwrote:

What happens when you try to create a file by hand in
C:/Users/pearcec/.vagrant.d/pe_builds/ ?

Reply to this email directly or view it on GitHubhttps://github.com//issues/60#issuecomment-43770906
.

Christian

@adrienthebo
Copy link
Member

Has pe_build ever worked? Is there anything nonstandard about how your home directory is set up?

@pearcec
Copy link
Author

pearcec commented May 22, 2014

Works great for me on Linux. Never got it working on Windows. Nothing as
far as I no being non standard. I am encourage the windows users among me
to give it a shot.

On Thu, May 22, 2014 at 12:49 PM, Adrien Thebo notifications@github.comwrote:

Has pe_build ever worked? Is there anything nonstandard about how your
home directory is set up?

Reply to this email directly or view it on GitHubhttps://github.com//issues/60#issuecomment-43914174
.

Christian

@prolixalias
Copy link

Hi. Same issue here on multiple Windows hosts. Works on my Linux and OSX machines. Customer needs to use their Windows machines though. Please let me know what I can do to assist in diagnosing?

@ferventcoder
Copy link

Can we get some Debugging information please?

Vagrant version along with installed plugins followed by a debug output (preferably in a gist we can refer to for the full one with just the area surrounding the issue pasted here). For details on setting log level of vagrant, see http://docs.vagrantup.com/v2/other/debugging.html

@prolixalias
Copy link

Hey there Rob. Thanks! Info below:

$ vagrant --version
Vagrant 1.5.1
$ vagrant plugin list
vagrant-auto_network (1.0.1)
vagrant-hosts (2.1.5)
vagrant-pe_build (0.8.8)
oscar (0.4.1)
vagrant-login (1.0.1, system)
vagrant-share (1.1.0, system)
$ 2>../debug.txt 1>&2 VAGRANT_LOG=debug vagrant up master

relevant piece:

c:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.1/lib/vagrant/batch_action.rb:72:in `block (2 levels) in run'
 INFO interface: error: An error occurred while trying to download the given resource (http://s3.amazonaws.com/pe-builds/released/3.1.0/puppet-enterprise-3.1.0-ubuntu-12.04-amd64.tar.gz),
and the transfer could not complete. The error message generated was "Permission denied - (C:/Users/AD1C02~1.PAU/AppData/Local/Temp/open-uri20140623-6564-1xvj4bv, C:/Users/ad.paultalbot/.vagrant.d/pe_builds/puppet-enterprise-3.1.0-ubuntu-12.04-amd64.tar.gz)".
An error occurred while trying to download the given resource (http://s3.amazonaws.com/pe-builds/released/3.1.0/puppet-enterprise-3.1.0-ubuntu-12.04-amd64.tar.gz),
and the transfer could not complete. The error message generated was "Permission denied - (C:/Users/AD1C02~1.PAU/AppData/Local/Temp/open-uri20140623-6564-1xvj4bv, C:/Users/ad.paultalbot/.vagrant.d/pe_builds/puppet-enterprise-3.1.0-ubuntu-12.04-amd64.tar.gz)".
 INFO interface: Machine: error-exit ["PEBuild::Transfer::OpenURI::DownloadFailed", "An error occurred while trying to download the given resource (http://s3.amazonaws.com/pe-builds/released/3.1.0/puppet-enterprise-3.1.0-ubuntu-12.04-amd64.tar.gz),\nand the transfer could not complete. The error message generated was \"Permission denied - (C:/Users/AD1C02~1.PAU/AppData/Local/Temp/open-uri20140623-6564-1xvj4bv, C:/Users/ad.paultalbot/.vagrant.d/pe_builds/puppet-enterprise-3.1.0-ubuntu-12.04-amd64.tar.gz)\"."]

Full gist located here:
https://gist.github.com/b7924c7addce3c29d46a.git

It appears to me AppData path is getting mangled along the way. Not sure where it's getting "AD1C02~1" value from.

@prolixalias
Copy link

UPDATE: I now know where the string came from... Seems valid. Maybe it could be written to $TEMP instead?

C:\Users>dir /x
Volume in drive C is OSDisk
Volume Serial Number is 3C23-C191

Directory of C:\Users

06/10/2014 03:40 PM

.
06/10/2014 03:40 PM ..
06/10/2014 03:20 PM AD61471.JAS ad.jasinger
06/17/2014 04:08 PM AD1C021.PAU ad.paultalbot
12/17/2013 04:12 PM Administrator
12/17/2013 03:24 PM ADMINI1
02/05/2014 02:34 PM FS_WIN1 FS_WIN7_JOIN
06/10/2014 03:25 PM jasinger
06/23/2014 04:09 PM PAULTA~1 paultalbot
12/17/2013 03:52 PM Public
02/05/2014 02:33 PM rrudat
0 File(s) 0 bytes
11 Dir(s) 240,036,208,640 bytes free

C:\Users>

@prolixalias
Copy link

I hate to pester you guys... But I'm dead in the water. Any ideas come out of what I'd submitted?

@adrienthebo
Copy link
Member

This issue looks like it's due to Windows locking open files. After the file is downloaded it is handed to FileUtils.mv(https://github.com/adrienthebo/vagrant-pe_build/blob/master/lib/pe_build/transfer/open_uri.rb#L25-L26) and the code assumes that the object returned can be moved. However the returned tempfile looks like it is left open and the subsequent .mv call fails.

Are you able to test running vagrant-pe_build from source to test a potential fix?

In the mean time, you can work around this issue by downloading them yourself and placing them into ENV['VAGRANT_HOME']/pe_builds; if you don't have to download the installers then the code in question won't be invoked.

@prolixalias
Copy link

Hello, thanks for the workaround. It got me past that step. Can certainly try to run from source too if that's useful on your end. Encountered an error on the next step. Will use another "issue" to describe. In the meantime, if you don't mind instructing me on running from source I'll get on it right away.

@liger1978
Copy link

Still an issue on Windows. How about using FileUtils.cp and FileUtils.rm (with a warning if the latter fails) instead of FileUtils.mv at: https://github.com/adrienthebo/vagrant-pe_build/blob/master/lib/pe_build/transfer/open_uri.rb#L25-L26 ?

@Sharpie
Copy link
Member

Sharpie commented Oct 18, 2015

I haven't hit this personally, since I don't use Windows as my primary environment, but I've seen the issue happen at least once. Optimistically marking this to be fixed in the next release since it sounds like we just need to adjust how archives are created and moved.

@Sharpie Sharpie added this to the 0.14.0 milestone Oct 18, 2015
@DrmCtchr
Copy link

DrmCtchr commented Dec 8, 2015

has this been addressed? and if so how can I get that code? I don't want to have to add work around steps for all my users. thanks in advance, D

@Sharpie
Copy link
Member

Sharpie commented Dec 12, 2015

There haven't been any fixes submitted for this yet. I'm planning to do a "Windows bug bash" release focused on Windows fixes once I get done shoring up support for PE 2015.x agent installation.

If anyone wants to submit a PR to fix this issue, I'd be happy to review it!

@Sharpie
Copy link
Member

Sharpie commented Dec 16, 2015

Built a VM turducken yesterday (Vagrant inside of Windows inside of Vagrant inside of OS X) during #puppethack and tested a fix for this. It will go out in a patch release this week.

@Sharpie Sharpie modified the milestones: 0.13.6, 0.14.0 Dec 16, 2015
@Sharpie
Copy link
Member

Sharpie commented Dec 17, 2015

Version 0.13.6 has been shipped and includes this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants