𝐗-𝐥𝐞𝐦
Explore posts from serversDatabase private url not working
I'm assuming one's the internal port and one's the external port.
If your AFW-bot has an env called
Core.DATABSE_URL
and it's set to ${{Postgres.DATABASE_URL}}
then it should work. I'm not sure what else the issue would be :/64 replies
Database private url not working
@Anubhav
Make sure you're giving enough time for the private network to initialize.
Currently, private networks take up to 3 seconds to initialize on deploy. ... If you experience errors like those above, consider implementing a sleep or other wait mechanism in your app, before attempting to connect.https://docs.railway.app/guides/private-networking#initialization-time
64 replies
Connect database locally
They'll both count towards your usage. It's just better to use a private URL within your service.
See: https://railway.app/changelog/2024-07-19-database-private-networking#database-private-network-defaults
17 replies
Connect database locally
The AFW-bot can connect to the postgres instance. You should use the private DB url for that though.
You can add a env variable to
AFW-bot
(will be something like ${{Postgres.DATABASE_PRIVATE_URL}}
). Then just grab that env variable in your python application to connect to the DB.17 replies