Intermittent network (DNS?) errors

Anonymous
TRIAL

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

Anonymous
TRIAL

a year ago

Project ID: aabf52ba-51a4-493c-a24b-f2354c48f9bd
Deployment ID: f21a6a59-54c0-4b4b-aacc-81db87431cfe


Anonymous
TRIAL

a year ago

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?


Anonymous
TRIAL

a year ago

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


Anonymous
TRIAL

a year ago

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 :)


Anonymous
TRIAL

a year ago

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


Anonymous
TRIAL

a year ago

Understood. Thanks very much for the quck response!


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


Anonymous
TRIAL

a year ago

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.

Error Log


Anonymous
TRIAL

a year ago

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?


Anonymous
TRIAL

a year ago

Correct, yeah


Anonymous
TRIAL

a year ago

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


Anonymous
TRIAL

a year ago

I'd be shocked if so, it has a whole one key in it currently XD

1243262259384287200


a year ago

are you using ioredis?


Anonymous
TRIAL

a year ago

I'm using node-redis currently


Anonymous
TRIAL

a year ago

Can definitely give ioredis a try though if that's a better option!


a year ago

it's got its own issues, are you using an older version of node-redis?


Anonymous
TRIAL

a year ago

4.6.14, current version


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?


gazhay
PRO

a year ago

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


gazhay
PRO

a year ago

loss of front end but nothing in logs until a restart


a year ago

without errors there's not too much we can help with


poui
PRO

a year ago

I also had similiar errors, I can copy paste my erros logs here if needed


a year ago

yes please


poui
PRO

a year ago

MySQL DB error :

1244665248208785408


poui
PRO

a year ago

MySQL DB Error :

1244665526748315771


a year ago

is the database accessible locally


poui
PRO

a year ago

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)


poui
PRO

a year ago

I changed the server and it's now accessible locally


poui
PRO

a year ago

I went from USA to EUW


a year ago

oh you're pro?


poui
PRO

a year ago

Yes


a year ago

fixed your badges


poui
PRO

a year ago

i tried a couple of times but it never changed


a year ago

are you getting this error intermittently or only during the start of your app


poui
PRO

a year ago

always at the start of the app if i use the local url for the db, intermittently with the public URL


gazhay
PRO

a year ago

You have to wait a few seconds for local DNS to come up sometimes


a year ago

can you try connecting through the private network and add a 3 second sleep before starting your app


poui
PRO

a year ago

I will switch back to the US West (Oregon, USA) to retry


poui
PRO

a year ago

Same error without the 3 second sleep in US West (Oregon, USA), the build with the sleep time is still deploying


poui
PRO

a year ago

Okey it worked with the 3 second sleep


a year ago

perfect


poui
PRO

a year ago

It didn't need the 3 second sleep in EUW tho


a year ago

you need the 3 second sleep everywhere, even if you don't immediately see an issue


poui
PRO

a year ago

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


poui
PRO

a year ago

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


poui
PRO

a year ago

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?


poui
PRO

a year ago

I never had that specific error before


a year ago

please answer the question to the best of your ability


poui
PRO

a year ago

No, except that one


a year ago

I'm sorry but that doesn't answer the question


poui
PRO

a year ago

I didn't understand your question then


poui
PRO

a year ago

I keep having this error once or twice per hour


poui
PRO

a year ago

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)


Intermittent network (DNS?) errors - Railway Help Station