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
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1195801364442402856/image.png)
I've also tried setting the value with Postgres.DATABASE_PRIVATE_URL
looks good, what specific error are you getting in the logs?
![No description](https://answer-overflow-discord-attachments.s3.amazonaws.com/1195802555024933051/image.png)
This happens when I use Postgres.DATABASE_URL
at what point in your applications lifecycle do you see this error