a year ago
This morning I woke up to some strange network-related errors.
I am running a small Node.js application, which pulls data from a Redis service in the same project once per minute. Based on the results of that Redis query, an HTTP API is queried (I use the Axios.js library for web requests).
At 22:38:03 PST, I received the following error: AxiosError: connect EHOSTUNREACH 144.202.50.255:80. I have confirmed via third party and also via a separate application on a different service that the API was reachable at the indicated time.
The application restarted, and I immediately received the following error repeatedly: Error: getaddrinfo ENOTFOUND redis.railway.internal at 22:38:11, 22:38:16, :21, :26, :32, :38, :47, 39:03, and 39:32 before the restart limit was reached. The application references the redis.railway.internal address via an environment variable, so it is clear the variable itself is working properly.
The confluence of these two errors, targeting two separate services/addresses, beginning at the same time suggests a potential issue (DNS?) on the backend at this time. I restarted the application at 07:16 this morning and the once-per-minute Redis call and external API calls are both proceeding without issue thus far.
0 Replies
Project ID: aabf52ba-51a4-493c-a24b-f2354c48f9bd
Deployment ID: f21a6a59-54c0-4b4b-aacc-81db87431cfe
As I was writing this, I received another EHOSTUNREACH error to the same IP address. I jinxed it, I guess!
a year ago
the EHOSTUNREACH
error could be due to a blip in GCP's networking, but the DNS error for the internal redis domain is unfortunately all too common, yet it's fixable, let me ask some questions about that -
nixpacks or Dockerfile?
do you have a 3 second sleep before starting your app?
I'm using nixpacks (railway up) for deploying the code, and I don't have a sleep in my start command currently but I can certainly add one
a year ago
yes a 3 second sleep is definitely needed as the private network's DNS resolver is not available for the first ~3 seconds upon start
Perfect, I'll set that up now. Nothing to be done about the EHOSTUNREACH error I assume - I started noticing that pop up for the first time a week or so ago, which I think was when that GCP outage happened; I feel like it's gotten more common, but that's probably just hearsay :)
Well… nothing to be done other than adding some more robust error handling to my little hobby project! Ha
a year ago
yep unfortunately railway is at the mercy of gcp until they finish their move to bare metal
a year ago
no problem, let me know if that 3 second sleep works
a year ago
and make sure that you're using a readiness style health check so that railway doesn't switch over traffic while your service is sleeping for those 3 seconds
Three second sleep worked great @Brody , thanks for the tip. I've had one more weird error pop up today that's not making sense - could also be a GCP networking issue? I've now started getting an ETIMEDOUT error on my Redis connection. I'm making a call to redis at least once per minute, so I'm not seeing any reason on the code side why suddenly it's timing out.
Again, will implement some error handling to try re-opening the connection when I run into this, but I'm curious why it might be happening to begin with
a year ago
and you're getting that error from the redis database that you are connecting to via the private network?
In this case, it was stable for 10 minutes before that error, so 9-10 successful per-minute checks
a year ago
is redis running into any resource limitations? disk, mem, etc
a year ago
are you using ioredis?
a year ago
it's got its own issues, are you using an older version of node-redis?
a year ago
Then I'm currently stumped, would it be too much to ask you to switch to dragonfly just for a test instead?
I've been getting internal dns errors to local MySQL the last 2 days, they disappear as quickly as they appear (usually overnight uk tine)
Sometimes error is silent - loss of front end but nothing in logs until a restart then the errors appear but resolve after minutes.
a year ago
please share the specific error
a year ago
without errors there's not too much we can help with
a year ago
yes please
MySQL DB error :
MySQL DB Error :
a year ago
is the database accessible locally
Any API Error at the same time :
Exception in thread "Timer-0" java.net.NoRouteToHostException: No route to host
at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777)
at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
a year ago
oh you're pro?
a year ago
fixed your badges
a year ago
are you getting this error intermittently or only during the start of your app
always at the start of the app if i use the local url for the db, intermittently with the public URL
a year ago
can you try connecting through the private network and add a 3 second sleep before starting your app
Same error without the 3 second sleep in US West (Oregon, USA), the build with the sleep time is still deploying
a year ago
perfect
a year ago
you need the 3 second sleep everywhere, even if you don't immediately see an issue
I removed the auto request retry with the NoRouteToHostException so I can have the alert and report back to you if I have that error again
a year ago
sounds good
The error is still occuring with API calls :
Exception in thread "Timer-2" java.net.NoRouteToHostException: No route to host
at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777)
at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
a year ago
what domain are you getting that error from
https://www.furious-squad.com/
but before I use the private link, both the db communication and the api call were throwing errors
a year ago
you get errors when you try to call that domain?
a year ago
please answer the question to the best of your ability
a year ago
I'm sorry but that doesn't answer the question
HttpClient: REQUEST https://mprez.furious-squad.com/api/v2/project/?query= failed with exception: java.net.NoRouteToHostException: No route to host
Exception in thread "Timer-4" java.net.NoRouteToHostException: No route to host
at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777)
at io.ktor.network.sockets.SocketImpl.connect$ktor_network(SocketImpl.kt:50)
at io.ktor.network.sockets.SocketImpl$connect$1.invokeSuspend(SocketImpl.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)