Php7.0-fpm.service failed when provisioning AWS

I have followed a few threads on here to get the ansible playbook to provision an Ubuntu 16.04 EC2 instance. Server IP addresses have been changed to protect the innocent.

The provisioning runs until it tries to start php7 and returns with the following error:

System info:
  Ansible 2.1.1.0; Darwin
---------------------------------------------------
Job for php7.0-fpm.service failed because the control process exited with
error code. See "systemctl status php7.0-fpm.service" and "journalctl -xe"
for details.

fatal: [1.1.1.1]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"arguments": "", "enabled": true, "name": "php7.0-fpm", "pattern": null, "runlevel": "default", "sleep": null, "state": "started"}, "module_name": "service"}}

I have to diagnose the errors by running the suggested commands when directly ssh’d into the box.


systemctl status php7.0-fpm.service

â—Ź php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2016-11-16 11:44:58 UTC; 16min ago
     Docs: man:php-fpm7.0(8)
  Process: 31625 ExecStart=/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf (code=exited, status=78)
 Main PID: 31625 (code=exited, status=78)

journalctl -xe

Hint: You are currently not seeing messages from other users and the system.
      Users in the 'systemd-journal' group can see all messages. Pass -q to
      turn off this notice.
No journal files were opened due to insufficient permissions.

Permission denied seems to be an issue but not sure if that’s the cause, or even what that is required for.

The Start php7.0-fpm service task sometimes fails with this message when you rerun the server.yml playbook after the playbook failed previously. If you haven’t already, you may want to update your Trellis to at least roots/trellis#682, which tries to prevent this. However, the output from your systemctl status php7.0-fpm.service doesn’t suggest it is the exact same problem.

If you can just start with a fresh EC2 instance, that would probably be the simplest option to try first. Otherwise, you could try the command below on your current instance, then rerun server.yml:


Using sudo, you may find some relevant debug info in the root user’s systemd journal:

sudo journalctl -xe
4 Likes