Getting a "prefix not found" error when running railway up
I'm trying to deploy a monorepo via railway CLI but only one of the repos is deployed on railway, so i'm using Docker to do so and using railway.json inside the repo folder for the configuration. When I run
railway up --servicename --environment <PATH_TO_RAILWAY_JSON>
I'm getting a prefix not found error.
Is there a way to know where the error is/how to fix it?
Thanks!Solution:Jump to solution
yeah that's not a path to a railway.json file
either way, there is a far better way to set the path to your dockerfile, delete the railway.json and set this service variable -
```
RAILWAY_DOCKERFILE_PATH=/docker/prod/api/Dockerfile.api...
25 Replies
Project ID:
033f39f1-9797-405f-88f8-343ca4ac4254
033f39f1-9797-405f-88f8-343ca4ac4254
can you send your dockerfile and railway.json?
Hey @Brody , sorry for the late reply but here it is
railway.json
Dockerfile
For some more context, this used to work when I only had a single service I wanted to deploy to railway and had the same config in root of the monorepo. But I want to add multiple services to railway with each having their own Dockerfile and thats where it is starting to break.
can you confirm that the dockerfile above is being used to run the build?
how can I do so? the railway up command's first output is the 'prefix not found' message and then it quits before getting to docker build. Is there another way besides it to check it?
full build logs please - https://bookmarklets.up.railway.app/log-downloader/
Sorry but the issue is that the build isn't even getting started since I'm deploying via the CLI only and the service isn't associated with a Git repo.
I understand, but please open your build logs and if there are logs, download and send them
There aren't any build logs when I'm making these changes but here's the previous versions build logs if it helps
okay can I see a screenshot of the error in the cli?
and just to be double clear, does a build even show up in the service when it fails from the cli?
Here's the screenshot with some info redacted. And no the build doesn't even show up in the service when it fails from the CLI.
I understand redacting your terminal location, but the other stuff doesn't help, please send a new screenshot
would it be okay to share the service name and environment here? that's the only redacted thing besides the terminal location
unless you've named it something offensive, I don't see any issues
okay, just a sec
specifying a path to the railway.json file isn't valid syntax as far as I know
but you are only using it to set the path of the dockerfile right?
Basically yeah the config just holds where the docker file is relative to the project
sorry where do those docs point out that you can set the path to the railway.json file?
or is it path to the directory to be deployed? sorry if I might have misunderstood it.
Solution
yeah that's not a path to a railway.json file
either way, there is a far better way to set the path to your dockerfile, delete the railway.json and set this service variable -
ah that's great! thanks @Brody.