"More than one MPM loaded" crash at runtime, but apache2ctl configtest passes at build time
rayan-nb
FREEOP

a month ago

My Dockerfile-based service (php:8.4-apache) crashes on every deploy with:

AH00534: apache2: Configuration error: More than one MPM loaded.

repeated every second, looping via the restart policy.

What I've verified:

  • Locally, building the exact same Dockerfile (including with --platform linux/amd64 to match your builder) produces a working image every time: only mpm_prefork is present in /etc/apache2/mods-enabled, apache2ctl -M shows only mpm_prefork_module, and the container serves requests fine.
    • I added RUN apache2ctl configtest as a build step (after removing mpm_event/mpm_worker/mpm_itk .load/.conf files from mods-available, not just mods-enabled). This passes successfully during your build (visible in build logs), which should mean the config is valid at image-build time.
    • Despite that, every deploy of this image still crashes at runtime with the same "More than one MPM loaded" error, immediately on container start.
    • I tried three different fixes across three deploys (a2dismod, rm -f on mods-enabled, rm -f on mods-available) — same error every time on Railway, none reproducible locally.
    • I don't have a way to get a live shell into the crash-looping container to inspect further (no running instance for Console, and I wasn't able to set up SSH key auth in this session to use railway ssh).

Project: fantastic-growth, service: peakr-app

Latest crashed deployment ID: ec6ad130-16dc-4295-bbd3-bcf8afd8960f

Any idea what could cause the running container to see two loaded MPM modules when the built image itself doesn't (verified via configtest at build time and via direct local inspection)? Is there anything platform-side (health checks, process re-exec, base image resolution) that could re-introduce this at runtime?

$10 Bounty

1 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway about 1 month ago


a month ago

I tried to reproduce this issue and fix it with solution posted here, you can try add a2dismod mpm_worker && a2enmod mpm_prefork on your start command and see if it works


Welcome!

Sign in to your Railway account to join the conversation.

Loading...