a month ago
Hi Railway Support,
I’m having an issue with my deployment.
I previously had a file cloud_storage.py
in my repo that imported the mega
library. I have since completely removed this file and all references to it in my codebase. I also confirmed with:
git ls-files | grep cloud_storage.py
That the file no longer exists in the branch I’m deploying (railway-setup
).
However, when I deploy to Railway, the build still fails with:
ModuleNotFoundError: No module named 'mega'
File "/app/backend/main.py", line 27, in <module>
from cloud_storage import CloudStorageNonInteractive
File "/app/cloud_storage.py", line 8, in <module>
from mega import Mega
This is confusing because cloud_storage.py
has been removed from my repo. It looks like Railway is caching an old copy of the file somewhere during the build.
Steps I’ve tried already:
Removed
cloud_storage.py
from the repo and committed the deletion.Verified it’s not present with
git ls-files
.Forced a clean rebuild with
git commit --allow-empty -m "Force Railway clean rebuild"
.Changed regions to try and invalidate caches.
Despite all of this, the error persists, and the deployment still finds /app/cloud_storage.py
.
Could you please help me:
Fully clear any build cache or container layers that might be retaining
cloud_storage.py
.Confirm that Railway is building from the latest commit on the
railway-setup
branch.
Thanks in advance for your help — I just want to ensure the deployment uses the fresh repo state without stale files.
Best regards,
Ali Khan
5 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
a month ago
Have you tried running this in a completely new deployment instead of trying in the current one?
a month ago
Do you mean a new project
a month ago
I suggest you to use the "SSH into your service" feature to dive into the container and examine the actual file list that you end up with on it. The simplest way of doing this is to right click on the service, select the "Copy SSH command" and paste it into your terminal