Unnable to connect database service after migration
I made the migration from database legacy plugin to database service as requested using the one-click automated migration, after that my API service started crashing because it was unable to connect with my database service. I've tried to connect with the database service using the DATABASE_PRIVATE_URL and DATABSE_URL and none of this worked
Solution:Jump to solution
stick to using DATABASE_URL for now
please try this solution https://discord.com/channels/713503345364697088/1194241277517115443/1194568475071483944...
21 Replies
Project ID:
N/A
numerous-twist
Project ID: 24a05dcd-a288-4ba9-8e93-246f8cb9f0fb
can you connect to the database locally with something like dbgate?
Yes
what environment variable do you use in your code to connect to the database?
I runned my API service locally using the public connection string and worked correctly
DATABASE_URL
and you have that set as a service variable?
Yup
are you using the reference variable syntax? as shown here https://docs.railway.app/guides/variables#referencing-another-services-variable
I've also tried setting the value with Postgres.DATABASE_PRIVATE_URL
looks good, what specific error are you getting in the logs?
This happens when I use Postgres.DATABASE_URL
at what point in your applications lifecycle do you see this error
If I set the ENV variable to Postgres.DATABASE_PRIVATE_URL the error shows on deploy phase. with the value set to Postgres.DATABASE_URL happens when starting up the service
Solution
stick to using DATABASE_URL for now
please try this solution https://discord.com/channels/713503345364697088/1194241277517115443/1194568475071483944
still having the same problem
show me how you have implemented their proposed fix please
nevermind, it was my bad π
Thanks a lot Brody!
no problem!