FATAL: all hosts have already failed

Noob question

After a previous Ansible fail due to other already fixed issue i’ve run ‘vagrant reload --provision’ and get stuck on this error:

 TASK: [php | Start php5-fpm service] ****************************************** 
  failed: [default] => {"failed": true}

 FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/Users/rui/dev.retry

default                    : ok=29   changed=0    unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Thanks in advance

I’ve tried ‘vagrant destroy’ and then vagrant up and the issue persist

setting hhvm: true i was able to go forward but now im getting the 502 bad gateway from nginx

1 Like

I am having the same issue.

1 Like

There’s a known issue right now about this. See https://github.com/roots/bedrock-ansible/issues/150

It will hopefully be fixed soon.

1 Like

I have the same issue as the original one. Anything we can do to fix it without using hhvm?

This is actually an issue with Ansible: https://github.com/roots/bedrock-ansible/issues/205

To get it working, downgrade Ansible to 1.9.0.1, or remove these lines: https://github.com/roots/bedrock-ansible/blob/master/roles/php/tasks/main.yml#L20-21

2 Likes

I downgraded ansible to 1.9.0.1 and am still having this issue.

==> default: TASK: [php | Install PHP 5.6] *********************
==> default: ****************************
==> default: ok: [127.0.0.1] => (item=php5-common,php5-fpm,php5-mysqlnd,php5-xmlrpc,php5-mcrypt,php5-curl,php5-gd,php5-cli,php-pear,php5-dev,php5-imap)
==> default:
==> default: TASK: [php | Start php5-fpm service] ******************************************
==> default: failed: [127.0.0.1] => {"failed": true}
==> default:
==> default: FATAL: all hosts have already failed -- aborting
==> default:
==> default: PLAY RECAP ********************************************************************
==> default:            to retry, use: --limit @/root/dev.retry
==> default:
==> default: 127.0.0.1                  : ok=28   changed=0    unreachable=0    failed=1
{ bedrock-ansible } master » ansible --version                /d/projects/utility/bedrock-ansible
ansible 1.9.0.1
  configured module search path = None
{ bedrock-ansible } master »                                  /d/projects/utility/bedrock-ansible

Any other fixes I should be aware of? I’d love to get this thing working.

Is there any followup on this? I have seen that the issue is upstream in the Ansible repo. Have they released a patched version that resolves the issue?

If I remove those two lines from the main.yml task file, should I expect any wonkiness on my end?

There’s no new Ansible release out yet. Not sure how it would be happening on the downgraded version. You could always try going another version down.

Removing those lines isn’t the end of the world. You’d just have to manually start php-fpm at some point. Although for development this would probably cause the WP installs to fail.

You could replace those lines with this manual command:

- name: Start php5-fpm service
  command: service php5-fpm start

Still failing. You also need to modify https://github.com/roots/bedrock-ansible/blob/master/roles/common/handlers/main.yml#L11-12 to this:

- name: Restart php5-fpm service command: service php5-fpm restart

2 Likes

@romero2k Chaning those lines didn’t work for me. Ended up with this error after updating both files:

TASK: [php | Add php.ini template] ********************************************
changed: [default]
ERROR: change handler (reload php-fpm) is not defined
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Yeah didn’t work for me too,

I had an error with “task Start php5-fpm” so I replaced the command in :


by

- name: Start php5-fpm service
  command: service php5-fpm start

But i had a new error so i replaced too the line in roles/common/handlers/main.yml by :

- name: Restart php5-fpm service
  command: service php5-fpm restart

And my error now is :

==> default: ERROR: change handler (reload php-fpm) is not defined

Any solution ?

Thanks

Well you’ve renamed the handler so you need to update that whenever it’s called.

The old handler is reload php-fpm so search for that and replace it with the new name you gave it.

Closing this thread as it’s a known issue in Ansible with a fix already (use a different version).