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

Chocolatey Fails to Install on win7_32_analyst Profile: Error installing .NET Framework 4.0 #31

Closed
Corb3nik opened this issue Feb 19, 2017 · 9 comments
Labels

Comments

@Corb3nik
Copy link

Corb3nik commented Feb 19, 2017

Running malboxes build win7_32_analyst fails during the installation of .NET Framework 4.0. Here are the relevant logs :

==> virtualbox-iso: Provisioning with shell script: /usr/local/lib/python3.5/site-packages/malboxes/scripts/windows/installtools.ps1
    virtualbox-iso:
    virtualbox-iso: Mode                LastWriteTime     Length Name
    virtualbox-iso: ----                -------------     ------ ----
    virtualbox-iso: d----         2/18/2017   5:52 PM            chocInstall
    virtualbox-iso: Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework i
    virtualbox-iso: nstalled. If you see underlying connection closed or trust errors, you may need
    virtualbox-iso: to do one or more of the following: (1) upgrade to .NET Framework 4.5+ and Pow
    virtualbox-iso: erShell v3, (2) specify internal Chocolatey package location (set $env:chocolat
    virtualbox-iso: eyDownloadUrl prior to install or host the package internally), (3) use the Dow
    virtualbox-iso: nload + PowerShell method of install. See https://chocolatey.org/install for al
    virtualbox-iso: l install options.
    virtualbox-iso: Getting latest version of the Chocolatey package for download.
    virtualbox-iso: Getting Chocolatey from https://chocolatey.org/api/v2/package/chocolatey/0.10.3
    virtualbox-iso: .
    virtualbox-iso: Downloading 7-Zip commandline tool prior to extraction.
    virtualbox-iso: Extracting C:\Users\malboxes\AppData\Local\Temp\chocolatey\chocInstall\chocolat
    virtualbox-iso: ey.zip to C:\Users\malboxes\AppData\Local\Temp\chocolatey\chocInstall...
    virtualbox-iso: Installing chocolatey on this machine
    virtualbox-iso: Creating ChocolateyInstall as an environment variable (targeting 'Machine')
    virtualbox-iso: Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
    virtualbox-iso: WARNING: It's very likely you will need to close and reopen your shell
    virtualbox-iso: before you can use choco.
    virtualbox-iso: Restricting write permissions to Administrators
    virtualbox-iso: We are setting up the Chocolatey package repository.
    virtualbox-iso: The packages themselves go to 'C:\ProgramData\chocolatey\lib'
    virtualbox-iso: (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).
    virtualbox-iso: A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'
    virtualbox-iso: and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName
    virtualbox-iso: '.
    virtualbox-iso:
    virtualbox-iso: Creating Chocolatey folders if they do not already exist.
    virtualbox-iso:
    virtualbox-iso: WARNING: You can safely ignore errors related to missing log files when
    virtualbox-iso: upgrading from a version of Chocolatey less than 0.9.9.
    virtualbox-iso: 'Batch file could not be found' is also safe to ignore.
    virtualbox-iso: 'The system cannot find the file specified' - also safe.
    virtualbox-iso: chocolatey.nupkg file not installed in lib.
    virtualbox-iso: Attempting to locate it from bootstrapper.
    virtualbox-iso: PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
    virtualbox-iso: WARNING: Not setting tab completion: Profile file does not exist at
    virtualbox-iso: 'C:\Users\malboxes\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
    virtualbox-iso: '.
    virtualbox-iso: 'C:\Windows\Microsoft.Net\Framework\v4.0.30319' was not found or this is forced
    virtualbox-iso: Downloading 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC
    virtualbox-iso: 36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe' to 'C:\Users\malboxes\AppData\Loca
    virtualbox-iso: l\Temp\dotNetFx40_Full_x86_x64.exe' - the installer is 40+ MBs, so this could t
    virtualbox-iso: ake a while on a slow connection.
    virtualbox-iso: Installing 'C:\Users\malboxes\AppData\Local\Temp\dotNetFx40_Full_x86_x64.exe' -
    virtualbox-iso: this may take awhile with no output.
    virtualbox-iso: WARNING: Try #1 of .NET framework install failed with exit code '16389'. Trying again.
    virtualbox-iso: 'C:\Windows\Microsoft.Net\Framework\v4.0.30319' was not found or this is forced
    virtualbox-iso: Error installing .NET Framework 4.0 (exit code 16389).
    virtualbox-iso: Please install the .NET Framework 4.0 manually and then try to install Chocola
    virtualbox-iso: tey again.
    virtualbox-iso: Installing 'C:\Users\malboxes\AppData\Local\Temp\dotNetFx40_Full_x86_x64.exe' -
    virtualbox-iso: this may take awhile with no output.
    virtualbox-iso: ERROR: .NET Framework install failed with exit code '16389'.
    virtualbox-iso: This will cause the rest of the install to fail.
    virtualbox-iso: Download at 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-B
    virtualbox-iso: C36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe'
    virtualbox-iso: At C:\Users\malboxes\AppData\Local\Temp\chocolatey\chocInstall\tools\chocolatey
    virtualbox-iso: setup.psm1:688 char:14
    virtualbox-iso: +         throw <<<<  "Error installing .NET Framework 4.0 (exit code $($s.Exit
    virtualbox-iso: Code)). `n Please install the .NET Framework 4.0 manually and then try to insta
    virtualbox-iso: ll Chocolatey again. `n Download at `'$NetFx4Url`'"
    virtualbox-iso: + CategoryInfo          : OperationStopped: (Error installin...ll_x86_x64.
    virtualbox-iso: exe':String) [], RuntimeException
    virtualbox-iso: + FullyQualifiedErrorId : Error installing .NET Framework 4.0 (exit code 1
    virtualbox-iso: 6389).
    virtualbox-iso: Please install the .NET Framework 4.0 manually and then try to install Ch
    virtualbox-iso: ocolatey again.
    virtualbox-iso: Download at 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4
    virtualbox-iso: AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe'
    virtualbox-iso:
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Script exited with non-zero exit status: 1. Allowed exit codes are: [0]
  • Platform : OSX 10.12.3
  • Malboxes : malboxes 0.2.0dev
  • PSVersion : 2.0
@obilodeau obilodeau changed the title Chocolatey Installation Fails for win7_32_analyst Profile Chocolatey Fails to Install on win7_32_analyst Profile: Error installing .NET Framework 4.0 Feb 19, 2017
@obilodeau
Copy link
Member

Running a build, trying to reproduce the issue.

@Svieg
Copy link
Collaborator

Svieg commented Feb 19, 2017

As I spoke privately with @Corb3nik , can you check the powershell version?

@Corb3nik
Copy link
Author

@Svieg I've edited the original post with the Powershell version.

@obilodeau
Copy link
Member

obilodeau commented Feb 19, 2017

Right now I have a different problem...

vboxvnc - tigervnc_043

Update: Turns out it was a problem with my license key

@obilodeau
Copy link
Member

I was able to reproduce on my arch desktop. I think chocolatey's requirements changed (requires dotNet 4.0+) and their installer pulls in the x64 binary instead of the x86 one. Found no solid reference so far but at least I can reproduce.

@obilodeau
Copy link
Member

Download arch is not the issue. See https://www.microsoft.com/en-ca/download/details.aspx?id=17718.

I'm not able to reproduce using a vanilla profile:

malboxestest vanilla running - oracle vm virtualbox_044

Maybe it was a transient error from Microsoft's side. Trying again with the analyst profile.

Maybe we can avoid the issue altogether by installing chocolatey differently.

@obilodeau
Copy link
Member

Bug is still reproducible.

Added -on-error=abort to packer and tried running the same installer as downloaded and it worked on the first time (w/o even a reboot). The way chocolatey calls the dotNet installer seems problematic.

I'll try re-issuing the chocolatey installer instead of installing dotNet directly tomorrow.

@obilodeau obilodeau added the bug label Feb 20, 2017
@obilodeau
Copy link
Member

Calling chocolatey installer by hand after the build failure (in debug mode) does work:

packer-virtualbox-iso-1487602498 running - oracle vm virtualbox_045

So this doesn't seem to be chocolatey's fault but an integration problem...

@obilodeau
Copy link
Member

Was able to reproduce using WinRM directly (through pywinrm): https://gist.github.com/obilodeau/833e439d54efc458610ab578570260cc

For some reason, the max memory for powershell is not changed (even though I tried setting a higher value) and this is why it seems to fail.

Related: joefitzgerald/packer-windows#122

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

No branches or pull requests

3 participants