# .bashrc io to stdout interferes with ansible and ansible-playbook commands

**URL:** <https://forum.ansible.com/t/bashrc-io-to-stdout-interferes-with-ansible-and-ansible-playbook-commands/12444>\
**Category:** Ansible Project\
**Created:** [March 2, 2013, 1:45am UTC](https://forum.ansible.com/t/bashrc-io-to-stdout-interferes-with-ansible-and-ansible-playbook-commands/12444 "2013-03-02T01:45:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drcabana](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@drcabana](https://forum.ansible.com/u/drcabana)\
**Post date:** [March 2, 2013, 1:45am UTC](https://forum.ansible.com/t/bashrc-io-to-stdout-interferes-with-ansible-and-ansible-playbook-commands/12444/1 "2013-03-02T01:45:21Z")

</div>

Long story short: I was building out a system wherein the hadoop user’s .bashrc file was writing to stdout. This interfered with the functioning of the ansible and ansible-playbook commands. For instance:

» ansible -u hadoop --private-key=/home/drc/.ssh/obsidianaws.pem -i /home/drc/.ansible/hosts -m ping box1

box1 | FAILED =\> failed to open a SFTP connection

» ansible -u hadoop -c ssh --private-key=/home/drc/.ssh/obsidianaws.pem -i /home/drc/.ansible/hosts -m ping box1  
box1 | FAILED =\> failed to transfer file to /home/hadoop/.ansible/tmp/ansible-1362080597.37-11062316293652/ping:  
Received message too long 173490514

The hadoop account had no obvious ssh or authentication issues. It could shell into the box, issue commands, etc.

Removing hadoop’s bashrc file cleared up the problem. As a further test I created a single line .bashrc that just echoed text:  
echo “hello from .bashrc”

This sufficed to reproduce the problem illustrated above.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 2, 2013, 1:59am UTC](https://forum.ansible.com/t/bashrc-io-to-stdout-interferes-with-ansible-and-ansible-playbook-commands/12444/2 "2013-03-02T01:59:15Z")

</div>

I think there was a post about this earlier, and I was asking for a  
github ticket about it, and I got another post.

I'll file one 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 2, 2013, 2:01am UTC](https://forum.ansible.com/t/bashrc-io-to-stdout-interferes-with-ansible-and-ansible-playbook-commands/12444/3 "2013-03-02T02:01:13Z")

</div>

Ok filed here, this is an easy fix.

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

---

<div class="post-metadata">

**Author:** ![drcabana](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@drcabana](https://forum.ansible.com/u/drcabana)\
**Post date:** [March 2, 2013, 2:31am UTC](https://forum.ansible.com/t/bashrc-io-to-stdout-interferes-with-ansible-and-ansible-playbook-commands/12444/4 "2013-03-02T02:31:19Z")

</div>

I am finding this both hard to believe and hilarious. I did not get much sleep last night, but even so I cannot understand how I thought I was on github and instead was on google groups. Too many browser tabs open, too little awareness. Nature’s way telling me to go to sleep…

Thanks, Michael.

---

<div class="post-metadata">

**Author:** ![Daniel\_Hokka\_Zakriss](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@Daniel\_Hokka\_Zakriss](https://forum.ansible.com/u/Daniel_Hokka_Zakriss)\
**Post date:** [March 2, 2013, 9:47am UTC](https://forum.ansible.com/t/bashrc-io-to-stdout-interferes-with-ansible-and-ansible-playbook-commands/12444/5 "2013-03-02T09:47:05Z")

</div>

drcabana@gmail.com wrote:

> Long story short: I was building out a system wherein the hadoop user's  
> .bashrc file was writing to stdout. This interfered with the functioning  
> of the ansible and ansible-playbook commands. For instance:

.bashrc is executed for scripts and non-interactive commands. This is  
something that belongs in .bash\_profile, otherwise you are going to be  
messing up a whole slew of things, including scp/sftp.

Daniel
