-
Notifications
You must be signed in to change notification settings - Fork 905
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 + choco install often aborts with Process is terminated due to StackOverflowException. #277
Comments
.NET 3.5 checks a registry setting and then it's done. If it is already installed. This is quite interesting. I want to get to the bottom of this issue. Can you run some more tests, this time with the addition of |
https://github.com/StefanScherer/esxi-playground/blob/esxi60/scripts/provision.ps1#L5 will likely fail, try removing the package name from the source. It's issue #90. |
OK, next try. I used this script: iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -dv -y dotnet3.5
# choco install -y vmwarevsphereclient -version 5.5.0.1993072
choco install -dv -y -source c:\vagrant\chocolatey\vmwarevsphereclient.6.0.0.nupkg
choco install -dv -y vagrant
# plugin from github.com/frankus0512/vagrant-esxi branch newfeatures
vagrant plugin install c:\vagrant\plugins\vagrant-esxi-0.1.1.gem
# Download vagrant SSH key to login to ESXi server
New-Item -Path "C:\Users\vagrant\.ssh" -ItemType Directory
(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\id_rsa.pub')
(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant', 'C:\Users\vagrant\.ssh\id_rsa') Just after spinnig up the VM I have read #90 and saw that I got line 5 wrong, so this how I have to change the line 5. But the next
I'll destroy the VM, fix line 5 and retry again. |
Next run, now with this schtasks /End /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
schtasks /Change /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" /DISABLE
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -dv -y dotnet3.5
# choco install -y vmwarevsphereclient -version 5.5.0.1993072
cmd /C choco install -dv -y vmwarevsphereclient -version 6.0.0 -source c:\vagrant\chocolatey
choco install -dv -y vagrant
# plugin from github.com/frankus0512/vagrant-esxi branch newfeatures
vagrant plugin install c:\vagrant\plugins\vagrant-esxi-0.1.1.gem
# Download vagrant SSH key to login to ESXi server
New-Item -Path "C:\Users\vagrant\.ssh" -ItemType Directory
(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\id_rsa.pub')
(New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant', 'C:\Users\vagrant\.ssh\id_rsa') And the corresponding output. This time the first StackOverflowException occurs while 'installing' the dotnet3.5 package:
I can see four error logs in the Event Viewer
Is there more I can investigate? |
Strange. Spinning up the same provisioning script with a VirtualBox VM ( My test environment:
|
These look like powershell issues.
It might be helpful to see the color output here. Or the underlying choco log. |
#275 was a similar powershell issue, but related to virtualbox and shared folders. |
Try running a powershell command outside of choco against the box. |
==> win7: Microsoft .Net 3.5 Framework is already installed on your machine.
==> win7: Process is terminated due to StackOverflowException.
==> win7: Command ['"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[...]"] exited with '-2147023895' Note that PowerShell is exiting with |
Speeding up my test loop with
and then
Much faster 😄 The StackOverflowException is not always at dotnet3.5 installation, but then in one or more of the next choco install commands. Then I tried the clean snapshot and opened a PowerShell window on the Windows desktop and then entered So it might have to do with the remote WinRM provisioning of Vagrant that gives choco.exe a different environment/stack size/allowed window handles/... |
@StefanScherer I see this is with
I think the event viewer errors are leading towards a debugger wanting to attach to the Powershell process. |
Good point, what are your winrm settings? |
It's possible something about the powershell run is swallowing up memory and eventually causes an error. Or that powershell is trying to run powershell is trying to run powershell... and stackoverflow. No idea if or why that is happening yet. |
@ferventcoder The winrm settings are here in the basebox Autounattend.xml: https://github.com/StefanScherer/packer-windows/blob/my/answer_files/7/Autounattend.xml#L123-L197 I'll spin up the VM with 2GB RAM and see what it is doing then. |
https://github.com/StefanScherer/packer-windows/blob/my/answer_files/7/Autounattend.xml#L141-L142 - so 300MB max memory per shell. I wonder how much of that is used up by vagrant, scheduled tasks, etc and what is left for choco and powershell to use. |
OK. I'll increase this
and then from my host machine:
Now it works! OK. Thank you very much! I think I have to create a PR in joefitzgerald/packer-windows repo 😄 Is there a more reasonable value for MaxMemoryPerShellMB? |
The boxcutter/windows repo has 800MB: https://github.com/boxcutter/windows/blob/master/floppy/install-winrm.cmd#L55 I'll increase it to this value and recreate my baseboxes and create a PR. Thanks @ferventcoder. Can't wait to get my T-Shirt 👕 😄 |
👍 |
In the last few days I encounter a problem provisioning Windows Vagrant boxes with Chocolatey 0.9.9.5.
I have increased the memory of the VM from 768M to 1GB but still there are often errors. Sometimes it works, and sometimes it shows the issue.
The Vagrantfile I use normally uses a PowerShell Script ( provision.ps1 ) for provisioning.
Here is the output of the
vagrant up
running on a Mac with Fusion 7, the first StackOverflowException occurs installing the already installed DotNet 3.5. This worked fine for the last ten builds.The Windows basebox is built from the packer-windows repo with all Windows Updates and DotNet 4 already installed.
Is there anything I can fix in the basebox configuration to increase some resources for
choco.exe
or is there an issue in choco.exe itself?The text was updated successfully, but these errors were encountered: