Hello, I have developed my telegram bot with a postrges database and using the binance websocket.
I get messages with required rates in the bot at a certain command, but when I execute it often the bot does not respond and in the logs I see the following error:
could not send HTTP request to instance: connection error: timed out
If I restart the instance, everything works for a few hours and then the bot stops responding to me again.
Please help me, because I don’t understand what’s wrong.
@freeezefive I didn’t see anything related with Upstash in your first comment. Do you use Upstash? If yes which client do you use? Where did you create Upstash Redis? ( flyctl or upstash console )
Can you give a bit more details or how to reproduce this issue?
When the Fly proxy sends requests to your app, it will wait 60 seconds for a response. After that, you’ll see this error. Your app could be timing out for a number of reasons, such as slow database requests, or timeouts to other services that your app connects to.
If your application isn’t logging anything about these timeouts, check to make sure the clients for your target services (Postgres, etc) are configure to log when connection errors occur.
@pollux We’re talking about two different issues here. In your case, it may be that Redis timeouts were indirectly causing your app HTTP requests to time out. In the case of @freeezefive, Redis was not in play.
A way to be sure would be to connect directly to Redis from your VM, using redis-cli. If that doesn’t work, then there’s something wrong. Otherwise, it may be related to what’s mentioned in the other thread - disconnects or idle connection timeouts.