Deploy gets stuck at the Build stage without any message or error
indigital-kuba
PROOP

2 months ago

Hi,

we have a deployment issue with our project - deployment freezes at the ‘Build’ stage without any information and crashes after 10 minutes. The project configuration is definitely correct, as the latest deployments (1 month ago) were error-free, and it also works correctly locally (docker build & run).

During the first crash, an error related to MPM occurred.

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

We made changes in line with another project that had this error and it works, but a problem arose with the entire deployment process freezing.

Dockerfile

FROM php:8.2-apache

RUN apt-get update && apt-get install -y \
    git \
    unzip \
    libzip-dev \
    && docker-php-ext-install zip mysqli pdo pdo_mysql \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html

COPY . .

RUN chown -R www-data:www-data /var/www/html/web/app \
    && chmod -R 775 /var/www/html/web/app

RUN composer install --no-dev --optimize-autoloader

ENV APACHE_DOCUMENT_ROOT /var/www/html/web

RUN sed -ri -e "s!/var/www/html!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/sites-available/*.conf && \
    sed -ri -e "s!/var/www/!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

RUN echo "upload_max_filesize = 1024M" >> /usr/local/etc/php/conf.d/uploads.ini \
    && echo "post_max_size = 1024M" >> /usr/local/etc/php/conf.d/uploads.ini \
    && echo "memory_limit = 1536M" >> /usr/local/etc/php/conf.d/uploads.ini \
    && echo "max_execution_time = 600" >> /usr/local/etc/php/conf.d/uploads.ini \
    && echo "max_input_time = 600" >> /usr/local/etc/php/conf.d/uploads.ini

RUN a2enmod rewrite
RUN a2dismod mpm_event mpm_worker || true
EXPOSE 80

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

entrypoint.sh

#!/bin/bash
# entrypoint.sh
mkdir -p /var/www/html/web/app/uploads
chown -R www-data:www-data /var/www/html/web/app/uploads

set -e

a2dismod mpm_event 2>/dev/null || true

a2dismod mpm_worker 2>/dev/null || true

a2dismod mpm_prefork 2>/dev/null || true

a2enmod mpm_prefork

exec apache2-foreground

Project ID: 76047aa1-3a16-4188-a445-a37ee3f063e4.

13 Replies

2 months ago

Hmmm,
I'm looking around and not really seeing much indicating an issue here.

Is it alright if I trigger a redeploy to see some logs?


Status changed to Awaiting User Response Railway about 2 months ago


noahd

Hmmm, I'm looking around and not really seeing much indicating an issue here. Is it alright if I trigger a redeploy to see some logs?

indigital-kuba
PROOP

2 months ago

Yes, go ahead.

As I mentioned, Docker runs this project correctly locally, so it looks like the problem is on Railway's side.


Status changed to Awaiting Railway Response Railway about 2 months ago


Railway
BOT

2 months ago

Hello!

We've escalated your issue to our engineering team.

We aim to provide an update within 1 business day.

Please reply to this thread if you have any questions!

Status changed to Awaiting User Response Railway about 2 months ago


2 months ago

We found what was the issue and implemented a quick fix! You should see your service live and all subsequent redeploys should work just fine.

We're going to dive in deeper on Monday to make sure this doesnt happen again in the future.


indigital-kuba
PROOP

2 months ago

Has this problem been resolved globally? We have six identical projects, and the problem has already appeared in two of them. Will the other four also require Railway to implement a fix?


Status changed to Awaiting Railway Response Railway about 2 months ago


2 months ago

Could you link the 2 services having the problem?

We're still working on a global fix to make sure the edge case doesnt happen again.

Any more services you have would be great to see!


Status changed to Awaiting User Response Railway about 2 months ago


indigital-kuba
PROOP

2 months ago

My mistake, those two projects I mentioned had a different error (More than one MPM loaded) and the deployment stage was running.

List of projects with the same environment configuration, the service that encountered an error with a frozen build in each of them has the same naming convention - suffix -wp):

  • 76047aa1-3a16-4188-a445-a37ee3f063e4

  • 25264d12-9a35-4ef1-9bc7-d916a4b12e92

  • cd10205f-6dfd-4eb1-a508-5b11e996e613

  • 6b329fbe-7dbb-443e-b163-d2b9d32a7aca

  • d487f232-6be3-4913-8b5b-a4d3fd3f30e2

(You may trigger a redeployment to verify these projects.)

Please let me know once you have implemented the fixes, as we need to be sure that we can work with the projects.


Status changed to Awaiting Railway Response Railway about 2 months ago


Railway
BOT

2 months ago

🛠️ The ticket Unable to deploy has been marked as in progress.


2 months ago

Hmmm are you able to give me a link to the services in those projects having that deploy error?
Would love to be able to nail down which of them are encountering it.


Status changed to Awaiting User Response Railway about 2 months ago


indigital-kuba
PROOP

2 months ago

At this point, this deploy error has only occurred in this service:

/project/76047aa1-3a16-4188-a445-a37ee3f063e4/service/bc88f635-5882-4e87-89b7-05b0b6041025?environmentId=22e0968d-6b4b-4d00-a8a9-2eb02d637614


Status changed to Awaiting Railway Response Railway about 2 months ago


Railway
BOT

2 months ago

✅ The ticket Unable to deploy has been marked as completed.


2 months ago

I'm not seeing it but if you do run into it again please let me know! Would love to investigate then


Status changed to Awaiting User Response Railway about 2 months ago


indigital-kuba
PROOP

a month ago

@noahd,

please recheck project 76047aa1-3a16-4188-a445-a37ee3f063e4. The project is still not deploying correctly, even though it was working fine before.

Warning: require(/var/www/html/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /var/www/html/web/index.php on line 6

Fatal error: Uncaught Error: Failed opening required '/var/www/html/web/wp/wp-blog-header.php' (include_path='.:/usr/local/lib/php') in /var/www/html/web/index.php:6 Stack trace: #0 {main} thrown in /var/www/html/web/index.php on line 6

We rolled back the project to January 9, and it is now working correctly, but we are unable to make any changes after that date because there was a build freeze before, and after you fixed it, the project itself does not work.

The rest of our projects have the same configuration (WP Bedrock + Dockerfile) and there are no such problems there.


Status changed to Awaiting Railway Response Railway about 1 month ago


a month ago

These look like errors with the actual application build itself. We unfortunately cannot help you with that as it's an application level error


Status changed to Awaiting User Response Railway about 1 month ago


Loading...