Cannot deploy: php-fpm error

I apologize in advance if this topic is mis-categorized. This issue has taken many hours - and I’m stumped :{

When I try to deploy changes to staging by running ./bin/deploy.sh staging <my-site-name>, I get this error:

php7.1-fpm.service is not active, cannot reload.
fatal: [my-staging-ip-address]: FAILED! => {
    "changed": true, 
    "cmd": "sudo service php7.1-fpm reload", 
    "delta": "0:00:00.025174", 
    "end": "2018-11-21 18:26:44.825060", 
    "failed": true, 
    "invocation": {
        "module_args": {
            "_raw_params": "sudo service php7.1-fpm reload", 
            "_uses_shell": true, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": null, 
            "warn": false
        }
    }, 
    "rc": 1, 
    "start": "2018-11-21 18:26:44.799886", 
    "stderr": "php7.1-fpm.service is not active, cannot reload.", 
    "stderr_lines": [
        "php7.1-fpm.service is not active, cannot reload."
    ], 
    "stdout": "", 
    "stdout_lines": []
}

I am running

  • Ansible 2.3.0.0
  • Python 2.7.15rc1
  • Vagrant 2.0.2
  • on Linux

Has anyone come across this issue before?

I just hit this yesterday and had to remember how to fix it.

Did you recently upgrade Trellis? If so, compare the past few lines of group_vars/all/users.yml with the current master and see if they match.

My guess is that Ansible is trying to reload the wrong version of PHP.

I ran systemctl status and it looks like my local site is using php-fpm 7.1 and staging server is using 7.2 - but local site is a fresh install, so it should be up-to-date…

Would the solution be as simple as getting php-fpm7.2 installed locally, or am I missing the bigger picture?

You could try (backing up your database and) destroying the local VM and running vagrant up again. The two environments should be identical if you’re using Trellis.

I’ve done that a few times by now… no luck :{

The issue is definitely a mismatch between your Trellis config and your staging site’s software. You could try rebuilding the staging site to use PHP 7.1, or upgrading Trellis locally to use 7.2, but either way that’s the issue.