a year ago
Currently I have my app running on railway with postgres, but the app is connected to db via hostname + port + etc instead of URL. And it's via external url. When I try change to internal my app crushes, same with when I'm trying to use a URL: I get an error
Error during migration run: TypeError: Invalid URL
I suspect there must be problem with that I launch migrations in dockerfile entrypoint (which calls npm run typeorm:run-migrations:prod && npm run start:prod)
I tried to find some guides on how to correctly set it all up but couldn't find any, so I'm asking here for help.
Thank you in advance.
18 Replies
I tried to remove migrations. I continue to get this error when using internal db url

a year ago
have you verified that the URL is valid to begin with?
I have environment variable. DB_URL. Locally everything works fine. On the railway when I put there ${{Postgres.DATABASE_URL}} everything works like a charm but with${{Postgres.DATABASE_PRIVATE_URL}}I get the abovementioned error. Copying value directly and putting it in the field also gives error

a year ago
so if you saved that reference value and then copied its value it would indeed be the correct url?
I don't understand your question, sorry. Do you ask if I checked spelling? I copy pasted it directly from and tried alternatively copy pasting not the name of the reference but the value itself.
a year ago
looks like you have private networking disabled
a year ago
go ahead and enable that from within the service settings (doesnt matter what service)
Yeah hostname was empty and new URI() didn't like it
Thank you, trying it out!
Can you please point me to which sleep command will work in railway environment?
a year ago
switch your runtime to v2 and you wont need to use sleep
a year ago
all good?
a year ago
branch?
a year ago
ah, ill mark it as solved
a year ago
!s
Status changed to Solved brody • about 1 year ago