R
Railway13mo ago
Lelebees

Internal network timeout

I'm running a Discord4J bot on Railway, and I have also deployed my Postgres database to railway. When i use the internet connection URL, I have no issues connecting from app to db, but when I enter the internal networking url, it works for a bit, and then starts timing out (relevant error: Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.) What could be causing this, and how do i fix it? It's not a very pressing issue: I can still use the internet url, but i'd rather use the internal network if possible
35 Replies
Percy
Percy13mo ago
Project ID: 1a73e8f4-a61d-4a67-9bd7-3539b677698b
Lelebees
Lelebees13mo ago
1a73e8f4-a61d-4a67-9bd7-3539b677698b
Brody
Brody13mo ago
are you building with nixpacks?
Lelebees
Lelebees13mo ago
No, docker
Brody
Brody13mo ago
are you using an alpine based image?
Lelebees
Lelebees13mo ago
Yes, eclipse-temurin:17-jdk-alpine to be precise
Lelebees
Lelebees13mo ago
Having her redeploy now, lets see if it works Well, she booted. Gonna keep her running to verify that it works, although it seems like it should
Brody
Brody13mo ago
cool, keep me posted if you run into any more issues
Lelebees
Lelebees13mo ago
Will do No dice, I still get timeouts
Brody
Brody13mo ago
at what point in your apps lifecyle are you making this request that results in a timeout?
Lelebees
Lelebees13mo ago
The app is getting data from the db every minute, and every 5 minutes. It most certainly happens on the 1-minute schedule, but I cannot tell if the 5-minute one has the same issue It also times out when booting, but that should be because of the 100 ms internal network bootup time, no?
Brody
Brody13mo ago
its more like 2 seconds but yes
Lelebees
Lelebees13mo ago
Hmm, it does so for significantly longer (well over a minute) Maybe i didnt set the variable correctly? Hmm, no it looks correct
Brody
Brody13mo ago
private network total initialization times dont exceed 3.7 seconds max average being 2 seconds
Lelebees
Lelebees13mo ago
Interesting. You reckon it being an ipv6 connection might be what's throwing a spanner in the works? Oh, it could be worthwhile to try updating the dependencies i'm using to manage and connect to the database. Will get back to you on that in like, 12 hours
Brody
Brody13mo ago
there is a lot of stuff that doesn’t play nicely with ipv6, so yeah that could be an issue. ill run a cron job that attempts 12 database connections every minute and get back to you on that too ran the 12 tests every minute all night, no errors
Lelebees
Lelebees13mo ago
Well, good news, it no longer takes a minute to connect to the internal network on startup (after i updated spring to 3.1.5 (from 3.1.2) and postgres driver to 42.6.0 (from 42.5.4)) Fingers crossed that that was it
Brody
Brody13mo ago
hopefully!
Lelebees
Lelebees13mo ago
just a quick question. Is there a difference between choosing servicename.railway.internal and the plain (you can also call me) servicename?
Brody
Brody13mo ago
no they would return the exact same dns results i have seen some software not place nicely with servicename.railway.internal and only work with servicename or vice versa, but that isnt an issue with railway https://utilities.up.railway.app/dns-lookup?value=hello-world.railway.internal&type=ip https://utilities.up.railway.app/dns-lookup?value=hello-world&type=ip
Lelebees
Lelebees13mo ago
Okay, good to know! No luck. Connection timed out
Lelebees
Lelebees13mo ago
Just making sure, this is how the Alpine env var is supposed to look like, right?
No description
Brody
Brody13mo ago
well i wish i knew what the problem was, all i know is that it isnt railway
Lelebees
Lelebees13mo ago
ITS APLINE OHMYGOD
Brody
Brody13mo ago
omfg how did that happen?
Lelebees
Lelebees13mo ago
mobile ui i guess
Brody
Brody13mo ago
you didnt copy / paste?
Lelebees
Lelebees13mo ago
I should stop manually copying variables This looks very promising, it didn't even crash on startup Oh why am i so incredibly stupid
Brody
Brody13mo ago
hey i didnt catch it either when you asked me
Lelebees
Lelebees13mo ago
The only reason i caught it is because i misspelled aplin alpine in my message and i thought i'd give it another look
Brody
Brody13mo ago
finally solved!
Lelebees
Lelebees13mo ago
Yes, I assume so! I'll mark as solved on the link you sent a while back
Lelebees
Lelebees13mo ago
Thanks for your help Brody, and sorry for wasting your time over a spelling error
Brody
Brody13mo ago
haha no worries
Want results from more Discord servers?
Add your server