Not able to connect windows server due to the Error "module_stderr": "An error occurred while creating the pipeline.\r\n"," while trying with win_ping

Hi,

I am trying to do ping test to some windows machine using win_ping but getting the below error when i run the ping yml.

$ansible win_prod -i /tmp/winhosts.yml -m win_ping -k
[WARNING] Ansible is in a world writable directory (/tmp), ignoring it as an ansible.cfg source.
SSH password:
Friday 14 September 2018 20:19:32 +0200 (0:00:00.053) 0:00:00.053 ******
abcd01.com | FAILED! => {
“changed”: false,
“module_stderr”: “An error occurred while creating the pipeline.\r\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE”,
“rc”: 1
}

[win]
abcd01.com

[win:vars]
ansible_user=xxx@abc.com

ansible_connection=winrm
ansible_port=5986
ansible_winrm_server_cert_validation=‘ignore’
ansible_winrm_transport=ntlm

I tried to connect through ‘ntlm’ since its a AD account and the same way i am able connected to other hosts successfully which are under same domain. But not able to connect only this host.

Please help to solve the above issue.

regards,
Usha.

Can you run with -vvvvv as that will show more info on the connection process that can help identify your issue.

Hi Jordan,

Executed with -vvvvv…please check the below output:

$ ansible win_prod -i /tmp/winhosts.yml -m win_ping -k -vvvvv
[WARNING] Ansible is in a world writable directory (/tmp), ignoring it as an ansible.cfg source.
ansible 2.6.1
config file = /etc/ansible/ansible.cfg
configured module search path = [‘/home/uyerra/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.4 (default, Jul 10 2018, 11:29:28) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)]
Using /etc/ansible/ansible.cfg as config file
SSH password:
setting up inventory plugins
Parsed /tmp/winhosts.yml inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /usr/local/lib/python3.6/site-packages/ansible/plugins/callback/minimal.py
Loading callback plugin profile_tasks of type aggregate, v2.0 from /usr/local/lib/python3.6/site-packages/ansible/plugins/callback/profile_tasks.py
META: ran handlers
Tuesday 18 September 2018 09:50:30 +0200 (0:00:00.053) 0:00:00.053 *****
Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/windows/win_ping.ps1
<abcd.xxx.com> ESTABLISH WINRM CONNECTION FOR USER: user@xxx.com on PORT 5986 TO abcd.xxx.com
checking if winrm_host abcd.xxx.com is an IPv6 address
<abcd.xxx.com> WINRM CONNECT: transport=ntlm endpoint=https://abcd.xxx.com:5986/wsman
<abcd.xxx.com> WINRM OPEN SHELL: 6C0BD575-66ED-4E41-A232-740078229E47
EXEC (via pipeline wrapper)
<abcd.xxx.com> WINRM EXEC ‘PowerShell’ [‘-NoProfile’, ‘-NonInteractive’, ‘-ExecutionPolicy’, ‘Unrestricted’, ‘-’]
<abcd.xxx.com> WINRM RESULT ‘<Response code 1, out “”, err “An error occurred wh”>’
<abcd.xxx.com> WINRM CLOSE SHELL: 6C0BD575-66ED-4E41-A232-740078229E47
abcd.xxx.com | FAILED! => {
“changed”: false,
“module_stderr”: “An error occurred while creating the pipeline.\r\n”,
“module_stdout”: “”,
“msg”: “MODULE FAILURE”,
“rc”: 1
}
Tuesday 18 September 2018 09:50:32 +0200 (0:00:01.632) 0:00:01.685 *****

Hi Jordan,

Could you please help on the below?

regards,
Usha

Not sure, there’s nothing really being returned in the output that tells us what is happening. It sounds like PowerShell itself is broken or not working properly and I recommend you rebuild the host if it is just the one.

The error is occurring when first starting the task and hasn’t even reached the module execution part.

Thanks

Jordan