# ansible locale issue

**URL:** <https://forum.ansible.com/t/ansible-locale-issue/21377>\
**Category:** Ansible Project\
**Created:** [May 7, 2016, 8:21am UTC](https://forum.ansible.com/t/ansible-locale-issue/21377 "2016-05-07T08:21:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy3](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Andy3](https://forum.ansible.com/u/Andy3)\
**Post date:** [May 7, 2016, 8:21am UTC](https://forum.ansible.com/t/ansible-locale-issue/21377/1 "2016-05-07T08:21:56Z")

</div>

##### Hi experts,I report a bug on github, but I notice the maillist is a better way to ask my quesiton, so anyone can help me on below issue?

##### ANSIBLE VERSION

ansible 1.9.6  
configured module search path = None

##### CONFIGURATION

/etc/ansible/ansible.cfg  
[defaults]  
forks = 100  
inventory = /etc/ansible/hosts  
pipelining = True  
host\_key\_checking = False

/etc/ansible/hosts  
[test1]  
192.168.200.1  
[test2]  
192.168.200.2

##### OS / ENVIRONMENT

localhost CentOS Linux release 7.2.1511 (Core)  
192.168.200.1 CentOS Linux release 7.2.1511 (Core)  
192.168.200.2 CentOS Linux release 7.2.1511 (Core)  
All system installed python 2.7.5

##### SUMMARY

One of the remote target can’t execute any ansible command, but no clear error log I can get

##### STEPS TO REPRODUCE

run ping moudle from localhost to 192.168.200.1 failed  
run ping moudle from localhost to 192.168.200.2 success

##### EXPECTED RESULTS

```auto
 # ansible -vvvv test2 -m ping
<192.168.200.2> ESTABLISH CONNECTION FOR USER: root
<192.168.200.2> REMOTE_MODULE ping
<192.168.200.2> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.200.2 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706 && echo $HOME/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706'
<192.168.200.2> PUT /tmp/tmp5a6Mjm TO /root/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706/ping
<192.168.200.2> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.200.2 /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706/ping; rm -rf /root/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706/ >/dev/null 2>&1'
192.168.200.2 | success >> {
    "changed": false,
    "ping": "pong"
}

```

or I should get the clear reason why ansible didn’t run successful on 192.168.200.1

##### ACTUAL RESULTS

ansible exec on test1 failed but no clear error log

```auto
# ansible -vvvv test1 -m ping
<192.168.200.1> ESTABLISH CONNECTION FOR USER: root
<192.168.200.1> REMOTE_MODULE ping
<192.168.200.1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.200.1 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1462592317.55-110943377524448 && echo $HOME/.ansible/tmp/ansible-tmp-1462592317.55-110943377524448'
/root/.ansible/tmp/ansible-tmp-1462592317.55-110943377524448/ping
<192.168.200.1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.200.1 /bin/sh -c 'LANG=en_US.UTF-8 LC/root/.ansible/tmp/ansible-tmp-1462592317.55-110943377524448/ >/dev/null 2>&1'
192.168.200.1 | FAILED >> {
    "failed": true,
    "msg": "\u001b[?25h\u001b[0G\u001b[K\u001b[?25h\u001b[0G\u001b[K/usr/bin/python: can't open file '\u001b[?25h\u001b[0G\u001b[K\u001b[?25h\u001b[0G\u001b[K/root/.ansible/tmp/ansible-tmp-1462592317.55-110943377524448/ping': [Errno 2] No such file or directory\r\nOpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 56: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 10758\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 192.168.200.1 closed.\r\n",
    "parsed": false
}

 # ansible -vvvv test2 -m ping
<192.168.200.2> ESTABLISH CONNECTION FOR USER: root
<192.168.200.2> REMOTE_MODULE ping
<192.168.200.2> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.200.2 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706 && echo $HOME/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706'
<192.168.200.2> PUT /tmp/tmp5a6Mjm TO /root/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706/ping
<192.168.200.2> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 192.168.200.2 /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706/ping; rm -rf /root/.ansible/tmp/ansible-tmp-1462592345.97-78459488561706/ >/dev/null 2>&1'
192.168.200.2 | success >> {
    "changed": false,
    "ping": "pong"
}

```

And on 192.168.200.1, one ansible process running all the time:

```auto
root 13492 0.0 0.0 76404 1632 ? Ss 11:50 0:00 ssh: /root/.ansible/cp/ansible-ssh-192.168.200.1-22-root [mux]

```

A lot of dir keep generating under /root/.ansible/tmp/

```auto
[root@sh1 ~]# ll /root/.ansible/tmp/ | wc -l
864

```

And the content of every dir is empty

```auto
[root@sh1 ~]# ls -lh /root/.ansible/tmp/ansible-tmp-1462595658.2-267442571738160/
total 0

```

---

<div class="post-metadata">

**Author:** ![Andy3](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Andy3](https://forum.ansible.com/u/Andy3)\
**Post date:** [May 7, 2016, 8:28am UTC](https://forum.ansible.com/t/ansible-locale-issue/21377/2 "2016-05-07T08:28:40Z")

</div>

I notice the test1 node didn’t reply the right path, it reply the path:  
\u001b[?25h\u001b[0G\u001b[K\u001b[?25h\u001b[0G\u001b[K/root/.ansible/tmp/ansible-tmp-1462609576.78-140384241971167/ping

So I think this must be a locate issue, but the management node and test1 node has been set to:

LANG=en\_US.UTF-8  
LC\_CTYPE=“en\_US.UTF-8”  
LC\_NUMERIC=“en\_US.UTF-8”  
LC\_TIME=“en\_US.UTF-8”  
LC\_COLLATE=“en\_US.UTF-8”  
LC\_MONETARY=“en\_US.UTF-8”  
LC\_MESSAGES=“en\_US.UTF-8”  
LC\_PAPER=“en\_US.UTF-8”  
LC\_NAME=“en\_US.UTF-8”  
LC\_ADDRESS=“en\_US.UTF-8”  
LC\_TELEPHONE=“en\_US.UTF-8”  
LC\_MEASUREMENT=“en\_US.UTF-8”  
LC\_IDENTIFICATION=“en\_US.UTF-8”  
LC\_ALL=

So any idea?

在 2016年5月7日星期六 UTC+8下午4:21:56，Andy写道：

---

<div class="post-metadata">

**Author:** ![Noam\_Greenberg](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Noam\_Greenberg](https://forum.ansible.com/u/Noam_Greenberg)\
**Post date:** [May 7, 2016, 10:40am UTC](https://forum.ansible.com/t/ansible-locale-issue/21377/3 "2016-05-07T10:40:26Z")

</div>

HI  
can you remove “pipelining = True” from the config and test ?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [May 7, 2016, 12:32pm UTC](https://forum.ansible.com/t/ansible-locale-issue/21377/4 "2016-05-07T12:32:35Z")

</div>

Your problem is that you likely have something in .bashrc that is spewing ascii escape codes.

---

<div class="post-metadata">

**Author:** ![Andy3](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Andy3](https://forum.ansible.com/u/Andy3)\
**Post date:** [May 8, 2016, 3:17pm UTC](https://forum.ansible.com/t/ansible-locale-issue/21377/5 "2016-05-08T15:17:42Z")

</div>

Thanks a lot ! Matt! After clean host test1 .bashrc, this issue gone away!  
I will dig out where is wrong in the .bashrc.

在 2016年5月7日星期六 UTC+8下午8:32:43，Matt Martz写道：

---

<div class="post-metadata">

**Author:** ![Andy3](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@Andy3](https://forum.ansible.com/u/Andy3)\
**Post date:** [May 8, 2016, 3:36pm UTC](https://forum.ansible.com/t/ansible-locale-issue/21377/6 "2016-05-08T15:36:48Z")

</div>

This issue caused by nvm, after install nvm , it generate two configs in .bashrc:

export NVM\_DIR=“/root/.nvm”  
[-s “$NVM\_DIR/nvm.sh”] && . “$NVM\_DIR/nvm.sh” # This loads nvm

These configs will lead ansible failed, does this an ansible bug? It will conflict with nvm.
