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:
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...
P
Percy•14d ago
Project ID:
033f39f1-9797-405f-88f8-343ca4ac4254
J
Jay•14d ago
033f39f1-9797-405f-88f8-343ca4ac4254
B
Brody•14d ago
can you send your dockerfile and railway.json?
J
Jay•14d ago
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.
B
Brody•14d ago
can you confirm that the dockerfile above is being used to run the build?
J
Jay•14d ago
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?
B
Brody•14d ago
full build logs please - https://bookmarklets.up.railway.app/log-downloader/
J
Jay•14d ago
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.
B
Brody•14d ago
I understand, but please open your build logs and if there are logs, download and send them
J
Jay•14d ago
There aren't any build logs when I'm making these changes but here's the previous versions build logs if it helps
B
Brody•14d ago
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?
J
Jay•14d ago
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.
B
Brody•14d ago
I understand redacting your terminal location, but the other stuff doesn't help, please send a new screenshot
J
Jay•14d ago
would it be okay to share the service name and environment here? that's the only redacted thing besides the terminal location
B
Brody•14d ago
unless you've named it something offensive, I don't see any issues
J
Jay•14d ago
okay, just a sec
J
Jay•14d ago
B
Brody•14d ago
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?
J
Jay•14d ago
J
Jay•14d ago
Basically yeah the config just holds where the docker file is relative to the project
B
Brody•14d ago
sorry where do those docs point out that you can set the path to the railway.json file?
J
Jay•14d ago
J
Jay•14d ago
or is it path to the directory to be deployed? sorry if I might have misunderstood it.
Solution
B
Brody•14d ago
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 -
J
Jay•14d ago
ah that's great! thanks @Brody.
Hang out with other likeminded developers & talk about all things https://railway.app on the Railway Community Server.
24KMembers
View on DiscordWant results from more Discord servers?
More PostsManually Deploy from Branch?There doesn't seem to be a clear way to manually deploy from a branch? I had a server that was auto Build Command Helpis it possible to make railway use dotnet 4.8 instead of 6.0?Read and write txt file in repositoryI have a github repository with a python script, Procfile, requirements.txt and points.txt but the pBuild PHP 7.3 with Laravel. How can i do it?I have an old application. How can i make build in service?TLS certificate has taken over 24 hours for a custom domainI have 2 custom domains - 1 using a subdomain and 1 using the root. The one on the subdomain is workRedis For Vector Search (GenAI)I have Redis database deployed on Railways Pro plan. I want to add LLM Retrieval Augmented GeneratioWhat is the best way to install private npm packages?My usecase is that my node app needs to install a package from a private github registry.
What I wouCron job not running at specific timeHi
I have a cron job that should run every hour 0 * * * *.
For some reason, it skips runs sometimHow much is Railways scalable?Is there any information how much it is scalable in reality?
According to the price, can the serviceCORS Policy problem with backboard.railway.app/graphqlI'm getting a CORS error in my console when using the Railway dashboard.
```
Access to fetch at 'hOutbound ip addressesHi, what are railway's outbound ip addressesBest way to setup back up system for my postgres?Looking to do a backup every X number of hoursRailway <> Hetzner servers cant communicateWe had a deployment running succesfully for the last week
today, the railway instances cant communihow to remove docker cache ?it is always just using cache, and not rebuilding correclyDeployment HelpApologies i have 3 things to deploy and i dont know how to do itCannot Access Railway APIJust noticed that I am unable to access the full public API and the GraphQL Playground isn't workingHow do I create a config file?In the [documentation](<https://docs.railway.app/guides/config-as-code>) for Railway configuration fRedis Connection FailureProject ID: d09cd450-b0ba-483f-ae0c-5e329305f433
Redis is refusing connnections.504 Gateway Timeout issueAll of a sudden my production application starts throwing up 504 error. There are no error logs and Vite React ThreejsI copy nixpacks.toml and Caddyfile from this repository
<https://github.com/brody192/vite-react-tem