Intermittent network (DNS?) errors
Anonymous
TRIALOP

2 years 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
TRIALOP

2 years ago

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


Anonymous
TRIALOP

2 years ago

As I was writing this, I received another EHOSTUNREACH error to the same IP address. I jinxed it, I guess!


brody
EMPLOYEE

2 years 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
TRIALOP

2 years 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


brody
EMPLOYEE

2 years 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
TRIALOP

2 years 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
TRIALOP

2 years ago

Well… nothing to be done other than adding some more robust error handling to my little hobby project! Ha


brody
EMPLOYEE

2 years ago

yep unfortunately railway is at the mercy of gcp until they finish their move to bare metal


Anonymous
TRIALOP

2 years ago

Understood. Thanks very much for the quck response!


brody
EMPLOYEE

2 years ago

no problem, let me know if that 3 second sleep works


brody
EMPLOYEE

2 years 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
TRIALOP

2 years 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
TRIALOP

2 years 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


brody
EMPLOYEE

2 years ago

and you're getting that error from the redis database that you are connecting to via the private network?


Anonymous
TRIALOP

2 years ago

Correct, yeah


Anonymous
TRIALOP

2 years ago

In this case, it was stable for 10 minutes before that error, so 9-10 successful per-minute checks


brody
EMPLOYEE

2 years ago

is redis running into any resource limitations? disk, mem, etc


Anonymous
TRIALOP

2 years ago

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

1243262259384287200


brody
EMPLOYEE

2 years ago

are you using ioredis?


Anonymous
TRIALOP

2 years ago

I'm using node-redis currently


Anonymous
TRIALOP

2 years ago

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


brody
EMPLOYEE

2 years ago

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


Anonymous
TRIALOP

2 years ago

4.6.14, current version


brody
EMPLOYEE

2 years 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

2 years 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.


brody
EMPLOYEE

2 years ago

please share the specific error


gazhay
PRO

2 years ago

loss of front end but nothing in logs until a restart


brody
EMPLOYEE

2 years ago

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


poui
HOBBY

2 years ago

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


brody
EMPLOYEE

2 years ago

yes please


poui
HOBBY

2 years ago

MySQL DB error :

1244665248208785408


poui
HOBBY

2 years ago

MySQL DB Error :

1244665526748315771


brody
EMPLOYEE

2 years ago

is the database accessible locally


poui
HOBBY

2 years 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
HOBBY

2 years ago

I changed the server and it's now accessible locally


poui
HOBBY

2 years ago

I went from USA to EUW


brody
EMPLOYEE

2 years ago

oh you're pro?


poui
HOBBY

2 years ago

Yes


brody
EMPLOYEE

2 years ago

fixed your badges


poui
HOBBY

2 years ago

i tried a couple of times but it never changed


brody
EMPLOYEE

2 years ago

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


poui
HOBBY

2 years ago

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


gazhay
PRO

2 years ago

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


brody
EMPLOYEE

2 years ago

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


poui
HOBBY

2 years ago

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


poui
HOBBY

2 years ago

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


poui
HOBBY

2 years ago

Okey it worked with the 3 second sleep


brody
EMPLOYEE

2 years ago

perfect


poui
HOBBY

2 years ago

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


brody
EMPLOYEE

2 years ago

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


poui
HOBBY

2 years 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


brody
EMPLOYEE

2 years ago

sounds good


poui
HOBBY

2 years 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)


brody
EMPLOYEE

2 years ago

what domain are you getting that error from


poui
HOBBY

2 years ago

https://www.furious-squad.com/
but before I use the private link, both the db communication and the api call were throwing errors


brody
EMPLOYEE

2 years ago

you get errors when you try to call that domain?


poui
HOBBY

2 years ago

I never had that specific error before


brody
EMPLOYEE

2 years ago

please answer the question to the best of your ability


poui
HOBBY

2 years ago

No, except that one


brody
EMPLOYEE

2 years ago

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


poui
HOBBY

2 years ago

I didn't understand your question then


poui
HOBBY

2 years ago

I keep having this error once or twice per hour


poui
HOBBY

2 years 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)


Loading...