I’m having some trouble updating an outdated PHP version on one of our sites. The site still runs PHP 7.1, so I decided to update it to 7.4. Since we have a bedrock/trellis setup, I figured the best mode of action was to update trellis. I did so on my local site, and PHP is updated! However, I can’t seem to push it to staging (and probably production as well).
When deploying, I get the following error:
TASK [deploy : Reload php-fpm] ******************************************************************************************************************
System info:
Ansible 2.9.0; Linux
Trellis version (per changelog): "Fix #1277 - Disable PHP CLI memory limit"
---------------------------------------------------
non-zero return code
Sorry, user web is not allowed to execute '/usr/sbin/service php7.4-fpm
reload' as root on XXXXXX.localdomain.
fatal: [107.170.41.149]: FAILED! => {"changed": true, "cmd": "sudo service php7.4-fpm reload", "delta": "0:00:00.009555", "end": "2021-08-10 18:43:09.898829", "rc": 1, "start": "2021-08-10 18:43:09.889274", "stderr_lines": ["Sorry, user web is not allowed to execute '/usr/sbin/service php7.4-fpm reload' as root on XXXXXX.localdomain."], "stdout": "", "stdout_lines": []}
Here’s the error from provisioning the staging server:
TASK [common : Checking essentials] *************************************************************************************************************
ok: [107.170.41.149] => (item=build-essential)
ok: [107.170.41.149] => (item=python-software-properties)
---------------------------------------------------
'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options
::=--force-confold" install 'unzip'' failed: E: Unmet dependencies. Try
'apt-get -f install' with no packages (or specify a solution).
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify
a solution).
failed: [107.170.41.149] (item=unzip) => {"ansible_loop_var": "item", "cache_update_time": 1628623139, "cache_updated": false, "changed": false, "item": {"key": "unzip", "value": "present"}, "rc": 100, "stderr_lines": ["E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nYou might want to run 'apt-get -f install' to correct these:\nThe following packages have unmet dependencies:\n linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "You might want to run 'apt-get -f install' to correct these:", "The following packages have unmet dependencies:", " linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed"]}
---------------------------------------------------
'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options
::=--force-confold" install 'imagemagick'' failed: E: Unmet
dependencies. Try 'apt-get -f install' with no packages (or specify a
solution).
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify
a solution).
failed: [107.170.41.149] (item=imagemagick) => {"ansible_loop_var": "item", "cache_update_time": 1628623139, "cache_updated": false, "changed": false, "item": {"key": "imagemagick", "value": "present"}, "rc": 100, "stderr_lines": ["E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nYou might want to run 'apt-get -f install' to correct these:\nThe following packages have unmet dependencies:\n imagemagick : Depends: imagemagick-6.q16 (= 8:6.8.9.9-7ubuntu5.16) but it is not going to be installed\n linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "You might want to run 'apt-get -f install' to correct these:", "The following packages have unmet dependencies:", " imagemagick : Depends: imagemagick-6.q16 (= 8:6.8.9.9-7ubuntu5.16) but it is not going to be installed", " linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed"]}
---------------------------------------------------
ok: [107.170.41.149] => (item=libnss-myhostname)
---------------------------------------------------
ok: [107.170.41.149] => (item=git)
---------------------------------------------------
ok: [107.170.41.149] => (item=curl)
---------------------------------------------------
'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options
::=--force-confold" install 'ghostscript'' failed: E: Unmet
dependencies. Try 'apt-get -f install' with no packages (or specify a
solution).
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify
a solution).
failed: [107.170.41.149] (item=ghostscript) => {"ansible_loop_var": "item", "cache_update_time": 1628623139, "cache_updated": false, "changed": false, "item": {"key": "ghostscript", "value": "present"}, "rc": 100, "stderr_lines": ["E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nYou might want to run 'apt-get -f install' to correct these:\nThe following packages have unmet dependencies:\n ghostscript : Depends: libgs9 (= 9.26~dfsg+0-0ubuntu0.16.04.14) but it is not going to be installed\n Depends: gsfonts (>= 6.0-1) but it is not going to be installed\n linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "You might want to run 'apt-get -f install' to correct these:", "The following packages have unmet dependencies:", " ghostscript : Depends: libgs9 (= 9.26~dfsg+0-0ubuntu0.16.04.14) but it is not going to be installed", " Depends: gsfonts (>= 6.0-1) but it is not going to be installed", " linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed"]}
---------------------------------------------------
ok: [107.170.41.149] => (item=python-mysqldb)
---------------------------------------------------
ok: [107.170.41.149] => (item=dbus)
---------------------------------------------------
'/usr/bin/apt-get -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options
::=--force-confold" install 'libgs-dev'' failed: E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify
a solution).
failed: [107.170.41.149] (item=libgs-dev) => {"ansible_loop_var": "item", "cache_update_time": 1628623139, "cache_updated": false, "changed": false, "item": {"key": "libgs-dev", "value": "present"}, "rc": 100, "stderr_lines": ["E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)."], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nYou might want to run 'apt-get -f install' to correct these:\nThe following packages have unmet dependencies:\n libgs-dev : Depends: libgs9 (= 9.26~dfsg+0-0ubuntu0.16.04.14) but it is not going to be installed\n Depends: libcups2-dev but it is not going to be installed\n Depends: libcupsimage2-dev but it is not going to be installed\n Depends: libfontconfig1-dev but it is not going to be installed\n Depends: libidn11-dev but it is not going to be installed\n Depends: libijs-dev but it is not going to be installed\n Depends: libjbig2dec0-dev but it is not going to be installed\n Depends: libjpeg-dev\n Depends: libpaper-dev but it is not going to be installed\n Depends: libpng12-0-dev\n Depends: libtiff5-dev but it is not going to be installed\n linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "You might want to run 'apt-get -f install' to correct these:", "The following packages have unmet dependencies:", " libgs-dev : Depends: libgs9 (= 9.26~dfsg+0-0ubuntu0.16.04.14) but it is not going to be installed", " Depends: libcups2-dev but it is not going to be installed", " Depends: libcupsimage2-dev but it is not going to be installed", " Depends: libfontconfig1-dev but it is not going to be installed", " Depends: libidn11-dev but it is not going to be installed", " Depends: libijs-dev but it is not going to be installed", " Depends: libjbig2dec0-dev but it is not going to be installed", " Depends: libjpeg-dev", " Depends: libpaper-dev but it is not going to be installed", " Depends: libpng12-0-dev", " Depends: libtiff5-dev but it is not going to be installed", " linux-headers-4.4.0-209-generic : Depends: linux-headers-4.4.0-209 but it is not going to be installed"]}
My instinct is to go onto the staging server and update PHP myself, but I’m not sure if that will break future deployments/provisions…