R
Railway

✋|help

Cannot change default provider for environment thats created during GitHub Pull Request

Ddrewbie8/24/2023
I posted about this a while back (https://discord.com/channels/713503345364697088/1126899693549531136) but I cannot seem to get it to work. The default provider thats used when a PR is created is Deno, and I'd like it to be node. Ive added a nixpacks.toml file to the directory of the service thats being deployed but it doesnt seem to take effect. Any help is appreciated.
Ddrewbie8/24/2023
d36cedc3-d1a4-453b-9e36-45d7299cabfd
BBrody8/24/2023
please show us the nixpacks.toml file
Ddrewbie8/24/2023
Ddrewbie8/24/2023
the entire monorepo is deployed, and turbopack is used to run the command for this particular app yarn start --filter=relay - the nixpacks file is within the relay directory, not at the root of the application (we have other services that we dont want to use node as a provider for)
BBrody8/24/2023
single providers array with node, that side of things looks good to me
do you have a NIXPACKS_CONFIG_FILE variable set in the service?
Ddrewbie8/24/2023
Dont appear to. To be clear the production and staging environments use a node provider no problem. Its the auto-generated environments via a pull request that dont use it.
Only Nixpacks variable set in production/staging is NIXPACKS_NO_CACHE
BBrody8/24/2023
if you don't have the nixpacks.toml file in the same directory as what set in the service settings railway won't be able to find it, so you'll need to set that variable
Ddrewbie8/24/2023
the toml file is in the same directory as the service. What do I set the variable value to? Assuming I add the variable to production and to staging and it will work for the PR environments? Will this effect the prod/staging setups that are already working?
BBrody8/24/2023
okay so first, what is the root directory set to in the service settings?
and should the prod/staging environments be using node too?
Ddrewbie8/24/2023
root directory is not set -- the entire monorepo is deployed to this service and the command is just filtered to the particular package
for this particular service, yes
BBrody8/24/2023
though so, just had to check though
okay and what folder is this nixpacks.toml file in
and side question, do you know what is causing nixpacks to detect deno?
Ddrewbie8/24/2023
root/packages/relay/nixpacks.toml
I dont
BBrody8/24/2023
this that is the value you should set your NIXPACKS_CONFIG_FILE variable to
well of course minus the root, since I don't actually think you have a folder named root?
Ddrewbie8/24/2023
I do not. Can I set this under the Railway Config File Path option for the service? If the env var is set does it need to be set for staging and prod? Not sure what settings the PR environments use
Appreciate the help btw!
BBrody8/24/2023
yeah that would achieve the same thing, and that would probably also carry it across the environments too
tbh I've done extremely little with multi environments on railway, so my knowledge on the behaviour around this is lacking
Ddrewbie8/24/2023
Hmm just tried using that option and it didnt seem to pick it up
Railway config path is set to /packages/relay/nixpacks.toml
BBrody8/24/2023
and you're absolutely positively sure that's the correct path
Ddrewbie8/24/2023
Yeah
BBrody8/24/2023
also, would you be interested in showing me a screenshot of the files in the root of the project? maybe I'd see a reason for why railway thinks your using deno
Ddrewbie8/24/2023
Yeah Im good with that
BBrody8/24/2023
because if railway stopped thinking you where using deno, that would solve your problems too right?
you don't use deno for anything in this project, right?
Ddrewbie8/24/2023
It would - and there is a service that uses Deno within the packages directory
Ddrewbie8/24/2023
BBrody8/24/2023
then that is why, from the nixpacks docs
Deno is detected if there is a deno.{json,jsonc} file found or if any .{ts,tsx,js,jsx} file is found that imports something from deno.land.
so you really can't change the fact that something is importing something from deno land
Ddrewbie8/24/2023
BBrody8/24/2023
is it normal to have the rely app inside of the backend folder?
Ddrewbie8/24/2023
its not - they are both within /packages
BBrody8/24/2023
ah my bad
yeah I see that now lol
does that nixpacks.toml file show up in your repo?
Ddrewbie8/24/2023
Yeah its in there
BBrody8/24/2023
okay we'll try setting the NIXPACKS_CONFIG_FILE variable for the service
Ddrewbie8/24/2023
Ok I just moved the nixpacks file to the root of the entire monorepo, and changed the value of Railway Config File Path to nixpacks.toml and it works
Maybe the leading slash when it was within the packages/relay was throwing it off? Going to try that
BBrody8/24/2023
no, you definitely would need the leading forward slash, it's an absolute path after all
can I ask why you seem opposed to setting the NIXPACKS_CONFIG_FILE variable?
Ddrewbie8/24/2023
Im not - ill give that a try now
so set it in production and staging and set its value to /packages/relay/nixpacks.toml?
BBrody8/24/2023
yes, but move the file back into the relay folder
since backend is deno right?
Ddrewbie8/24/2023
and I just set this for the relay service im guessing, not in project shared
we host our search service in relay as well so figured it shouldnt be a global thing
BBrody8/24/2023
gotcha
Ddrewbie8/24/2023
Thats still using deno 🤔
BBrody8/24/2023
you've set the NIXPACKS_CONFIG_FILE variable?
Ddrewbie8/24/2023
BBrody8/24/2023
show me the build table at the top of the build logs please?
Ddrewbie8/24/2023
Ddrewbie8/24/2023
thats more promising - before it just couldnt build the app using deno vs node
BBrody8/24/2023
I wouldn't call that deno lol
make sure it's in the correct location in the branch you are deploying to railway?
Ddrewbie8/24/2023
Yeah its definitely in the repo
BBrody8/24/2023
and you are absolutely sure your root directory is left as / in the service settings?
Ddrewbie8/24/2023
it doesnt have any value set
I removed the leading slash, and the build doesnt error out not finding the file, but the provider is still deno
hmm maybe its using node cause the build even though the provider in the settings still says node, cause the build is underway
BBrody8/24/2023
what does the build table at the top of the build logs say?
Ddrewbie8/24/2023
Nixpacks file based configuration is experimental and may change
Ddrewbie8/24/2023
BBrody8/24/2023
yeah it says node
Ddrewbie8/24/2023
so thats with no root directory set (hasnt changed), and the NIXPACKS_CONFIG_FILE variable set to packages/relay/nixpacks.toml with no leading slash
BBrody8/24/2023
so all good?
Ddrewbie8/24/2023
and the provider in the settings still says Deno even though it actually used node
BBrody8/24/2023
haha dont worry about that
beta
Ddrewbie8/24/2023
yeah its working - this will effect prod and staging too since that variable was set there in the first place so as long as those continue to use node as they were i think were all good!
BBrody8/24/2023
awsome
Ddrewbie8/24/2023
Appreciate the help!
BBrody8/24/2023
no problem!

Looking for more? Join the community!

Recommended Posts
expressidkI'm not sure on how to transfer my wiki.js database data to railway.86f37e49-db7c-4b6f-9c3e-71f5447b116a I am either getting a broken wiki.js database that results in Build and deployment is accountable in service consumptionconsider in a context of docker image number of images downloaded and each operation performed in doQuestion about billHello i have a railway acount and i work with my accounting team but they need an tax number identifEnvironment Variable Not foundI am using nodejs as a backend and the config plugin with it to get the access to the Railway envoirERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sockI tried deleting my Railway proc file and getting this error now ERROR: Cannot connect to the DockerNeed wordpress template helpI have this error: Please contact your hosting service and ask them to increase max_input_vars valueCan't login using my emailHi there, I'm trying to login to my account using the magic link, but whenever I do it I get this erDjango Deployment Issue - 503 Error on Railway PlatformHello, I am encountering a 503 error ("Application failed to respond") while deploying my Django apAccessing application results in 502. "upstream connect error or disconnect/reset before headers. "Trying to publish an application to the railway platform. It is a mixture of react, together with soAbout Private networkingHi, I saw Railway has https://docs.railway.app/reference/private-networking Private network domain, refundThe estimated bill is $5, but the actual cost is $11.99, which is much higher than expected. I requeHelloHello, I added cascade = CascadeType.ALL to a OneToMany relationship in my DB. Works locally, but deCannot create code snapshot right nowProject ID `a0e71e1d-430e-45cc-95c5-af153af61c1c` "Cannot create code snapshot right now, please reDeploy my app on Railway (Cost)Hello, Actually I have an API made with Nodejs + Express about Real Estate so I wanna recommendatioHow do you add a worker to a Procfile?It seems that Railway only accepts "web", so how can I add a "worker" to a Procfile?Cannot create code snapshot right nowUnable to deploy across multiple services, both using CLI and branch-triggered deploys. The deploy lhosting fivem (https://fivem.net) server on railwaywould it be possible to host fivem on railway? there is linux binaries for hosting the server. is thHelp configuring express app for use with storage volumeHi, I hope this is the right forum for this question. I have an express app that is using middlewareNo waiving of $5 dollar fee, even though qualified.Can someone clarify the rules for having the fee waived? Based on the blog article from Railway, my