# invalid autocommand \\"/bin/sh -c '/usr/bin/python '\\"'\\"'\\"\`

**URL:** <https://forum.ansible.com/t/invalid-autocommand-bin-sh-c-usr-bin-python/30379>\
**Category:** Ansible Project\
**Created:** [May 21, 2019, 6:18am UTC](https://forum.ansible.com/t/invalid-autocommand-bin-sh-c-usr-bin-python/30379 "2019-05-21T06:18:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danny\_Dias](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@Danny\_Dias](https://forum.ansible.com/u/Danny_Dias)\
**Post date:** [May 21, 2019, 6:18am UTC](https://forum.ansible.com/t/invalid-autocommand-bin-sh-c-usr-bin-python/30379/1 "2019-05-21T06:18:42Z")

</div>

Hello,

I’m having issues with my new Ansible install.

Here’s the version i installed:

`

[root@srv-lx-shibb-idp test-project]# ansible --version  
**ansible 2.4.2.0**  
config file = /etc/ansible/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  
python version = 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]  
[root@srv-lx-shibb-idp test-project]#

`

I created an inventory file to play with:

`

[root@srv-lx-shibb-idp test-project]# pwd  
/home/dadiaspe/test-project  
[root@srv-lx-shibb-idp test-project]# ls -ltr  
total 4  
-rw-r–r–. 1 root root 202 May 20 22:55 inventory.txt  
[root@srv-lx-shibb-idp test-project]# cat inventory.txt  
vcme ansible\_host=10.201.238.147 ansible\_connection=ssh ansible\_user=admin ansible\_ssh\_pass=cocis  
[root@srv-lx-shibb-idp test-project]#

`

When trying to run the following command, i get an error:

`

[root@srv-lx-shibb-idp test-project]# ansible vcme -m ping -i inventory.txt  
[WARNING]: sftp transfer mechanism failed on [10.201.238.147]. Use ANSIBLE\_DEBUG=1 to see detailed information

[WARNING]: scp transfer mechanism failed on [10.201.238.147]. Use ANSIBLE\_DEBUG=1 to see detailed information

**_vcme | FAILED! =\> {_**  
**_“changed”: false,_**  
**_“module\_stderr”: “Shared connection to 10.201.238.147 closed.\r\n”,_**  
**_“module\_stdout”: “\r\n\r\n\r\nLine has invalid autocommand "/bin/sh -c ‘/usr/bin/python ‘"’"’"`echo /home/dadiaspe/test-project/ansible-tmp-1558419011.91-227396699620382`" ) && sle"/ping.py’"‘"’; rm -rf ""`echo /home/dadiaspe/test-project/ansible-tmp-1558419011.91-227396699620382`" ) && sle"/" \> /dev/null 2\>&1"”,_**  
**_“msg”: “MODULE FAILURE”,_**  
**_“rc”: 0_**  
}

`

Running the command again, with verbosity:

`

[root@srv-lx-shibb-idp test-project]# ansible --version  
ansible 2.4.2.0  
config file = /etc/ansible/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  
python version = 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]  
[root@srv-lx-shibb-idp test-project]# ansible vcme -m ping -i inventory.txt -vvv  
ansible 2.4.2.0  
config file = /etc/ansible/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  
python version = 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]  
Using /etc/ansible/ansible.cfg as config file  
Parsed /home/dadiaspe/test-project/inventory.txt inventory source with ini plugin  
META: ran handlers  
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/ping.py  
\<10.201.238.147\> ESTABLISH SSH CONNECTION FOR USER: admin  
\<10.201.238.147\> SSH: EXEC sshpass -d11 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/63ecd92fc7 10.201.238.147 ‘/bin/sh -c ‘"’"’( umask 77 && mkdir -p “`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” && echo ansible-tmp-1558419302.35-207412972030875=“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sleep 0’“'”‘’  
\<10.201.238.147\> (0, ‘\r\n\r\n\r\nLine has invalid autocommand “/bin/sh -c '( umask 77 && mkdir -p “`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” && echo ansible-tmp-1558419302.35-207412972030875=“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”’, ‘’)  
\<10.201.238.147\> PUT /tmp/tmpXzFpSd TO “`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle"/ping.py  
\<10.201.238.147\> SSH: EXEC sshpass -d11 sftp -o BatchMode=no -b - -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/63ecd92fc7 ‘[10.201.238.147]’  
[WARNING]: sftp transfer mechanism failed on [10.201.238.147]. Use ANSIBLE\_DEBUG=1 to see detailed information

\<10.201.238.147\> SSH: EXEC sshpass -d11 scp -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/63ecd92fc7 /tmp/tmpXzFpSd ‘[10.201.238.147]:’“'”‘“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle"/ping.py’“'”‘’  
[WARNING]: scp transfer mechanism failed on [10.201.238.147]. Use ANSIBLE\_DEBUG=1 to see detailed information

\<10.201.238.147\> ESTABLISH SSH CONNECTION FOR USER: admin  
\<10.201.238.147\> SSH: EXEC sshpass -d11 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/63ecd92fc7 10.201.238.147 ‘dd of=“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle"/ping.py bs=65536’  
\<10.201.238.147\> (0, ‘\r\n\r\n\r\nLine has invalid autocommand “dd of=“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/ping.py bs=65536"’, ‘’)  
\<10.201.238.147\> (0, ‘\r\n\r\n\r\nLine has invalid autocommand “dd of=“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/ping.py bs=65536"’, ‘’)  
\<10.201.238.147\> ESTABLISH SSH CONNECTION FOR USER: admin  
\<10.201.238.147\> SSH: EXEC sshpass -d11 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/63ecd92fc7 10.201.238.147 ‘/bin/sh -c ‘"’“'chmod u+x '”’“'”‘"’“'”‘"’“'“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/‘"’“'”‘"’“'”‘"’“’ '”‘"’“'”‘"’“'”‘"’“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle"/ping.py’“'”‘"’“'”‘"’“'”’ && sleep 0’“'”‘’  
\<10.201.238.147\> (0, ‘\r\n\r\n\r\nLine has invalid autocommand “/bin/sh -c 'chmod u+x '”'“'“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/'“'”' '“'”'“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle"/ping.py'“'”' && sleep 0'"’, ‘’)  
\<10.201.238.147\> ESTABLISH SSH CONNECTION FOR USER: admin  
\<10.201.238.147\> SSH: EXEC sshpass -d11 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/63ecd92fc7 -tt 10.201.238.147 ‘/bin/sh -c ‘"’"’/usr/bin/python ‘"’“'”‘"’“'”‘"’“'“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/ping.py’“'”‘"’“'”‘"’“'”‘; rm -rf ““`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/" \> /dev/null 2\>&1 && sleep 0’“'”‘’  
\<10.201.238.147\> (0, ‘\r\n\r\n\r\nLine has invalid autocommand “/bin/sh -c '/usr/bin/python '”'“'“`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/ping.py'“'”'; rm -rf ““`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`” ) && sle”/" \> /dev/null 2\>&1"’, ‘Shared connection to 10.201.238.147 closed.\r\n’)  
vcme | FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “Shared connection to 10.201.238.147 closed.\r\n”,  
“module\_stdout”: “\r\n\r\n\r\nLine has invalid autocommand "/bin/sh -c ‘/usr/bin/python ‘"’"’"`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`" ) && sle"/ping.py’"‘"’; rm -rf ""`echo /home/dadiaspe/test-project/ansible-tmp-1558419302.35-207412972030875`" ) && sle"/" \> /dev/null 2\>&1"”,  
“msg”: “MODULE FAILURE”,  
“rc”: 0  
}  
[root@srv-lx-shibb-idp test-project]#

`

I haven’t changed anything under /etc/ansible/ansible.cfg

I’m fairly new with Ansible, so i might be missing something but not sure what.

Thanks in advance

---

<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:** [May 28, 2019, 8:23pm UTC](https://forum.ansible.com/t/invalid-autocommand-bin-sh-c-usr-bin-python/30379/2 "2019-05-28T20:23:41Z")

</div>

What kind of host is **_10.201.238.147_**

**_Can you SSH into it manually?_**
