# \[ HELP \] Ansible Module Error \[ Parameter format not correct - \>nul\\r\\n \]

**URL:** <https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 27, 2021, 9:22am UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693 "2021-02-27T09:22:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Rittu](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@Richard\_Rittu](https://forum.ansible.com/u/Richard_Rittu)\
**Post date:** [February 27, 2021, 9:22am UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/1 "2021-02-27T09:22:25Z")

</div>

![Error Part1.png](https://us1.discourse-cdn.com/ansible/original/2X/6/624d0dff584cd65b310ab57edf82d849776753c0.png) ![Error Part2.png](https://us1.discourse-cdn.com/ansible/original/2X/e/e0031dd1b69463a841283af5f34a1cc5009e6ad0.png)Hi Team,

Good day,

I am trying to deploy the app to the Windows server from redhat. Actually, it was successfully running for several weeks but Since Yesterday morning I am facing this strange issue after running the playbook.So tried with only win\_ping module that also not successful

Error:

ansible-playbook 2.9.17 config file = /root/myteam/stephen/Ansible/DeployApp/ansible.cfg configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 2.7.5 (default, Sep 12 2018, 05:31:16) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] Using /root/Ansible/DeployAppToServer/ansible.cfg as config file SSH password: host\_list declined parsing /root/myteam/stephen/Ansible/DeployApp/ehosts as it did not pass its verify\_file() method script declined parsing /root/myteam/stephen/Ansible/DeployApp/ehosts as it did not pass its verify\_file() method auto declined parsing /root/myteam/stephen/Ansible/DeployApp/ehosts as it did not pass its verify\_file() method Parsed /root/myteam/stephen/Ansible/DeployApp/ehosts inventory source with ini plugin Skipping callback ‘actionable’, as we already have a stdout callback. Skipping callback ‘counter\_enabled’, as we already have a stdout callback. Skipping callback ‘debug’, as we already have a stdout callback. Skipping callback ‘dense’, as we already have a stdout callback. Skipping callback ‘dense’, as we already have a stdout callback. Skipping callback ‘full\_skip’, as we already have a stdout callback. Skipping callback ‘json’, as we already have a stdout callback. Skipping callback ‘minimal’, as we already have a stdout callback. Skipping callback ‘null’, as we already have a stdout callback. Skipping callback ‘oneline’, as we already have a stdout callback. Skipping callback ‘selective’, as we already have a stdout callback. Skipping callback ‘skippy’, as we already have a stdout callback. Skipping callback ‘stderr’, as we already have a stdout callback. Skipping callback ‘unixy’, as we already have a stdout callback. Skipping callback ‘yaml’, as we already have a stdout callback. PLAYBOOK: test.yml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1 plays in test.yml PLAY [Push App to webserver] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* META: ran handlers TASK [Ping Server] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* task path: /root/myteam/stephen/Ansible/DeployApp/test.yml:7 Using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win\_ping.ps1 Pipelining is enabled. \<192.168.1.45\> ESTABLISH SSH CONNECTION FOR USER: Richard \<192.168.1.45\> SSH: EXEC sshpass -d10 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o ‘User=“Richard”’ -o ConnectTimeout=25 -o ControlPath=/root/.ansible/cp/16376c84cb 192.168.1.45 ‘[chcp.com](http://chcp.com/) 65001 \>nul 2\>&1 && PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARQBuAGMAbwBkAGUAZABDAG8AbQBtAGEAbgBkACAASgBnAEIAagBBAEcAZwBBAFkAdwBCAHcAQQBDADQAQQBZAHcAQgB2AEEARwAwAEEASQBBAEEAMgBBAEQAVQBBAE0AQQBBAHcAQQBEAEUAQQBJAEEAQQArAEEAQwBBAEEASgBBAEIAdQBBAEgAVQBBAGIAQQBCAHMAQQBBAG8AQQBKAEEAQgBsAEEASABnAEEAWgBRAEIAagBBAEYAOABBAGQAdwBCAH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nAEEAawBBAEcAVQBBAGUAQQBCAGwAQQBHAE0AQQBYAHcAQgAzAEEASABJAEEAWQBRAEIAdwBBAEgAQQBBAFoAUQBCAHkAQQBBAD0APQA=’ \<192.168.1.45\> (1, ‘’, ‘Parameter format not correct - \>nul\r\n’) \<192.168.1.45\> Failed to connect to the host via ssh: Parameter format not correct - \>nul fatal: [192.168.1.45]: FAILED! =\> { “changed”: false, “module\_stderr”: “Parameter format not correct - \>nul\r\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1 } PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 192.168.1.45 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

What I have checked?

Trying the same playbook with other windows hosts - Successful | Enabled gather facts to true but failed with same error | changed ansible shell type to cmd/PowerShell due to same similar que in internet but unsuccessful.

Specifications:

redhat - ansible 2.9.17 - python 2.7.5 - windows 10

Here is the playbook

- name: Push App to webserver  
hosts: webserver  
gather\_facts: false

tasks:

- name : Ping Server  
win\_ping:  
register: ping\_out  
tags:

- ping

- debug:  
msg: “{{ ping\_out }}”

Attached error log as an attachment due to incorrect formatting. I can’t find any information on this error on the internet.

Can you please help folks?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 27, 2021, 2:18pm UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/2 "2021-02-27T14:18:06Z")

</div>

What happens when you deploy this to another server? Or an entirely fresh one?

> **(attachments)**
>
> ![Error Part2.png](https://us1.discourse-cdn.com/ansible/original/2X/e/e0031dd1b69463a841283af5f34a1cc5009e6ad0.png)  
> ![Error Part1.png](https://us1.discourse-cdn.com/ansible/original/2X/6/624d0dff584cd65b310ab57edf82d849776753c0.png)

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [February 28, 2021, 8:54pm UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/3 "2021-02-28T20:54:19Z")

</div>

The error is literally trying to run a syntax that works for cmd.exe but in PowerShell hence the error ‘Parameter format not correct - \>nul’. The fix for this is to either set ansible\_shell\_type=powershell or change the default shell back to CMD on your Win32 OpenSSH config. If you’ve already tried setting the shell type then it may be because the parameter was set in the wrong place. A simple test is to do `ansible … -e ansible\_shell\_type=powershell’ in the command line.

---

<div class="post-metadata">

**Author:** ![Richard\_Rittu](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@Richard\_Rittu](https://forum.ansible.com/u/Richard_Rittu)\
**Post date:** [March 1, 2021, 4:46am UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/4 "2021-03-01T04:46:33Z")

</div>

Hi,

Thanks to both of you for the reply.

Yes, I can deploy to other win hosts.

I have changed ansible\_shell\_type=powershell and changed Default shell in win server too. Now i am facing this error:

\<192.168.1.45\> (1, b’‘, b’Parameter format not correct - \>\r\n’)  
\<192.168.1.45\> Failed to connect to the host via ssh: Parameter format not correct - \>  
fatal: [192.168.1.45]: FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “Parameter format not correct - \>\r\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

Any Help would be much appreciated,  
Thanks

---

<div class="post-metadata">

**Author:** ![Richard\_Rittu](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@Richard\_Rittu](https://forum.ansible.com/u/Richard_Rittu)\
**Post date:** [March 2, 2021, 3:44am UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/5 "2021-03-02T03:44:04Z")

</div>

Hi Team,

According to the logs it was working on 22 of Feb not working on 23.When i checked the win hosts there was this update [KB4593226] was installed on that day will that effect on ansible ??

Updated to latest

ansible : 3.0.0  
ansible-base: 2.10.6  
python - 3.6.8

Here this group is my last ray of HOPE.

Thanks

Regards,  
Richard Rittu

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [March 2, 2021, 7:27pm UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/6 "2021-03-02T19:27:51Z")

</div>

There’s not much else we can say, the error you have indicates the shell being used in OpenSSH is cmd so trying to run ansible\_shell\_type=powershell will cause that failure. Either set it to cmd or work out how to change the DefaultShell for your installation on the Windows host. Ansible needs to know the correct shell so it can format the commands it sends to the host properly.

---

<div class="post-metadata">

**Author:** ![Richard\_Rittu](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@Richard\_Rittu](https://forum.ansible.com/u/Richard_Rittu)\
**Post date:** [March 17, 2021, 6:04am UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/7 "2021-03-17T06:04:25Z")

</div>

Hi Team,

Tried Installing PowerShell and made it as default shell in win 2016. Still, the error remains the same?

looks like somebody raised a bug in ansible but they redirected to check in this group

[https://github.com/ansible/ansible/issues/72961](https://github.com/ansible/ansible/issues/72961)

Any help would be much appreciated.  
 ![rr.png](https://us1.discourse-cdn.com/ansible/original/2X/c/cfb9e1d572e19fc952ebb919643e81bba6dc31ea.png)

---

<div class="post-metadata">

**Author:** ![Richard\_Rittu](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@Richard\_Rittu](https://forum.ansible.com/u/Richard_Rittu)\
**Post date:** [March 20, 2021, 11:34am UTC](https://forum.ansible.com/t/help-ansible-module-error-parameter-format-not-correct-nul-r-n/34693/8 "2021-03-20T11:34:41Z")

</div>

Hi team,

Thanks for your support it seems the openssh7.6 version in windows caused the issue then i updated to latest one, now its working fine.

Hope it helps somebody

Regards,  
Richard Rittu

> **(attachments)**
>
> ![rr.png](https://us1.discourse-cdn.com/ansible/original/2X/c/cfb9e1d572e19fc952ebb919643e81bba6dc31ea.png)
