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_package fails when chocolatey returns 3010 #106

Closed
timbrown5 opened this issue Oct 12, 2016 · 6 comments
Closed

chocolatey_package fails when chocolatey returns 3010 #106

timbrown5 opened this issue Oct 12, 2016 · 6 comments

Comments

@timbrown5
Copy link

When choco install returns a 3010 exit code the chocolatey_package resource fails:

�[0mMixlib::ShellOut::ShellCommandFailed�[0m
------------------------------------�[0m
Expected process to exit with [0], but received '3010'
�[0m---- Begin output of C:\ProgramData\chocolatey/bin/choco.exe upgrade -y -version 3.60.0.2 -source //buildserver/ChocolateStore,http://choco-server:8081/nexus/service/local/nuget/choco-sn-dev/ psp2-tmserver ----
�[0mSTDOUT: Parsing -version resulted in exception:
�[0m Cannot bundle unregistered option '-e'.
�[0mChocolatey v0.10.0
�[0mUpgrading the following packages:
�[0mpsp2-tmserver
�[0mBy upgrading you accept licenses for the packages.
�[0mpsp2-tmserver is not installed. Installing...
�[0m
�[0mpsp2-tmserver v3.60.0.2
�[0mDownloading psp2-tmserver
�[0m from 'http://43.193.248.183/ngpdata/Buildarea/PSP2/TMServer/ProDG_PSP2_SDK3600/3.60.0.2/TMServer-3_60_0_2.msi'
�[0mProgress: 6% - Saving 560.67 KB of 7.88 MB (574125/8265728)Progress: 13% - Saving 1.07 MB of 7.88 MB (1121037/8265728)Progress: 20% - Saving 1.58 MB of 7.88 MB (1656857/8265728)Progress: 27% - Saving 2.15 MB of 7.88 MB (2249457/8265728)Progress: 31% - Saving 2.49 MB of 7.88 MB (2605857/8265728)Progress: 37% - Saving 2.99 MB of 7.88 MB (3130781/8265728)Progress: 44% - Saving 3.54 MB of 7.88 MB (3711077/8265728)Progress: 51% - Saving 4.03 MB of 7.88 MB (4229965/8265728)Progress: 55% - Saving 4.4 MB of 7.88 MB (4617737/8265728)Progress: 63% - Saving 5 MB of 7.88 MB (5239697/8265728)Progress: 69% - Saving 5.45 MB of 7.88 MB (5715657/8265728)Progress: 78% - Saving 6.16 MB of 7.88 MB (6459189/8265728)Progress: 82% - Saving 6.53 MB of 7.88 MB (6850077/8265728)Progress: 92% - Saving 7.29 MB of 7.88 MB (7648377/8265728)Progress: 99% - Saving 7.8 MB of 7.88 MB (8183253/8265728)Progress: 100% - Completed download of C:\Users\admin\AppData\Local\Temp\chocolatey\psp2-tmserver\3.60.0.2\TMServer-3_60_0_2.msi (7.88 MB).
�[0mDownload of TMServer-3_60_0_2.msi (7.88 MB) completed.
�[0mHashes match.
�[0mInstalling psp2-tmserver...
�[0mpsp2-tmserver has been installed.
�[0m The upgrade of psp2-tmserver was successful.
�[0m Software installed as 'msi', install location is likely default.
�[0m
�[0mChocolatey upgraded 1/1 packages. 0 packages failed.
�[0m See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
�[0m
�[0mPackages requiring reboot:
�[0m - psp2-tmserver (exit code 3010)
�[0m
�[0mThe recent package changes indicate a reboot is necessary.
�[0m Please reboot at your earliest convenience.
�[0mSTDERR:
�[0m---- End output of C:\ProgramData\chocolatey/bin/choco.exe upgrade -y -version 3.60.0.2 -source //buildserver/ChocolateStore,http://choco-server:8081/nexus/service/local/nuget/choco-sn-dev/ psp2-tmserver ----
�[0mRan C:\ProgramData\chocolatey/bin/choco.exe upgrade -y -version 3.60.0.2 -source //buildserver/ChocolateStore,http://choco-server:8081/nexus/service/local/nuget/choco-sn-dev/ psp2-tmserver returned 3010�[0m

This return code is not an error, just a message to reboot to finish install:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa376931(v=vs.85).aspx

It would be nice to be able to supply a list of acceptable return codes for the chocolatey_package command, like the batch command:
https://docs.chef.io/resource_batch.html

Note: I know these packages require a reboot, so I reboot after the chef run if these packages change anyway.

@timbrown5 timbrown5 changed the title chocolatey_package fails when chocolatey returns 301o chocolatey_package fails when chocolatey returns 3010 Oct 12, 2016
@ferventcoder
Copy link
Contributor

This is chocolatey/choco#512, first present in 0.9.10. Note the changelog we talk extensively about this - https://github.com/chocolatey/choco/blob/master/CHANGELOG.md#0910-june-17-2016.

Also we filed tickets with all of the major infra automation tools and this was the one for Chef - chef/chef#5030

@ferventcoder
Copy link
Contributor

@mwrock can provably comment on whether there is a workaround with the cookbook or if it is with the built-in Chocolatey Chef resource only.

@timbrown5
Copy link
Author

Thanks @ferventcoder . I am using the workaround in chef/chef#5030 but thought I should raise a bug here.
I'm not sure of how the work/code is shared between this cookbook and the chef core chocolatey_package cookbook, but from what I've seen we use the resource from this cookbook, not the core. If this cookbook is deprecated, or is just a clone of the core chocolatey_package resource then feel free to close this bug.
Thanks,
Tim

@ferventcoder
Copy link
Contributor

I know the install of Chocolatey is still handled through this cookbook.

@ferventcoder
Copy link
Contributor

So not completely deprecated. But @mwrock can probably give more insight.

@mwrock
Copy link
Contributor

mwrock commented Oct 14, 2016

My apologies for the delay in getting back here. @ferventcoder is right that this cookbook is primarily used only to install chocolatey itself. On modern versions of Chef, it is now best to use the chocolatey_package resource in core chef.

@mwrock mwrock closed this as completed Oct 14, 2016
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

3 participants