8 months ago
Hola equipo de soporte de Railway,
Estoy teniendo un problema persistente con el despliegue de mi servicio ludial-transport (backend) que antes funcionaba correctamente. A pesar de numerosas configuraciones y pasos de depuración, el despliegue sigue fallando en la etapa de construcción con errores relacionados con Nixpacks.
El despliegue de mi servicio backend (FastAPI, Python) está fallando durante la fase de construcción (Build Logs). El error principal es error: attribute 'dev' missing relacionado con postgresql_16.dev, lo que sugiere que Nixpacks está intentando instalar una dependencia que no encuentra o no es compatible.
Detalles del Proyecto:
Servicio afectado: ludial-transport
Repo de GitHub: jonatanalzate/ludial-transport
Root Directory en Railway: /backend/
Tecnologías: Python 3.9, FastAPI, Alembic, PostgreSQL (como add-on en Railway).
Pasos de depuración que ya he tomado (y observaciones):
Procfile configurado: He verificado que el Procfile en backend/Procfile está configurado para ejecutar las migraciones de Alembic (alembic upgrade head) antes de iniciar la aplicación (uvicorn).
alembic en requirements.txt: Me aseguré de que alembic==1.12.1 esté incluido en backend/requirements.txt.
Dockerfile para dependencias de sistema: He modificado mi Dockerfile para instalar explícitamente libpq-dev y build-essential usando apt-get (RUN apt-get update && apt-get install -y --no-install-recommends libpq-dev build-essential).
railway.toml configurado para Dockerfile y sin Nixpacks:
La sección [build] tiene builder = "DOCKERFILE" y dockerfilePath = "Dockerfile".
He añadido explícitamente nixpacks = false bajo la sección [build] para intentar deshabilitar la inferencia de Nixpacks.
He confirmado que las secciones [phases.setup] y [phases.build] están eliminadas del railway.toml.
Intentos de limpieza de caché:
He intentado desconectar y volver a conectar el repositorio de GitHub en la configuración de Railway.
He intentado usar railway up -- --clear-cache y railway up -- --build-args '--no-cache' desde el CLI local (después de instalar y vincular correctamente), pero el CLI no interpreta los argumentos de caché correctamente o devuelve errores (IO error, unexpected argument).
Observación: Aunque el despliegue falla en la etapa de construcción, la versión anterior de mi aplicación sigue funcionando y puedo hacer login. Sin embargo, las migraciones de la base de datos no se están aplicando debido a que los nuevos despliegues fallan. Los logs de construcción siguen mostrando los errores de nix-env con postgresql_16.dev, lo que sugiere que Nixpacks aún está interfiriendo en el proceso de construcción a pesar de nixpacks = false.
Por favor, ¿podrían investigar por qué Nixpacks sigue interfiriendo con mi proceso de construcción basado en Dockerfile, causando el error attribute 'dev' missing para postgresql_16.dev, y cómo podemos asegurar que Railway respete la configuración de mi Dockerfile y railway.toml para un despliegue exitoso?
Agradezco su ayuda con este asunto.
Atentamente,
Jonatan Rojas Alzate
jonatanalzate@hotmail.com
Pinned Solution
8 months ago
AFAIK you dont need a railway.toml if you are already using a Dockerfile.
4 Replies
8 months ago
Hello,
Apologies but we can only do support in English. Could you please re-send this email in English?
Best,
The Railway Team
Status changed to Awaiting User Response Railway • 8 months ago
chandrika
Hello,Apologies but we can only do support in English. Could you please re-send this email in English?Best,The Railway Team
8 months ago
Hello Chandrika, ok thank you very much.
I am experiencing a persistent build issue with my ludial-transport (backend) service that was previously deploying successfully. Despite numerous configuration attempts and debugging steps, the deployment continues to fail during the build phase with Nixpacks-related errors.
My backend service (FastAPI, Python) deployment is failing during the build phase (Build Logs). The primary error message is error: attribute 'dev' missing related to postgresql_16.dev, which suggests that Nixpacks is attempting to install a dependency it cannot find or that is incompatible.
Project Details:
Affected Service: ludial-transport
GitHub Repo: jonatanalzate/ludial-transport
Root Directory on Railway: /backend/
Technologies: Python 3.9, FastAPI, Alembic, PostgreSQL (as a Railway add-on).
Procfile configured: I have ensured that the Procfile in backend/Procfile is correctly configured to run Alembic migrations (alembic upgrade head) before starting the application (uvicorn).
alembic in requirements.txt: I have confirmed that alembic==1.12.1 is included in backend/requirements.txt.
Dockerfile for system dependencies: I have modified my Dockerfile to explicitly install libpq-dev and build-essential using apt-get (RUN apt-get update && apt-get install -y --no-install-recommends libpq-dev build-essential).
railway.toml configured for Dockerfile and without Nixpacks:
The [build] section has builder = "DOCKERFILE" and dockerfilePath = "Dockerfile".
I have explicitly added nixpacks = false under the [build] section to try and disable Nixpacks inference.
I have confirmed that the [phases.setup] and [phases.build] sections are removed from railway.toml.
Cache clearing attempts:
I have tried disconnecting and reconnecting the GitHub repository in Railway settings.
I have attempted to use railway up -- --clear-cache and railway up -- --build-args '--no-cache' from the local CLI (after correctly installing and linking the CLI), but the CLI does not interpret the cache arguments correctly or returns errors (IO error, unexpected argument).
While the deployment fails during the build stage, the previous version of my application is still running and I can log in. However, database migrations are not being applied because new deployments are failing. The build logs continue to show nix-env errors with postgresql_16.dev, which suggests that Nixpacks is still interfering with the build process despite nixpacks = false.
Could you please investigate why Nixpacks continues to interfere with my Dockerfile-based build process, causing the attribute 'dev' missing error for postgresql_16.dev, and how we can ensure Railway respects my Dockerfile and railway.toml configurations for a successful deployment?
Thank you for your assistance.
Sincerely,
Jonatan Rojas Alzate
Status changed to Awaiting Railway Response Railway • 8 months ago
8 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open sarahkb125 • 8 months ago
8 months ago
AFAIK you dont need a railway.toml if you are already using a Dockerfile.
8 months ago
Alex, thank you very much! Your guidance was key. I managed to solve the problem I described to you, and the best part is that it also allowed me to resolve other issues that arose from the root cause.
Status changed to Solved chandrika • 8 months ago
