R
Railway14mo 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
Percy14mo ago
Project ID: 1a73e8f4-a61d-4a67-9bd7-3539b677698b
Lelebees
LelebeesOP14mo ago
1a73e8f4-a61d-4a67-9bd7-3539b677698b
Brody
Brody14mo ago
are you building with nixpacks?
Lelebees
LelebeesOP14mo ago
No, docker
Brody
Brody14mo ago
are you using an alpine based image?
Lelebees
LelebeesOP14mo ago
Yes, eclipse-temurin:17-jdk-alpine to be precise
Lelebees
LelebeesOP14mo 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
Brody14mo ago
cool, keep me posted if you run into any more issues
Lelebees
LelebeesOP14mo ago
Will do No dice, I still get timeouts
Brody
Brody14mo ago
at what point in your apps lifecyle are you making this request that results in a timeout?
Lelebees
LelebeesOP14mo 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
Brody14mo ago
its more like 2 seconds but yes
Lelebees
LelebeesOP14mo 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
Brody14mo ago
private network total initialization times dont exceed 3.7 seconds max average being 2 seconds
Lelebees
LelebeesOP14mo 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
Brody14mo 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
LelebeesOP14mo 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
Brody14mo ago
hopefully!
Lelebees
LelebeesOP14mo ago
just a quick question. Is there a difference between choosing servicename.railway.internal and the plain (you can also call me) servicename?
Brody
Brody14mo 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
LelebeesOP14mo ago
Okay, good to know! No luck. Connection timed out
Lelebees
LelebeesOP14mo ago
Just making sure, this is how the Alpine env var is supposed to look like, right?
No description
Brody
Brody14mo ago
well i wish i knew what the problem was, all i know is that it isnt railway
Lelebees
LelebeesOP14mo ago
ITS APLINE OHMYGOD
Brody
Brody14mo ago
omfg how did that happen?
Lelebees
LelebeesOP14mo ago
mobile ui i guess
Brody
Brody14mo ago
you didnt copy / paste?
Lelebees
LelebeesOP14mo 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
Brody14mo ago
hey i didnt catch it either when you asked me
Lelebees
LelebeesOP14mo 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
Brody14mo ago
finally solved!
Lelebees
LelebeesOP14mo ago
Yes, I assume so! I'll mark as solved on the link you sent a while back
Lelebees
LelebeesOP14mo ago
Thanks for your help Brody, and sorry for wasting your time over a spelling error
Brody
Brody14mo ago
haha no worries
Want results from more Discord servers?
Add your server