📣 [Laravel] Fix for error "Failed due to unhealthy allocations"

Due to an update in the base image used for Laravel when running fly launch you may need to update your Dockerfile.

Symptoms that this issue affects you include:

  1. Failed deployment with a "Failed due to unhealthy allocations" error
  2. Log output that includes something like s6 requires pid 1

The fix (for now) is here.

TL;DR: Change your base container’s tag within your Dockerfile:

- FROM serversideup/php:${PHP_VERSION}-fpm-nginx as base
+ FROM serversideup/php:${PHP_VERSION}-fpm-nginx-v1.5.0 as base
5 Likes

@Yaeger I’m thinking of you here specifically, LMK if you hit this.

I was about to post an angry message on the forum :stuck_out_tongue_winking_eye: thanks. I will try this fix.

Seems to work fine :+1: thanks!

Great, glad that worked!

You need to do something to get stability. I lost more 2 hours today because of that…

I agree, this was an unfortunate update made by the base Docker image for Laravel (which isn’t one we maintain).

The addition of the v1.5.0 tag was a trade off made after discussing it with the maintainers (who wanted to move forward with their updates - which is fair. Fly’s use case is a bit odd, and it’s not their fault we decided to use them for our base image, nor that s6 decided to enforce the need to be pid 1 when its monitoring processes), but it has the side effect of … this happening.

I have my own rants for days on Dockerizing PHP in general, but I’ll save that for Twitter.

5 Likes

floating this to the top

This issue still occur in 2025. Is there any option other than downgrading the image to v1.5 ?

Are you specifically getting the s6-overlay-suexec: fatal: can only run as pid 1 message in the logs?

(There have been developments the past few months about allowing things to run as PID 1, though if you’re interested in those new workarounds, I’d suggest posting a fresh top-level topic, so it can be tagged #containers, etc.—for better visibility. Not everyone who might be interested in helping necessarily follows 10 comments down in the Laravel channel…)