API Timeouts from a NodeJS app




We are currently experiencing highly frequent timeouts from some of our machines. The symptoms are rather identical to what is described in issue 100354. I.E. our NodeJS app emits ETIMEDOUT when trying to connect to the api.twitter.com IP addresses.

When doing curl https://api.twitter.com from the same machines that fail, we are seeing a 100% success rate in receiving response. So this might be a problem with some specific endpoints only, or with NodeJS apps only.

Unfortunately, I cannot provide ping/traceroute/mtr logs due to ICMP limitations on the network we cannot circumvent at the time being.

TCP dumps show that a connection is actually established with the twitter API endpoint, and that data is being transmitted. But since it is encrypted I cannot tell what the data contains. The session is finally terminated with FIN, ACK packages which are then followed by RST packages.

Since curl works, and since we are able to flawlessly connect from other machines on other networks, our immediate suspicion is that the problem is not on Twitter’s end. Nonetheless, I am posting here to see if anybody else encountered similar problems and had any luck resolving them. Also, if the Twitter staff can assist us with debugging (such as checking what happens to the sessions on your end) this it would be tremendous help!

Many thanks!


I’m assuming you are talking about the statuses/filter endpoint here, but please correct me if I’m wrong.


Hey Lebraat. Thank you for your reply!
I am Indeed talking about the statuses/filter endpoint.


I’m not aware of a way for us to check for the connections and sessions on our side.

One question since you’re connecting to the streaming statuses/filter endpoint - this endpoint requires an ongoing open connection (not a request/response), so you’ll need your code to be capable of holding an open connection. Also be aware of the limitation that you cannot have more than a couple of connections to the streaming API from a single app ID, and you may not use multiple app IDs for the same use case in order to circumvent this restriction. Do you have existing connections from the same IP and/or app ID?


Thank you andypiper for your reply. I must apologise sincerely, but after further examination it appears that I gave you the wrong information :man_facepalming: . These errors appear to be originating from the /search/tweets endpoint.

Once again, apologies for my error. And thank you kindly for your time and help. :blush: