-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Vagrant 1.8.4 and Win10 - shell provisioner error: "but stderr present" #7476
Comments
Since this issue does not happen with a boxcutter/windows10 box, I'm assuming it's an issue with the box we are using. If the shell provisioners are removed from the Vagrantfile,
|
I have the same problem with Windows Server 2016 TP5, worked fine with Vagrant 1.8.1. BTW: The Ruby winrm-fs gem is already at 0.4.3 |
Editing the
and changing all three places
by removing the tilde with
and then
It installs winrm-fs 0.4.3. After that a |
Hi there, I am going to strongly discourage manually editing the contents in |
I totally understand that is at my own risk, so I have to downgrade to 1.8.1 and will be very cautious making the next update. |
@gtirloni I would guess the boxcutter Windows 10 box you are using might not have the same Windows Updates applied that newer custom boxes have that could be causing this issue. I am running into this same failure after installing Boxstarter/Chocolatey/PowerShell 5. I'm not sure if it's simply PowerShell 5, since I can use Boxstarter/Chocolatey without to install other packages and it is fine, or if it is the combination of all of them. |
Weird that this seems to be a regression since #6060 was fixed. |
The issue is present on a box built using the Win10 Anniversary Update. Tested with: Windows 10 (AU) host |
@gtirloni This is not resolved. Upgrading winrm-fs to 0.4.3 seemed to fix it but this didn't last for long. I have a Windows 10 box that fails to vagrant up every time with the Remove-Item error you mentioned. |
I am starting to suspect that this is somehow related to the size of the Powershell script being uploaded. I added a function to check_files.ps1.erb to find which process is locking the file that Remove-Item is trying to remove. This initially produced an error "The command line is too long (powershell script is too long)". I then removed some unnecessary code and whitespace from the function. Now the bug has gone way, even though the script is still longer than it originally was. |
And if I understand correctly typically the win RM is just passing a base64 I've actually seen it where poorly coded interpreters can handle extremely Can you post what the win RM max memory per threads and Max threads are On Sep 22, 2016 6:58 AM, "MarkSummers" [email protected] wrote:
|
Max threads: 25 If I make the slightest change to the code in check_files.ps1.erb then the problem goes away (even if I add code, which would surely aggravate the "command line too long" issue). So, I have to conclude that this is a race condition and I am affecting the timing by adding or removing code. |
I patched the relevant section of check_files.ps1.erb as follows...
The purpose of this was to try to discover the identity of the process with a handle on the file we are trying to remove (by using the Handle utility from Sysinternals). We have a suspect...
This is a Windows Defender process. Evidently, it does not quite finish scanning in time before winrm-fs attempts to Remove-Item. |
I seem to have worked around the issue by running the following Powershell command to prevent scanning of files in the temp directory:
|
I ran into this immediately after upgrading the guest OS' Windows Management Framework to 5.0 (Powershell 5.0). The guest is a Windows Server 2012 R2 machine. I can reliably reproduce this. Start with a Windows Server 2012 R2 box with PS 4.0. Provisioning files should work. Upgrade to PS 5.0, it will start breaking with the error: In the very short term, I can work around this by not installing PS 5.0 just yet into the guest OS. |
The cases where I've seen this are if something creates the Powershell On Oct 14, 2016 1:47 PM, "Giovanni Tirloni" [email protected]
|
Hi there, It looks like this has been resolved within a previously shipped version of Vagrant so I am now closing this issue. If the original issue was not fully resolved, please reopen this issue or create a new one. Cheers! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Vagrant version
1.8.4
Host operating system
Fedora 22 x86_64
Guest operating system
Windows 10 64-bit
Vagrantfile
Debug output
https://gist.github.com/gtirloni/24791d9de1a1da4b782f0ff30e5eeaf1
Expected behavior
vagrant up run the shell provisioner without errors (upload script and executes)
Actual behavior
A box created on 5/28 was working fine with Vagrant 1.8.1 and 1.8.4 but it seems something may have changed with recent Windows 10 updates that it now fails with Vagrant 1.8.4 (not tested with 1.8.1).
When trying to run the shell provisioner, WinRM will upload the file but complain that the stderr stream contains data, even though the exit code was 0.
Steps to reproduce
Workaround
The error is actually triggered in winrm-fs (file_transporter.rb). If lines 396-398 are commented, vagrant works as expected and fully provisions the box as expected.
This is the output with the workaround in place:
https://gist.github.com/gtirloni/24791d9de1a1da4b782f0ff30e5eeaf1
The file that was edited was: /opt/vagrant/embedded/gems/gems/winrm-fs-0.3.2/lib/winrm-fs/core/file_transporter.rb
References
Submitting this against Vagrant even though it might be an issue in winrm-fs or the win10 because 1) Vagrant is not using the latest winrm-fs version which may not have this issue and 2) the win10 has not had any changes to its packer configuration besides re-running it to create a new box a month later since the old box had been created.
We're trying to understand what may have changed in Win10 that is causing this to fail though. It seems stderr shouldn't have some data that it now has.
The text was updated successfully, but these errors were encountered: