# AWX: ssh debug: Mux\_client\_read\_packet: read header failed: Broken pipe

**URL:** <https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827>\
**Category:** Get Help\
**Tags:** ai, awx, linux\
**Created:** [September 27, 2024, 5:59pm UTC](https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827 "2024-09-27T17:59:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartinGM](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MartinGM](https://forum.ansible.com/u/MartinGM)\
**Post date:** [September 27, 2024, 5:59pm UTC](https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827/1 "2024-09-27T17:59:41Z")

</div>

My team has installed AWX [(Kurokobo - awx-on-k3s)](https://github.com/kurokobo/awx-on-k3s) , we have worked with Windows servers without problems, however, it does not work with any Linux distribution, since in all our tests we get the error:  
mux\_client\_read\_packet: header read failed: broken pipe

We have tested with these parameters:  
ansible\_network\_cli\_ssh\_type: paramiko  
ansible\_ssh\_common\_args: ‘-o StrictHostKeyChecking=no’

However, the problem has not been solved.

I would greatly appreciate any ideas on how to solve this problem.

I suspect that it is not the SSH connection, since from the same AWX container the connection to the Linux servers was established without problems.

module\_stdout: ‘’  
module\_stderr: “OpenSSH\_8.7p1, OpenSSL 3.2.2 4 Jun 2024\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug3: /etc/ssh/ssh\_config line 55: Including file /etc/ssh/ssh\_config.d/50-redhat.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config.d/50-redhat.conf\r\ndebug2: checking match for ‘final all’ host 192.168.1.33 originally 192.168.1.33\r\ndebug3: /etc/ssh/ssh\_config.d/50-redhat.conf line 3: not matched ‘final’\r\ndebug2: match not found\r\ndebug3: /etc/ssh/ssh\_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512]\r\ndebug1: configuration requests final Match pass\r\ndebug2: resolve\_canonicalize: hostname 192.168.1.33 is address\r\ndebug1: re-parsing configuration\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug3: /etc/ssh/ssh\_config line 55: Including file /etc/ssh/ssh\_config.d/50-redhat.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config.d/50-redhat.conf\r\ndebug2: checking match for ‘final all’ host 192.168.1.33 originally 192.168.1.33\r\ndebug3: /etc/ssh/ssh\_config.d/50-redhat.conf line 3: matched ‘final’\r\ndebug2: match found\r\ndebug3: /etc/ssh/ssh\_config.d/50-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512]\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts’ → ‘/runner/.ssh/known\_hosts’\r\ndebug3: expanded UserKnownHostsFile ‘~/.ssh/known\_hosts2’ → ‘/runner/.ssh/known\_hosts2’\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 = 34\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 1\r\nShared connection to 192.168.1.33 closed.\r\n”  
msg: |-  
MODULE FAILURE  
See stdout/stderr for the exact error  
rc: 1  
\_ansible\_no\_log: false  
changed: false

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 28, 2024, 1:32pm UTC](https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827/2 "2024-09-28T13:32:40Z")

</div>

@MartinGM  
I noticed that you posted the same question on my repo. Just a heads up, that’s not really the best way to go about it. Please check my comment on my repo:

> Please do not post the same question in different places unless you explicitly mention that you have posted it elsewhere and provide the link to it. Even if a question you submitted to a particular place receives a response, others may not be aware of it from different places. Someone unaware of this might spend their time in good faith trying to help you elsewhere, which is not ideal.  
> [No Working with Linux(Centos/Ubuntu): Mux\_client\_read\_packet: read header failed: Broken pipe · Issue #394 · kurokobo/awx-on-k3s · GitHub](https://github.com/kurokobo/awx-on-k3s/issues/394#issuecomment-2380633188)

Could you please share your actual task which is failed in your playbook? I believe you are using `command` module.

Also:

- Test the connection with `ansible.builtin.ping` module.
- Ensure the python (`/usr/bin/python3`) is available on the target nodes.

The error message you’ve mentioned is not critical and may be safely ignored. As you can see from the logs, the SSH connection was successful multiple times. Only the SSH to invoke python script on the target node with `sudo` was failed.

👇 Exit with `0` (Success)

```bash
<192.168.1.33> SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="-awx-idx"' -o ConnectTimeout=10 -o 'ControlPath="/runner/cp/7fe6eec243"' 192.168.1.33 '/bin/sh -c '"'"'echo ~-awx-idx && sleep 0'"'"''
<192.168.1.33> (0, b'/home/-awx-idx\\n', b'OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024

```

```bash
<192.168.1.33> SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="-awx-idx"' -o ConnectTimeout=10 -o 'ControlPath="/runner/cp/7fe6eec243"' 192.168.1.33 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/-awx-idx/.ansible/tmp `"&& mkdir "` echo /home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409 `" && echo ansible-tmp-1727424460.7293117-27-219517984534409="` echo /home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409 `" ) && sleep 0'"'"''
<192.168.1.33> (0, b'ansible-tmp-1727424460.7293117-27-219517984534409=/home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409\\n', b"OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024

```

```bash
<192.168.1.33> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="-awx-idx"' -o ConnectTimeout=10 -o 'ControlPath="/runner/cp/7fe6eec243"' '[192.168.1.33]'
<192.168.1.33> (0, b'sftp> put /runner/.ansible/tmp/ansible-local-22f7z4o24r/tmpdcpqh9cw /home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409/AnsiballZ_command.py\\n', b'OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024

```

```bash
<192.168.1.33> SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="-awx-idx"' -o ConnectTimeout=10 -o 'ControlPath="/runner/cp/7fe6eec243"' 192.168.1.33 '/bin/sh -c '"'"'chmod u+x /home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409/ /home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409/AnsiballZ_command.py && sleep 0'"'"''
<192.168.1.33> (0, b'', b"OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024

```

```bash
<192.168.1.33> SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="-awx-idx"' -o ConnectTimeout=10 -o 'ControlPath="/runner/cp/7fe6eec243"' 192.168.1.33 '/bin/sh -c '"'"'rm -f -r /home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409/ > /dev/null 2>&1 && sleep 0'"'"''
<192.168.1.33> (0, b'', b"OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024

```

👇 Exit with `1` (Failure)

```bash
<192.168.1.33> SSH: EXEC sshpass -d12 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="-awx-idx"' -o ConnectTimeout=10 -o 'ControlPath="/runner/cp/7fe6eec243"' -tt 192.168.1.33 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-adbixplamxegrlniuihqpxmigiapopvm ; /usr/bin/python3 /home/-awx-idx/.ansible/tmp/ansible-tmp-1727424460.7293117-27-219517984534409/AnsiballZ_command.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<192.168.1.33> (1, b'', b"OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024

```

---

<div class="post-metadata">

**Author:** ![MartinGM](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MartinGM](https://forum.ansible.com/u/MartinGM)\
**Post date:** [September 28, 2024, 3:59pm UTC](https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827/3 "2024-09-28T15:59:54Z")

</div>

Thank you for your suggestion regarding the duplicity of the post, it is the first time I create a post.

Currently my team uses an AWX, which was developed a couple of years ago (I don’t know its source), and where we have been working on our templates for both Windows and Unix. But when trying to deploy a new version of AWX, during the migration of the templates, only the Unix playbooks present the problem that I showed in the previous post.

Answering your question, the module we use from ansible is: Shell.

The playbook starts by executing this task:

- name: Get information about Unix System  
ansible.builtin.shell: uname  
register : check\_unix

---

<div class="post-metadata">

**Author:** ![Dexrva](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Dexrva](https://forum.ansible.com/u/Dexrva)\
**Post date:** [September 30, 2024, 2:24pm UTC](https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827/4 "2024-09-30T14:24:34Z")

</div>

Hi Martin,

Are yo able to resolve this issue? I’ve the same problem

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 30, 2024, 3:12pm UTC](https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827/5 "2024-09-30T15:12:50Z")

</div>

Hmm could you try adding following lines in your `ansible.cfg`? If you don’t have `ansible.cfg` yet, create and place it at the root of the project.

Attempt: Disable ControlMaster

```ini
[ssh_connection]
ssh_args = -o ControlMaster=no

```

Attempt: Use paramiko

```ini
[defaults]
transport = paramiko

```

---

<div class="post-metadata">

**Author:** ![MartinGM](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@MartinGM](https://forum.ansible.com/u/MartinGM)\
**Post date:** [September 30, 2024, 10:05pm UTC](https://forum.ansible.com/t/awx-ssh-debug-mux-client-read-packet-read-header-failed-broken-pipe/8827/6 "2024-09-30T22:05:48Z")

</div>

Thank you!! The templates already work.

#Unix Server: Disable ControlMaster  
[ssh\_connection]  
ssh\_args = -o ControlMaster=no

#Unix Server: Use paramiko  
[defaults]  
transport = paramiko
