Can't deploy with Postgres
I had an app deployed on Heroku, tried coming to Railway for better plans, but when I connect the repo to Railway I get and it crashes
14 Replies
Project ID:
c17693fa-8f81-4f00-ad4d-8f231f687806
It looks like manually defining DATABASE_URL worked for Desch, so that might be a solution for you. JustJake also suggested that you shouldn't need to manually define DATABASE_URL, so it might be worth checking that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
⚠️ experimental feature
c17693fa-8f81-4f00-ad4d-8f231f687806
It recognized my env variables automatically and setted them
but didn't work either
where is the database hosted
I thought the docker postgres image would be automatically loaded as it happens on heroku or other sites
unless its a template no, you need to add a database to your project then use the database environment variables to connect to it
how do I add it?
Its a Spring Java + Postgress
but I can't find it in templates
click desired project > + new > database > postgresql
then railway creates these variables for you to use in your code
https://docs.railway.app/databases/postgresql
is there no way to modify the DB variables I get?
Like, setting my own username and so?
not that i know of, though theres no need to, if the username and passwork gets leaked you can regen them
Oh, looks like I had misplaced a variable on my app.properties, thanks a bunch!
no problem
Wait, no, new error after setting all variables:
Driver org.postgresql.Driver claims to not accept jdbcUrl
This pops up when it tries to connect to the right url provided by railway
Finally got it to work! Thanks!