# Issue running playbook with ansible-navigator vs ansible-playbook

**URL:** <https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679>\
**Category:** Get Help\
**Tags:** ansible-navigator, ubuntu, ee\
**Created:** [April 2, 2024, 2:00pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679 "2024-04-02T14:00:29Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjbright](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@mjbright](https://forum.ansible.com/u/mjbright)\
**Post date:** [April 2, 2024, 2:00pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/1 "2024-04-02T14:00:29Z")

</div>

**Playbook fails when using ansible-navigator but works when using ansible-playbook**

Forgive me if something simple. I normally only deal with network equipment, but I do have a few linux servers setup in a lab that I use for testing. I’m working on converting all of my playbooks over to use execution environments rather than virtual environments. I have the below simple playbook named testee.yml

```auto
---
- name: Test EE
  hosts: labpostgresqlpri
  gather_facts: true
  become: true

  tasks:
    - name: Display Facts
      ansible.builtin.debug:
        msg: "{{ ansible_facts }}"

```

When running the playbook with the below command in my venv, everything works fine and facts are gathered

```auto
ansible-playbook testee.yml

```

However, if I run the playbook with command

```auto
ansible-navigator run testee.yml

```

I get the below error

```auto
 "msg": "Failed to connect to the host via ssh: Warning: Permanently added '10.157.30.10' (ED25519) to the list of known hosts.\r\nmuxserver_listen: link mux listener /runner/.ansible/cp/f14c1f486c.gJF2W84mz59ox16y => /runner/.ansible/cp/f14c1f486c: Bad file descriptor"

```

Full Error Output

```auto
<10.157.30.10> ESTABLISH SSH CONNECTION FOR USER: mjbright
<10.157.30.10> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/runner/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="mjbright"' -o ConnectTimeout=10 -o 'ControlPath="/runner/.ansible/cp/f14c1f486c"' 10.157.30.10 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /tmp `"&& mkdir "` echo /tmp/ansible-tmp-1712064682.7009747-20-45230970465614 `" && echo ansible-tmp-1712064682.7009747-20-45230970465614="` echo /tmp/ansible-tmp-1712064682.7009747-20-45230970465614 `" ) && sleep 0'"'"''
<10.157.30.10> (255, b'', b"Warning: Permanently added '10.157.30.10' (ED25519) to the list of known hosts.\r\nmuxserver_listen: link mux listener /runner/.ansible/cp/f14c1f486c.gJF2W84mz59ox16y => /runner/.ansible/cp/f14c1f486c: Bad file descriptor\r\n")
fatal: [labpostgresqlpri]: UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: Warning: Permanently added '10.157.30.10' (ED25519) to the list of known hosts.\r\nmuxserver_listen: link mux listener /runner/.ansible/cp/f14c1f486c.gJF2W84mz59ox16y => /runner/.ansible/cp/f14c1f486c: Bad file descriptor",
    "unreachable": true
}

```

Ansible Version

```auto
ansible-playbook [core 2.15.5]
  config file = /Users/mjbright/Documents/projects/production_projects/ansible/tb_server_mgmt/ansible.cfg
  configured module search path = ['/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible-playbook
  python version = 3.9.16 (main, Sep 12 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

```

I have searched high and low and can’t find anything referencing this error. What does this error mean? Host is an Ubuntu Server

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [April 2, 2024, 2:44pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/2 "2024-04-02T14:44:54Z")

</div>

Why are you getting Windows newlines `\r\n`? That’s really weird. Are you running this from WSL?

---

<div class="post-metadata">

**Author:** ![mjbright](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@mjbright](https://forum.ansible.com/u/mjbright)\
**Post date:** [April 2, 2024, 3:38pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/3 "2024-04-02T15:38:59Z")

</div>

Running on MacOS. Apologies, forgot to mention that.

---

<div class="post-metadata">

**Author:** ![TheSpy0](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thespy0/32/496_2.png) [@TheSpy0](https://forum.ansible.com/u/TheSpy0)\
**Post date:** [April 15, 2024, 1:51pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/4 "2024-04-15T13:51:22Z")

</div>

If you haven’t looked at the [Ansible Navigator FAQ](https://ansible.readthedocs.io/projects/navigator/faq/) page, you might check there to see if there’s anything that’s helpful for you. I’m wondering if there’s an issue with your SSH keys not being passed to the execution environment like they’re supposed to be.

---

<div class="post-metadata">

**Author:** ![SilentRhetoric](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/silentrhetoric/32/4121_2.png) [@SilentRhetoric](https://forum.ansible.com/u/SilentRhetoric)\
**Post date:** [July 8, 2024, 12:57am UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/5 "2024-07-08T00:57:16Z")

</div>

I get this same error when trying to complete the tutorial at [https://ansible.readthedocs.io/en/latest/getting\_started\_ee/run\_execution\_environment/#run-against-a-remote-target](https://ansible.readthedocs.io/en/latest/getting_started_ee/run_execution_environment/#run-against-a-remote-target).

```auto
fatal: [192.168.1.198]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Warning: Permanently added '192.168.1.198' (ED25519) to the list of known hosts.\r\npi@192.168.1.198: Permission denied (publickey,password).", "unreachable": true}

```

---

<div class="post-metadata">

**Author:** ![iyami5](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iyami5/32/3449_2.png) [@iyami5](https://forum.ansible.com/u/iyami5)\
**Post date:** [July 8, 2024, 12:38pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/6 "2024-07-08T12:38:27Z")

</div>

Are you using ssh-add or passing a password when you ssh?

---

<div class="post-metadata">

**Author:** ![SilentRhetoric](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/silentrhetoric/32/4121_2.png) [@SilentRhetoric](https://forum.ansible.com/u/SilentRhetoric)\
**Post date:** [July 9, 2024, 12:01am UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/7 "2024-07-09T00:01:11Z")

</div>

Following the tutorial to the letter:

 ![Untitled](https://us1.discourse-cdn.com/ansible/original/2X/a/aad96ba5162b47deaefd14b392caec037c4196e4.jpeg)

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [July 9, 2024, 2:30pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/8 "2024-07-09T14:30:21Z")

</div>

You’re getting a different error than OP. Instead of “Bad file descriptor”, you’re getting “permission denied”; meaning it doesn’t trust your ssh key. This means that you skipped a step (or the tutorial you’re using missed a step) to add your ssh public key to the remote user’s authorized\_keys file.

In your snippit, you can `ssh-copy-id pi@192.168.1.198` to remedy this. If you don’t have that command, `cat ~/.ssh/id_ed25519.pub`, copy the output, `ssh pi@192.168.1.198` append the public key contents to authorized\_keys `echo {paste contents from earlier} >> ~/.ssh/authorized_keys`.

Then try the playbook again.

---

<div class="post-metadata">

**Author:** ![SilentRhetoric](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/silentrhetoric/32/4121_2.png) [@SilentRhetoric](https://forum.ansible.com/u/SilentRhetoric)\
**Post date:** [July 9, 2024, 10:08pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/9 "2024-07-09T22:08:17Z")

</div>

To be clear, I get the same “Bad file descriptor” error like OP if I follow the steps on the page I linked, with the error arising after Step 4.

After following your steer to follow the SSH key forwarding approach just below Step 4, then it produces the different “Permission denied” error I screenshotted just above your last reply.

Both of these things are true.

Now, if I do `ssh-copy-id` I am told that the keys are already on the remote system:

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/2/2815223722459589288f15f50cedcdb1bd147271.png)

I can also confirm this by visually inspecting the authorized\_keys list on 192.168.1.198.

So I’m still stuck and neither approach on the Running your EE page works, with each approach producing one error or the other.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [July 10, 2024, 1:21pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/10 "2024-07-10T13:21:44Z")

</div>

Are you also running from MacOS like @mjbright?

There appears to be a known issue between ansible-navigator and ssh-agent, possibly due to an underlying issue with docker and MacOS.

[SSH Agent Forwarding With MacOS and Docker Desktop · Issue #1591 · ansible/ansible-navigator (github.com)](https://github.com/ansible/ansible-navigator/issues/1591)

[Mac - ssh-agent forwarding - ee container asks ssh key passphrase · Issue #1623 · ansible/ansible-navigator (github.com)](https://github.com/ansible/ansible-navigator/issues/1623)

---

<div class="post-metadata">

**Author:** ![SilentRhetoric](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/silentrhetoric/32/4121_2.png) [@SilentRhetoric](https://forum.ansible.com/u/SilentRhetoric)\
**Post date:** [July 10, 2024, 6:15pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/11 "2024-07-10T18:15:43Z")

</div>

Yep, MacOS + Docker.

Thanks for connecting the dots to those issues. Discouraging to see that they’ve sat for nearly a year.

Feel free to tag me if those get resolved and I’d be happy to give Ansible another try.

Until next time 🫡

---

<div class="post-metadata">

**Author:** ![iyami5](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iyami5/32/3449_2.png) [@iyami5](https://forum.ansible.com/u/iyami5)\
**Post date:** [July 10, 2024, 6:17pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/12 "2024-07-10T18:17:52Z")

</div>

You can still use ansible. That’s just a specific issue with Docker and MacOS. I haven’t checked and see if it works with podman.

---

<div class="post-metadata">

**Author:** ![SilentRhetoric](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/silentrhetoric/32/4121_2.png) [@SilentRhetoric](https://forum.ansible.com/u/SilentRhetoric)\
**Post date:** [July 10, 2024, 6:58pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/13 "2024-07-10T18:58:56Z")

</div>

> [@iyami5](#):
>
> That’s just a specific issue with Docker and MacOS

Would be more accurately stated as

> [@](#):
>
> That’s a **show-stopping** issue with **my entire tech stack and intended use case**

---

<div class="post-metadata">

**Author:** ![iyami5](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iyami5/32/3449_2.png) [@iyami5](https://forum.ansible.com/u/iyami5)\
**Post date:** [July 10, 2024, 7:00pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/14 "2024-07-10T19:00:49Z")

</div>

Sure, was just pointing that part out.

---

<div class="post-metadata">

**Author:** ![woodbb](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/woodbb/32/5086_2.png) [@woodbb](https://forum.ansible.com/u/woodbb)\
**Post date:** [January 29, 2025, 3:09pm UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/15 "2025-01-29T15:09:09Z")

</div>

I had this same issue, but removed ControlPersist from my ssh config in ansible.cfg and my playbooks started running fine. Also on OSX/docker (same issue with podman).

From:  
[ssh\_connection]  
ssh\_args = -C -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

To:  
[ssh\_connection]  
ssh\_args = -C -o ControlMaster=auto -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

---

<div class="post-metadata">

**Author:** ![jpleasant](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jpleasant/32/10167_2.png) [@jpleasant](https://forum.ansible.com/u/jpleasant)\
**Post date:** [January 24, 2026, 4:44am UTC](https://forum.ansible.com/t/issue-running-playbook-with-ansible-navigator-vs-ansible-playbook/4679/16 "2026-01-24T04:44:57Z")

</div>

Disabling controlMaster worked for me. I have it setup in a pip environment so there’s no config. So I set an environment variable export ANSIBLE\_SSH\_ARGS=“-o ControlMaster=no” and that worked. I tried to set the argument on the command line and on the inventory file but neither worked, possibly because I’m within the python virtualized environment
