Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

how to debug random errors on win_msi Windows module?

662 views
Skip to first unread message

Damon Overboe

unread,
Aug 26, 2014, 5:32:31 PM8/26/14
to ansible...@googlegroups.com
I know about calling with the -vvvv option, and that displays what the error is, but I'm wondering what I need to do to get to the root of the problem.

I've had great success with the win_get_url. I've had some success with the win_msi module, but some failures as well, and they're usually pretty serious.

I'm on the latest of the development branch, *   75bd1fa Tue Aug 26 11:49:02 2014 -0500

I've also recently put Trond's changes / improvements into the win_msi module and see the same results.


So what I'd like to know is, other than the info that's spit out when passing -vvvv, what should I be looking for on the host to help debug this? Nothing in /var/log jumped out at me.

Damon Overboe

unread,
Aug 26, 2014, 5:34:06 PM8/26/14
to ansible...@googlegroups.com
Here is the recipe



---
- hosts: ~node[13]*
        gather_facts
: False
        tasks
:

       
- name: get svn client - version 1.7
                win_get_url
:
                        url
: 'http://sourceforge.net/projects/tortoisesvn/files/1.7.15/Application/TortoiseSVN-1.7.15.25753-x64-svn-1.7.18.msi/download'
                        dest
: 'E:\.installs\tortoise-1.7.msi'

       
- name: ensure svn is version 1.7
                win_msi
:
                        path
='E:\.installs\tortoise-1.7.msi'
                        creates
='C:\Program Files\TortoiseSVN'
                        state
=present
                        msiname
='TortoiseSVN'
                        msiversionstring
='1.7.15.25753'






And a snip of the results showing the failure on the second target:



< TASK: ensure svn is version 1.7 >
 ---------------------------------
 \ ^__^
 \ (oo)\_______
 (__)\ )\/\
 ||----w |
 || ||


<node1.domain.com> ESTABLISH WINRM CONNECTION FOR USER: dummy on PORT 5986 TO node1.domain.com
<node1.domain.com> WINRM CONNECT: transport=plaintext endpoint=https://node1.domain.com:5986/wsman
<node3.domain.com> ESTABLISH WINRM CONNECTION FOR USER: dummy on PORT 5986 TO node3.domain.com
<node3.domain.com> WINRM CONNECT: transport=plaintext endpoint=https://node3.domain.com:5986/wsman
<node1.domain.com> REMOTE_MODULE win_msi path='E:\.installs\tortoise-1.7.msi' creates='C:\Program Files\TortoiseSVN' state=present msiname='TortoiseSVN' msiversionstring='1.7.15.25753'
<node1.domain.com> EXEC (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1409086618.37-235017603593251").FullName | Write-Host -Separator '';
<node1.domain.com> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', '-EncodedCommand', 'KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMAA5ADAAOAA2ADYAMQA4AC4AMwA3AC0AMgAzADUAMAAxADcANgAwADMANQA5ADMAMgA1ADEAIgApAC4ARgB1AGwAbABOAGEAbQBlACAAfAAgAFcAcgBpAHQAZQAtAEgAbwBzAHQAIAAtAFMAZQBwAGEAcgBhAHQAbwByACAAJwAnADsA']
<node3.domain.com> REMOTE_MODULE win_msi path='E:\.installs\tortoise-1.7.msi' creates='C:\Program Files\TortoiseSVN' state=present msiname='TortoiseSVN' msiversionstring='1.7.15.25753'
<node3.domain.com> EXEC (New-Item -Type Directory -Path $env:temp -Name "ansible-tmp-1409086618.38-109273382895193").FullName | Write-Host -Separator '';
<node3.domain.com> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', '-EncodedCommand', 'KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMAA5ADAAOAA2ADYAMQA4AC4AMwA4AC0AMQAwADkAMgA3ADMAMwA4ADIAOAA5ADUAMQA5ADMAIgApAC4ARgB1AGwAbABOAGEAbQBlACAAfAAgAFcAcgBpAHQAZQAtAEgAbwBzAHQAIAAtAFMAZQBwAGEAcgBhAHQAbwByACAAJwAnADsA']
<node1.domain.com> WINRM RESULT <Response code 0, out "C:\Users\dummy\App", err "">
<node3.domain.com> WINRM RESULT <Response code 0, out "C:\Users\dummy\App", err "">
<node1.domain.com> PUT /tmp/tmpb8TIWQ TO C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\win_msi
<node1.domain.com> WINRM PUT /tmp/tmpb8TIWQ to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\win_msi.ps1 (offset=0 size=2036)
<node3.domain.com> PUT /tmp/tmp2B1Pu4 TO C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\win_msi
<node3.domain.com> WINRM PUT /tmp/tmp2B1Pu4 to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\win_msi.ps1 (offset=0 size=2036)
<node1.domain.com> WINRM PUT /tmp/tmpb8TIWQ to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\win_msi.ps1 (offset=2036 size=2036)
<node3.domain.com> WINRM PUT /tmp/tmp2B1Pu4 to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\win_msi.ps1 (offset=2036 size=2036)
<node1.domain.com> WINRM PUT /tmp/tmpb8TIWQ to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\win_msi.ps1 (offset=4072 size=2036)
<node3.domain.com> WINRM PUT /tmp/tmp2B1Pu4 to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\win_msi.ps1 (offset=4072 size=2036)
<node1.domain.com> WINRM PUT /tmp/tmpb8TIWQ to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\win_msi.ps1 (offset=6108 size=2036)
<node1.domain.com> WINRM PUT /tmp/tmpb8TIWQ to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\win_msi.ps1 (offset=8144 size=629)
<node1.domain.com> PUT /tmp/tmpLFj5nQ TO C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\arguments
<node1.domain.com> WINRM PUT /tmp/tmpLFj5nQ to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\arguments (offset=0 size=170)
<node1.domain.com> EXEC PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File "C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\win_msi.ps1" "C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\\arguments"; Remove-Item "C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.37-235017603593251\" -Force -Recurse;
<node1.domain.com> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', '-EncodedCommand', 'UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARgBpAGwAZQAgACIAQwA6AFwAVQBzAGUAcgBzAFwAYQBuAHMAaQBiAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADAAOQAwADgANgA2ADEAOAAuADMANwAtADIAMwA1ADAAMQA3ADYAMAAzADUAOQAzADIANQAxAFwAXAB3AGkAbgBfAG0AcwBpAC4AcABzADEAIgAgACIAQwA6AFwAVQBzAGUAcgBzAFwAYQBuAHMAaQBiAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADAAOQAwADgANgA2ADEAOAAuADMANwAtADIAMwA1ADAAMQA3ADYAMAAzADUAOQAzADIANQAxAFwAXABhAHIAZwB1AG0AZQBuAHQAcwAiADsAIABSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGEAbgBzAGkAYgBsAGUAXABBAHAAcABEAGEAdABhAFwATABvAGMAYQBsAFwAVABlAG0AcABcAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAAwADkAMAA4ADYANgAxADgALgAzADcALQAyADMANQAwADEANwA2ADAAMwA1ADkAMwAyADUAMQBcACIAIAAtAEYAbwByAGMAZQAgAC0AUgBlAGMAdQByAHMAZQA7AA==']
<node3.domain.com> WINRM PUT /tmp/tmp2B1Pu4 to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\win_msi.ps1 (offset=6108 size=2036)
<node3.domain.com> WINRM PUT /tmp/tmp2B1Pu4 to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\win_msi.ps1 (offset=8144 size=629)
<node3.domain.com> PUT /tmp/tmpZC_YQb TO C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\arguments
<node3.domain.com> WINRM PUT /tmp/tmpZC_YQb to C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\arguments (offset=0 size=170)
<node3.domain.com> EXEC PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File "C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\win_msi.ps1" "C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\\arguments"; Remove-Item "C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409086618.38-109273382895193\" -Force -Recurse;
<node3.domain.com> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', '-EncodedCommand', 'UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARgBpAGwAZQAgACIAQwA6AFwAVQBzAGUAcgBzAFwAYQBuAHMAaQBiAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADAAOQAwADgANgA2ADEAOAAuADMAOAAtADEAMAA5ADIANwAzADMAOAAyADgAOQA1ADEAOQAzAFwAXAB3AGkAbgBfAG0AcwBpAC4AcABzADEAIgAgACIAQwA6AFwAVQBzAGUAcgBzAFwAYQBuAHMAaQBiAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADAAOQAwADgANgA2ADEAOAAuADMAOAAtADEAMAA5ADIANwAzADMAOAAyADgAOQA1ADEAOQAzAFwAXABhAHIAZwB1AG0AZQBuAHQAcwAiADsAIABSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGEAbgBzAGkAYgBsAGUAXABBAHAAcABEAGEAdABhAFwATABvAGMAYQBsAFwAVABlAG0AcABcAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAAwADkAMAA4ADYANgAxADgALgAzADgALQAxADAAOQAyADcAMwAzADgAMgA4ADkANQAxADkAMwBcACIAIAAtAEYAbwByAGMAZQAgAC0AUgBlAGMAdQByAHMAZQA7AA==']
<node1.domain.com> WINRM RESULT <Response code 0, out "{ "changed": t", err "">
changed: [node1.domain.com] => {"changed": true, "log": "C:\\Users\\ansible\\AppData\\Local\\Temp\\tmpB5AA.tmp"}
Traceback (most recent call last):
 File "/home/damon/src/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 149, in exec_command
 result = self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
 File "/home/damon/src/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 118, in _winrm_exec
 response = Response(self.protocol.get_command_output(self.shell_id, command_id))
 File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 277, in get_command_output
 self._raw_get_command_output(shell_id, command_id)
 File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 293, in _raw_get_command_output
 rs = self.send_message(xmltodict.unparse(rq))
 File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 173, in send_message
 return self.transport.send_message(message)
 File "/usr/local/lib/python2.7/dist-packages/winrm/transport.py", line 90, in send_message
 raise WinRMTransportError(error_message)
WinRMTransportError: Bad HTTP response returned from server. Code 500
fatal: [node3.domain.com] => failed to exec cmd PowerShell -NoProfile -NonInteractive -EncodedCommand UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARgBpAGwAZQAgACIAQwA6AFwAVQBzAGUAcgBzAFwAYQBuAHMAaQBiAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADAAOQAwADgANgA2ADEAOAAuADMAOAAtADEAMAA5ADIANwAzADMAOAAyADgAOQA1ADEAOQAzAFwAXAB3AGkAbgBfAG0AcwBpAC4AcABzADEAIgAgACIAQwA6AFwAVQBzAGUAcgBzAFwAYQBuAHMAaQBiAGwAZQBcAEEAcABwAEQAYQB0AGEAXABMAG8AYwBhAGwAXABUAGUAbQBwAFwAYQBuAHMAaQBiAGwAZQAtAHQAbQBwAC0AMQA0ADAAOQAwADgANgA2ADEAOAAuADMAOAAtADEAMAA5ADIANwAzADMAOAAyADgAOQA1ADEAOQAzAFwAXABhAHIAZwB1AG0AZQBuAHQAcwAiADsAIABSAGUAbQBvAHYAZQAtAEkAdABlAG0AIAAiAEMAOgBcAFUAcwBlAHIAcwBcAGEAbgBzAGkAYgBsAGUAXABBAHAAcABEAGEAdABhAFwATABvAGMAYQBsAFwAVABlAG0AcABcAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAAwADkAMAA4ADYANgAxADgALgAzADgALQAxADAAOQAyADcAMwAzADgAMgA4ADkANQAxADkAMwBcACIAIAAtAEYAbwByAGMAZQAgAC0AUgBlAGMAdQByAHMAZQA7AA==
 ____________
< PLAY RECAP >
 ------------
 \ ^__^
 \ (oo)\_______
 (__)\ )\/\
 ||----w |
 || ||


 to retry, use: --limit @/home/damon/slaves-svn-cleanup.retry

node1.domain.com : ok=2 changed=2 unreachable=0 failed=0
node3.domain.com : ok=1 changed=1 unreachable=1 failed=0

Message has been deleted

Damon Overboe

unread,
Aug 26, 2014, 5:37:57 PM8/26/14
to ansible...@googlegroups.com
Here is a subsequent success on both (ran again bc the HTTP 500 isn't
the error I normally see)


ok: [node1.domain.com] => {"changed": false, "exit_reason": {"name": "File specified in creates parameter already exists"}}
<node3.domain.com> WINRM RESULT <Response code 0, out "{ "changed": t", err " Process is terminat">
changed: [node3.domain.com] => {"changed": true, "log": "C:\\Users\\dummy\\AppData\\Local\\Temp\\tmp30A4.tmp"}

 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


node1.domain.com    : ok=2    changed=1    unreachable=0    failed=0   
node3.domain.com    : ok=2    changed=2    unreachable=0    failed=0 

Trond Hindenes

unread,
Aug 26, 2014, 5:50:29 PM8/26/14
to ansible...@googlegroups.com
Hi Damon,

That's weird,
I tried your playbook on two 2012R2 hosts just now, and it worked fine. Only thing I noticed is that you're saving to a "non-standard" folder. Could you test it by setting the dest to dest: 'C:\tortoise-1.7.msi' or something in win_Get_url?

About debugging: It's kinda hard, because Ansible cleans up the temp files. I'm gonna post an issue to see if we can get a "win_debug" setting in ansible.cfg to enable leaving the files in place so that we can run the generated script and param file through a normal PowerShell debugger. For now you have to take the params you send and store them as a json file. Then, combine the module ps1 file with the powershell.ps1 file into a single file and execute that file in powershell with the params file as the first and only argument. Its bothersome to say the least.

Trond Hindenes

unread,
Aug 26, 2014, 5:55:53 PM8/26/14
to ansible...@googlegroups.com
BTW, i have a brand spankin new win_package module coming up which will handle not only msis but all kinds of installs, and also supports auto-downloading source files from a url so that you don't need to win_get_url first. I'm waiting for some improvements to the powershell helper scripts to be merged before i PR that module, but let me know and I'd be happy to share it with you.

-Trond

Damon Overboe

unread,
Aug 26, 2014, 5:56:16 PM8/26/14
to ansible...@googlegroups.com
That would be awesome on the debugging, because I'd like to be able to help, but feel kinda helpless.

Yeah since switching to your changes (which I guess I forgot to link to) it's been working better generally, because it's seeing that the product is installed so it doesn't try to run it again.

I'm going to try removing the bit that checks if it's already installed and run it a few more times.

What I saw earlier was before your changes, it would usually install successfully the first time and sometimes even the second time, but eventually it'd start throwing the SOs.

Damon Overboe

unread,
Aug 26, 2014, 6:00:08 PM8/26/14
to ansible...@googlegroups.com
Yah that'd be great. I'll happily test it out if you like.

I'm only targeting Svr 12s, and just using it right now to set up new build agent nodes. I want to do a lot more with it but figured that would be a good place to start.

Trond Hindenes

unread,
Aug 26, 2014, 6:07:09 PM8/26/14
to ansible...@googlegroups.com
Cool, I'm writing up a short doc and putting it on a branch in my ansible fork right now. Will send you links and stuffs in a couple of minutes.

Trond Hindenes

unread,
Aug 26, 2014, 6:15:45 PM8/26/14
to ansible...@googlegroups.com

Note that I'm using the updated helper functions from the main powershell.ps1 script, so you'll need to grab that as well. You can grab if from this PR:
https://github.com/ansible/ansible/pull/8759 (the powershell.ps1 file goes in /lib/ansible/module_utils in your ansible directory structure)

Damon Overboe

unread,
Aug 26, 2014, 6:20:37 PM8/26/14
to ansible...@googlegroups.com
I'm still somewhat of a git noob;

I've cloned your repo, but I'm not sure how to get the pull request from 8759 into that clone...

I'm guessing there's a command to merge, any pointers?

Damon Overboe

unread,
Aug 26, 2014, 6:25:20 PM8/26/14
to ansible...@googlegroups.com
I found this....

http://stackoverflow.com/a/1426163/734790

I'm testing that out.

Trond Hindenes

unread,
Aug 26, 2014, 6:25:46 PM8/26/14
to ansible...@googlegroups.com
Me too. I would just grab the file manually and stick it in your on fork for now:
https://raw.githubusercontent.com/trondhindenes/ansible/win_setup_json_depth/lib/ansible/module_utils/powershell.ps1

My repo has a branch for each change/PR i've submitted, so you're probably better off forking the original ansible code and just come up with your own way of managing the various changes you put in it. I guess I should try and rebase everything back into my devel branch, but it's that's not the case right now.

Damon Overboe

unread,
Aug 26, 2014, 6:36:19 PM8/26/14
to ansible...@googlegroups.com
That's exactly what I did to get your changes into the mainline, so I'm doing that again.

You want me to post feedback (if I have any) in this thread or on the pull request?

Trond Hindenes

unread,
Aug 26, 2014, 6:40:07 PM8/26/14
to ansible...@googlegroups.com
This thread is fine. I haven't submitted a PR for win_package just yet.

Damon Overboe

unread,
Aug 26, 2014, 6:48:36 PM8/26/14
to ansible...@googlegroups.com
There it is, finally!!!

This is still using the win_msi, I'll switch to the win_package now.

I'm not sure why but I just wasn't going to be happy until I broke it.



changed: [node1.domain.com]

Traceback (most recent call last):
 
File "/home/damon/src/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 149, in exec_command
    result
= self._winrm_exec(cmd_parts[0], cmd_parts[1:], from_exec=True)
 
File "/home/damon/src/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 118, in _winrm_exec
    response
= Response(self.protocol.get_command_output(self.shell_id, command_id))
 
File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 277, in get_command_output
   
self._raw_get_command_output(shell_id, command_id)
 
File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 293, in _raw_get_command_output
    rs
= self.send_message(xmltodict.unparse(rq))
 
File "/usr/local/lib/python2.7/dist-packages/winrm/protocol.py", line 173, in send_message
   
return self.transport.send_message(message)
 
File "/usr/local/lib/python2.7/dist-packages/winrm/transport.py", line 90, in send_message
   
raise WinRMTransportError(error_message)
WinRMTransportError: Bad HTTP response returned from server. Code 500

fatal
: [node3.domain.com] => failed to exec cmd PowerShell -NoProfile -NonInteractive -EncodedCommand KABOAGUAdwAtAEkAdABlAG0AIAAtAFQAeQBwAGUAIABEAGkAcgBlAGMAdABvAHIAeQAgAC0AUABhAHQAaAAgACQAZQBuAHYAOgB0AGUAbQBwACAALQBOAGEAbQBlACAAIgBhAG4AcwBpAGIAbABlAC0AdABtAHAALQAxADQAMAA5ADAAOQAyADkAOAA2AC4ANgAtADIANwA2ADMAMAA3ADAAMAA2ADUAMgA0ADEAOAAiACkALgBGAHUAbABsAE4AYQBtAGUAIAB8ACAAVwByAGkAdABlAC0ASABvAHMAdAAgAC0AUwBlAHAAYQByAGEAdABvAHIAIAAnACcAOwA=
 _________________________________
< TASK: ensure svn is version 1.7 >
 
---------------------------------

       
\   ^__^

         
\  (oo)\_______
           
(__)\       )\/\
               
||----w |
               
||     ||



failed
: [node1.domain.com] => {"failed": true, "parsed": false}
invalid output was
:
Process is terminated due to StackOverflowException.


FATAL
: all hosts have already failed -- aborting
 ____________
< PLAY RECAP >
 
------------
       
\   ^__^
         
\  (oo)\_______
           
(__)\       )\/\
               
||----w |
               
||     ||



           to
retry, use: --limit @/home/damon/slaves-svn-cleanup.retry

node1
.domain.com    : ok=1    changed=1    unreachable=0    failed=1  
node3
.domain.com    : ok=0    changed=0    unreachable=1    failed=0  

Trond Hindenes

unread,
Aug 26, 2014, 6:53:24 PM8/26/14
to ansible...@googlegroups.com
Nice,
So, Chris just tipped me about this ansible.cfg setting:
[defaults]
keep_remote_files = 1

Stick that in your /ansible/etc/ansible.cfg and re-run your playbook with -vvv

All those temp paths Ansible uses for powershell files will now be left on your windows system. Each folder basically has a script file (the module) and an arguments file. That should do wonders for debugging windows modules (it would still require some PowerShell proficiency tho)

Damon Overboe

unread,
Aug 26, 2014, 7:25:56 PM8/26/14
to ansible...@googlegroups.com
Awesome I'll give that as shot.

The biggest thing I wanted to know was how to catch the output so I can at least try to debug it or ask for help, so that'll be huge.

I'm off for the night tonight but I'll be testing out win_package tomorrow for sure. I'll let you know how it goes.

Damon Overboe

unread,
Aug 28, 2014, 11:44:52 AM8/28/14
to ansible...@googlegroups.com
OK I'm testing it out.

First, I love that you can pass arguments. I have been automating the Jenkins clients; I'm adding a specific version of SVN, and with the win_msi installer, I couldn't figure out how to pass arguments to it so it would install the Command Line Interface.

With the win_package, that is super easy, so I was happy to see that!


But I ran into my first situation; if you give it a URL and the download file doesn't include the extension, it will fail to install. Test out this url:

http://sourceforge.net/projects/tortoisesvn/files/1.7.15/Application/TortoiseSVN-1.7.15.25753-x64-svn-1.7.18.msi/download

Running a plain wget, `wget http://sourceforge.net/projects/tortoisesvn/files/1.7.15/Application/TortoiseSVN-1.7.15.25753-x64-svn-1.7.18.msi/download` will download the installer as "download" so I'm assuming the scripts are doing the same.

So, it probably needs an option to specify the output file, much like you would with `wget -o` or `wget --output-file`.

Damon Overboe

unread,
Aug 28, 2014, 11:59:29 AM8/28/14
to ansible...@googlegroups.com
I changed it to run win_get_url to download the package so I could rename the file (using 'dest').

And then, I hit a nice System.OutOfMemoryException.  This server isn't that beefy and it's wanting to run updates, so it could be that... but I'm going to try to grab the remote files anyway.

I wasn't running -vvvv, here's what I saw:

failed: [clone] => {"failed": true, "parsed": false}
invalid output was: Exception of type 'System.OutOfMemoryException' was thrown.
At C:\Users\dummy\AppData\Local\Temp\ansible-tmp-1409241114.17-71859971213315
\win_package.ps1:1395 char:5
+ if ($testdscresult -eq $true)
+     ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], OutOfMemoryException
    + FullyQualifiedErrorId : System.OutOfMemoryException

 


FATAL: all hosts have already failed -- aborting
 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


           to retry, use: --limit @/home/damon/slaves-svn-package.retry

clone : ok=2    changed=1    unreachable=0    failed=1

Damon Overboe

unread,
Aug 28, 2014, 1:26:44 PM8/28/14
to ansible...@googlegroups.com
Cool I just hit the StackOverflow again.

I used win_get_url to download, and then win_package to install. I am using the updated powershell.ps1 script from 8759, but I have seen it without that as well.

failed: [clone] => {"failed": true, "parsed": false}
invalid output was
:
Process is terminated due to StackOverflowException.


FATAL
: all hosts have already failed -- aborting
 ____________
< PLAY RECAP >
 
------------
       
\   ^__^
         
\  (oo)\_______
           
(__)\       )\/\
               
||----w |
               
||     ||



           to
retry, use: --limit @/home/damon/slaves-svn-package.retry


clone
: ok=2    changed=1    unreachable=0    failed=1  


The only two files in the temp directory on the remote are the `arguments` file and `powershell.ps1`. Here are the contents of the args file:

{"arguments": "ADDLOCAL=CLI", "creates": "C:\\Program Files\\TortoiseSVN", "ensure": "present", "name": "TortoiseSVN-1.7.15", "path": "E:\\.installs\\tortoise-1.7.msi", "product_id": "{087D2CC7-C1FA-45EC-9FC1-B06CA4A073A0}"}

I'm going to try changing up the values a bit and see if it's bad arguments going into it.  Here is the playbook (currently), and I'm also going to try rerunning with -vvvv


  - name: get svn client - version 1.7
    win_get_url:
      url: 'http://sourceforge.net/projects/tortoisesvn/files/1.7.15/Application/Tor$
      dest: 'E:\.installs\tortoise-1.7.msi'

  - name: ensure svn is version 1.7
    win_package:
      path='E:\.installs\tortoise-1.7.msi'
      name='TortoiseSVN-1.7.15'
      product_id='{087D2CC7-C1FA-45EC-9FC1-B06CA4A073A0}'

      creates='C:\Program Files\TortoiseSVN'
      ensure=present
      arguments="ADDLOCAL=CLI"

Damon Overboe

unread,
Aug 28, 2014, 1:38:24 PM8/28/14
to ansible...@googlegroups.com
"seen it without that as well" = seen the StackOverflow on the mainline dev branch, using win_msi and the powershell.ps1 from the mainline as well.
...

Trond Hindenes

unread,
Aug 28, 2014, 5:05:36 PM8/28/14
to ansible...@googlegroups.com
Out of memory? For real? I havent seen that since the 90's. Put some more ram in your box?

Damon Overboe

unread,
Aug 28, 2014, 6:06:50 PM8/28/14
to ansible...@googlegroups.com
Well I'm consistently getting StackOverflows now too, so I think the two might be related; some kind of infinite loop that sometimes runs out of memory before it can overflow the stack.

The VMs should have plenty of memory, but, then again some of the VMs we have are a bit laggy, so I'm trying some other servers too.

I'm a bit fried though, so I'm probably going to put this on hold for tonight, I'll hit it clean tomorrow.


I have the latest from your win_package branch, plus the patch to powershell. I also have a clean checkout from the ansible devel branch, and I'm seeing it in both.

To be safe, I think tomorrow I'll do clean checkouts of both again, just to make sure I haven't hosed something on my end.
...

Chris Church

unread,
Aug 28, 2014, 10:49:26 PM8/28/14
to ansible...@googlegroups.com
Damon -- I've been getting occasional stack overflow and out of memory exceptions when testing against Server 2008 R2 without updates.  See https://github.com/ansible/ansible/pull/8345#issuecomment-52074837 for a hotfix that might work.

Running with -vvvvv when using winrm provides even more output, including all of stderr if something goes wrong, whereas -vvvv only displays a truncated version (e.g. WINRM RESULT <Response code 0, out "....", err "......">).

Make sure you're running the latest pywinrm (pip install -U http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm).  I'd submitted some fixes earlier this week related to timeouts; previously you would get 500 errors for any command taking longer than 60 seconds.



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4603448b-a24a-49e8-8d8a-b1bb9770ad8e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Damon Overboe

unread,
Aug 29, 2014, 1:35:24 AM8/29/14
to ansible...@googlegroups.com

Cool thanks Chris I'll check that out.

I'll make sure to update pywinrm, on one control in pretty sure i don't have that version because I didn't specify the repo to take it from. The other is probably a month old, and i was getting some 500s, SOs, and out of memories.

And should i just go ahead and turn the -v's up to 11? :-D  that should make the Spinal Tap logo show up instead of the cow!

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/nve1NRr2Vx4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages