-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
win_chocolatey fails to deploy packages #27155
Comments
It looks like it is failing because the installers are exiting with a non-zero exit code (hence the "rc": -2147418113 for officeproplus2013 and "rc": 5 for sql-server-management-studio Its worth using search engines to see why these packages might return these non-zero exit codes. I have encounted '5' as an exit code before and in my case it was because a dependency on a visual studio c++ runtime was not present. In my case the VS runtime required a hotfix to be installed (this may have now been rolled up so perhaps not needed), but I will share the tasks needed to install the hotfix and runtime below in case it is relevant. It is a very vague error message though 5 means 'Access is denied' but doesn't tell you anything specific about what exactly has failed. I don't use chocolately myself but worth checking if it logs any further information on the affected host, and worth checking the event log too. |
Here's the hotfix and VC runtime installation steps. - name: check if Windows8.1-KB2999226-x64.msu hotfix has been applied
win_shell: Get-Hotfix -Id KB2999226
register: hotfix_status
ignore_errors: true
- name: show hotfix status
debug:
var: hotfix_status
# Unfortunately you can't use wusa directly to install windows updates.
# see https://support.microsoft.com/en-us/kb/2773898 for details
# you have to unpack the update file and then use dism.exe to install the cab
- name: unpack the hotfix if needed
win_shell: 'wusa C:\deployment\current\Windows8.1-KB2999226-x64.msu /extract:C:\deployment\archive'
when: hotfix_status.rc == 1
- name: use dism to install the cab containing the hotfix
win_shell: 'dism.exe /online /add-package /PackagePath:C:\deployment\archive\Windows8.1-KB2999226-x64.cab'
when: hotfix_status.rc == 1
- name: ensure Microsoft Visual C++ 2015 x64 Additional Runtime is present
win_package:
name: Microsoft Visual C++ 2015 x64 Additional Runtime
path: 'C:/Program Files/FireDaemon Session 0 Viewer/vc_redist.x64.exe'
state: present
product_id: '{BC958BD2-5DAC-3862-BB1A-C1BE0790438D}'
arguments: "/install /passive /norestart /quiet"
# Info on the hotfix that needs to be applied first
# see http://stackoverflow.com/questions/33265663/api-ms-win-crt-runtime-l1-1-0-dll-is-missing-when-open-office-file
# the hotfix is KB2999226 |
search engines didn't help. |
Found a way to output the chocolatey log file. Here it is: |
hmm, so looks like its the actual office setup.exe that is returning that exit code, chocolatey is just passing it through. I found a link below which suggest that the installer starts a scheduled task, so worth checking that you are installing as a user which can start scheduled task, and that the task scheduler is running. Also I notice that chocolatey is attempting to run as privileged user, so worth trying as local Administrator if possible. Hope this helps, Jon |
Another possibility is that the setup.exe is somehow expecting an interactive user session, which you won't have when running in winrm. It might be that there is a command line switch for the office setup.exe which would make setup.exe expect an unattended installation (and therefore not expect interactive user session). However I'm not sure you can pass in extra arguments to the chocolatey installer via the win_chocolatey modules at the moment. |
At 19:00 UTC on Tuesday 19 September 2017 this ticket will be processed during the second Windows Sprint, |
Discussed at sprint. needs_info |
I haven't used chocolatey to install Office but I know you can use the normal install msi without anything special. Chocolatey could be doing something special or calling it in a different way than I did in the past so it could be it. For SQL Management Studio, considering the normal SQL Server install requires credential delegation (CredSSP/Kerberos with delegation/become) I wouldn't be surprised if the management studio components is the same. |
I was able to install office using become as follows
|
For info I was able to install all 3 packages listed above by using 'become'. |
Documentation PR for this can be seen here #30783. Feel free to review and add your comments. |
ISSUE TYPE
COMPONENT NAME
win_chocolatey
ANSIBLE VERSION
ansible 2.3.1.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.10 (default, Feb 7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
CONFIGURATION
OS / ENVIRONMENT
control machine: OS-X 10.12.6
target machine - Windows 2012 R2
SUMMARY
The following packages fail to deploy:
officeproplus2013
sql-server-management-studio
Extending the win_chocolatey timeout attribute didn't change the result.
Manually running choco on the target machine successfully deploys all packages.
STEPS TO REPRODUCE
EXPECTED RESULTS
Successfully deployed all packages
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: