R
Railway13mo ago
joao

connecting to postgres with sqlx via private networking

hey, im just trying to deploy a simple rust rest api which uses sqlx. can't connect because the hostname is not being resolved, also couldnt connect because of some ssl issue which i would also like to solve but for now ive disabled ssl (it doenst really matter since they're communicating on the private network) seen here it takes a couple seconds for private networking to become available but it seems to retry for a few times after deployment but still fails. help
11 Replies
Percy
Percy13mo ago
Project ID: N/A
joao
joao13mo ago
N/A
Brody
Brody13mo ago
railways retries don't help in this case since it reruns the container and every time it does that private networking initialisation times still exist. are you building with nixpacks? have you tried adding a simple 5 second sleep in code before the connection attempt? (if you do this please use a healthcheck)
ramnivas
ramnivas13mo ago
@joao I believe you are experiencing the same SSL issue as I am. I have filed an issue https://github.com/railwayapp-templates/postgres-ssl/issues/6. Let's see.
GitHub
Issues · railwayapp-templates/postgres-ssl
Contribute to railwayapp-templates/postgres-ssl development by creating an account on GitHub.
joao
joao13mo ago
yeah that fixes it thanks might be, when I have time I’ll debug it better. can’t remember the error right now but I believe it was something in the lines of yours
Brody
Brody13mo ago
if the sleep for 5 second fixes it, its not an ssl error @ramnivas can you try a sleep for 5 seconds too?
ramnivas
ramnivas13mo ago
@Brody I am connecting from my laptop to an existing Railway Postgres service. Unclear, where I would add sleep. Please see the https://github.com/ramnivas/railway-postgres-rust repo for context.
GitHub
GitHub - ramnivas/railway-postgres-rust
Contribute to ramnivas/railway-postgres-rust development by creating an account on GitHub.
Brody
Brody13mo ago
gotcha, you didnt state where you where connecting from in your gh issue
ramnivas
ramnivas13mo ago
@Brody Good point. Updated the issue.
Brody
Brody13mo ago
no need for the pings, please read #🛂|readme #5
joao
joao13mo ago
i believe it was really an ssl problem, something separate from this issue yes th 5s wait fixes the conn but i had to disable ssl to be able to use
Want results from more Discord servers?
Add your server