# FATAL: all hosts have already failed -- aborting

**URL:** <https://forum.ansible.com/t/fatal-all-hosts-have-already-failed-aborting/14941>\
**Category:** Ansible Project\
**Created:** [April 4, 2014, 4:02pm UTC](https://forum.ansible.com/t/fatal-all-hosts-have-already-failed-aborting/14941 "2014-04-04T16:02:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc.petrivelli](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/marc.petrivelli/32/3773_2.png) [@marc.petrivelli](https://forum.ansible.com/u/marc.petrivelli)\
**Post date:** [April 4, 2014, 4:02pm UTC](https://forum.ansible.com/t/fatal-all-hosts-have-already-failed-aborting/14941/1 "2014-04-04T16:02:21Z")

</div>

I am getting

_FATAL: all hosts have already failed – aborting_

even though none of the hosts are showing any errors. This problem starting creeping up in the 1.5.x releases. Any ideas?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 4, 2014, 6:10pm UTC](https://forum.ansible.com/t/fatal-all-hosts-have-already-failed-aborting/14941/2 "2014-04-04T18:10:12Z")

</div>

Without more context, it’s impossible to tell what you mean, as this is exactly the message you get after all the hosts have had failures.

Please supply some more context about your playbook run, execution, and so on, and we can discuss further.

---

<div class="post-metadata">

**Author:** ![marc.petrivelli](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/marc.petrivelli/32/3773_2.png) [@marc.petrivelli](https://forum.ansible.com/u/marc.petrivelli)\
**Post date:** [April 4, 2014, 7:51pm UTC](https://forum.ansible.com/t/fatal-all-hosts-have-already-failed-aborting/14941/3 "2014-04-04T19:51:41Z")

</div>

This is an interesting side effect of using local tasks vs plays with hosts: 127.0.0.1.

In my case I was running a playbook and on the command line limiting with -l command.

ansible-playbook -l host1 site.yml

in the play book I had the following play:

`  
hosts: localhost  
user: root  
tasks:

- file: path=“tmp/file1.txt” state=absent
- file: path=“tmp/file2.txt” state=absent  
`

The plays in the playbook all finished successfully however at the end I got the error listed in the subject of this post: _FATAL: all hosts have already failed – aborting._

Looking at the source (lib/ansible/callbacks.py and lib/ansible/playbook/ **init**.py) this error seems to be spit out when (but not only when) the the expected play\_count/host\_count minus the actual play\_count/host\_count is greater than the max fail pct (in my case 0).

I figured that having an explicit play with localhost might be confusing the counts. So I changed my code to:

`

- hosts: dhcp\_servers  
user: root  
tasks:
- local\_action: file path=“tmp/file1.txt” state=absent
- local\_action: file path=“tmp/file2.txt” state=absent  
`

The FATAL at the end of the run disappeared. Not sure if it matters but in my inventory file I do have this line:

`localhost ansible_ssh_host=127.0.0.1 ansible_connection=local`

Something doesn’t seem right here.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [April 5, 2014, 1:55am UTC](https://forum.ansible.com/t/fatal-all-hosts-have-already-failed-aborting/14941/4 "2014-04-05T01:55:29Z")

</div>

It could very well be that the “implicit localhost” magic doesn’t sit well with the failure percentage code – please make sure we have a github ticket on this one with details of how to repro.

Thanks!
