R
Railway12mo ago
ramnivas

Error creating a template

I am trying to create a template (-n9Md7 currently unpublished) based on this project (id: 462b54b8-a74e-4132-8c36-8530315ad71e) and faced a couple of issues: - I expected that the variable bindings (DATABASE_PRIVATE_URL -> ${{Postgres.DATABASE_PRIVATE_URL}} and DATABASE_URL to ${{Postgres.DATABASE_URL}} to have been populated in the template. They weren't. - I defined those bindings in the template manually. When I try to publish the template, I get "Missing variable details": "Please add description or default values for all variables". Any ideas on fixing this?
22 Replies
Percy
Percy12mo ago
Project ID: 462b54b8-a74e-4132-8c36-8530315ad71e
Brody
Brody12mo ago
when you create a template from a project the variable names are copied over, but not the variable values
No description
Brody
Brody12mo ago
instead of going through and setting those all up, fork the postgres template https://railway.app/button?code=postgres then go back and edit it, change the template name, and then add your service to it
ramnivas
ramnivas12mo ago
Thanks. But how would I create bindings in my Exograph service to Postgres variables (binding by reference such as ${{Postgres.DATABASE_PRIVATE_URL}})?
Brody
Brody12mo ago
you already did, heres a completed template https://railway.app/template/eMpJru and heres the forkable link https://railway.app/button?code=eMpJru ive just embedded your railway-template into it
ramnivas
ramnivas12mo ago
Thanks. I need to grok Railway's templating system. When I tried to deploy using your template, I got a repo conflict error. I want to create a repository such as https://github.com/exograph/railway-template with a "Deploy to Railway" button. When someone visiting that repo clicks the button, they fork it into one of their repo and deploy that to Railway. Is the way I am approaching the right way to go?
GitHub
GitHub - exograph/railway-template: Railway template to deploy a si...
Railway template to deploy a simple Exograph server - GitHub - exograph/railway-template: Railway template to deploy a simple Exograph server
Brody
Brody12mo ago
yes, that will clone the repo included in the template service into the users github account, but you cant have two repos with the same name so you are asked to change the name
ramnivas
ramnivas12mo ago
I am not able to use this template to create a new project. I added the button for the template you provided to https://github.com/exograph/railway-template and tried a few ways. Click "Deploy to Railway" and I get to the template page (as expected) and then either of the following: - Click on "Deploy now". I get "Repo name collision". - Click on "Config" for "railway-template" to specify a different repo name. I get "Ready to be deployed", but the "Deploy" button is disabled.
GitHub
GitHub - exograph/railway-template: Railway template to deploy a si...
Railway template to deploy a simple Exograph server - GitHub - exograph/railway-template: Railway template to deploy a simple Exograph server
Brody
Brody12mo ago
Click on "Deploy now". I get "Repo name collision".
yes, github doesnt allow you to have two repos with the same name
Click on "Config" for "railway-template" to specify a different repo name. I get "Ready to be deployed", but the "Deploy" button is disabled.
screenshots please
ramnivas
ramnivas12mo ago
No description
No description
Brody
Brody12mo ago
you need to configure postgres configure > save config
ramnivas
ramnivas12mo ago
About the first, of course. However I imagined that the UI would prompt me to do a clone.
Brody
Brody12mo ago
railway is not going to overwrite any existing repos that would bring so many issues
ramnivas
ramnivas12mo ago
Success! Thank you so much for your (as always) prompt and precise help.
Brody
Brody12mo ago
of course!
ramnivas
ramnivas12mo ago
However, I am unsure if I would go with the template approach. The main draw was a "One click deploy"
Brody
Brody12mo ago
someone who doesnt have a repo with the same name wont get that error
ramnivas
ramnivas12mo ago
I see. I will try that.
Brody
Brody12mo ago
you have the repo with the same name since you created the repo
ramnivas
ramnivas12mo ago
There was an additional issue. The initial deployment failed. I will investigate more, but it seemed like the Postgres service wasn't ready in time for the Exograph service to use it. I needed to redeploy the Exograph service to make it succeed. I kind of expected this since no service dependency is expressed in the template, but it may confuse a newcomer.
Brody
Brody12mo ago
use nc in the start command to ping the database on a loop and exit when it can ping it thank you for the trains!!
ramnivas
ramnivas12mo ago
You are welcome!
Want results from more Discord servers?
Add your server