Failure on provision development

I’m attempting to update php to 8.3 locally and getting the following error:

TASK [common : Update apt packages] ********************************************
fatal: [default]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: unknown reason"}

PLAY RECAP *********************************************************************
default                    : ok=4    changed=0    unreachable=0    failed=1    skipped=8    rescued=0    ignored=0   

exit status 2

Not sure how to proceed.

8.3 is not currently supported by Trellis.

I recently had the same error but it was related to apt-get update failing.

For starters, SSH in and run the command manually as Trellis normally would, so you can get a better idea of the actual error, maybe using -vvvv (verbose) may help too.

The reason it failed is because, globally the PGP key from NGINX has recently been updated (June 14th 2024). See announcement - Updating the PGP Key for NGINX Software – NGINX Community Blog

Their own instructions wasn’t working for me, but following this article did resolve for me:
https://chrisjean.com/fix-apt-get-update-the-following-signatures-couldnt-be-verified-because-the-public-key-is-not-available/

So, it may not be specifically do with PHP 8.3 (although if Trellis doesn’t support 8.3 then that’s also a blocker anyway), but instead you happen to be running apt-get update after the date they changed the keys. Try running a provision/apt-get update without any 8.3 changes just to confirm if you’re having that issue in general or it is because of PHP changes.

I am using Trellis version 1.21.0, therefore the later versions may handle this automatically, but I had to follow the above to sort.

2 Likes

Same here — this topic is missing a significant amount of details. Give us more information to avoid a lot of back and forth if you’re looking for help on this forum.

Thanks for this - helpful! I have run the apt-get update command inside the host and indeed get the nginx key issue problem. I will follow along with that link and report back.

Thanks for chiming in - the post you found on updating the keys did the trick for me. ssh’d into the host and updated that nginx key successfully.

I changed my php version to 8.2 (supported currently by trellis) and successfully provisioned my dev environment.