Railway Deploy Failing with ModuleNotFoundError after Rollback - No Build/Deploy Logs Available
victorfgomees
PROOP

2 months ago

Hi folks! Any idea of what is happening here?

Environment

  • Platform: Railway (Nixpacks builder)

  • Framework: FastAPI/Python 3.13

  • Issue: Deployment crashes immediately on startup, and after rollback, no build/deploy logs are showing

Problem Description

I pushed a commit that added a new Python module (main_line_tracker.py) which was imported by an existing service (x_scraper_service.py). However, the new file was accidentally not committed to git, only the import statement was included.

This caused the deployment to fail with:

ModuleNotFoundError: No module named 'app.services.main_line_tracker'

The issue is: After rolling back to a known working commit, Railway is not showing any build logs or deploy logs. The Deploy Logs tab shows "No logs in this time range" and the deployment just shows "Failed" without any diagnostic information.

What Happened

  1. I had a working deployment at commit 1

  2. I pushed commit 2 which modified x_scraper_service.py to add:

    from .main_line_tracker import MainLineTracker
    
  3. The file main_line_tracker.py existed locally but was not tracked by git (it was in .gitignore or simply never added)

  4. The deployment failed with the ModuleNotFoundError shown in the runtime logs

  5. I then added the missing file and pushed commit 3

  6. Deployment still failed

  7. I rolled back to commit 1 (the last known working state)

  8. Now Railway shows no build logs and no deploy logs at all, the deployment just fails silently

Error Log (from before rollback)

File "/app/src/app/main.py", line 96, in <module>
  from .routers.scraping_router import router as scraping_router
File "/app/src/app/routers/scraping_router.py", line 19, in <module>
  from ..services.x_scraper_service import XScraperService
File "/app/src/app/services/x_scraper_service.py", line 38, in <module>
  from .main_line_tracker import MainLineTracker
ModuleNotFoundError: No module named 'app.services.main_line_tracker'

What I've Tried

  1. Rolling back to a previously working commit

  2. Waiting for logs to appear (they never do)

  3. Checking Railway status page (no reported incidents)

  4. The frontend (Vercel) deploys normally from the same repository

Questions

  1. Why would a rollback to a known working commit still fail without showing any logs?

  2. Is there a way to force Railway to clear its cache and do a completely fresh build?

  3. Could the repeated crash loop (the container kept restarting every few seconds) have put the service in a bad state?

Additional Context

The runtime logs before rollback showed the container was in a crash loop, it would start, fail with the ModuleNotFoundError, then Railway would immediately try to restart it. This happened continuously for several minutes.

After rollback, I can't see any logs at all, neither build logs nor deploy logs appear in the dashboard.

Solved

3 Replies

victorfgomees
PROOP

2 months ago

I see that its stuck on Creating Containers, the build was successful, however, i dont have any deploy logs, only build.


victorfgomees
PROOP

2 months ago

Duplicating the service solved


2 months ago

Glad its working now! I looked around and don't see too much indicating an error.
You are using nixpacks though. Switching to Railpack might fix parts of it.


Status changed to Awaiting User Response Railway 2 months ago


Railway
BOT

2 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway about 2 months ago


Loading...