EDIT: I think this was an issue on our end. Please don’t waste any time investigating it. Sincere apologies.
We are experiencing an issue in production which looks identical to what Naor Biton described. Our client is using API 1.1, and sends a POST to statuses/filter with the ‘track’ param, keeps the connection alive, and reads the stream of tweets. This works fine, sometimes … but sometimes it gets a 401 response, in spite of the access token being valid (I have confirmed this with a GET to the account/verify_credentials.json endpoint, from the same server, with the same token). The server has a dedicated IP. The clock is correct. The problem is intermittent, and is happening frequently … enough to cause a real problem for us. Below is the body of the 401 response from Twitter. Please, let me know if there’s anything else I can provide that might help Twitter diagnose and fix this issue. Again, this problem is intermittent … our client works fine sometimes, and then will get 401s, without any changes. I do not think it’s a problem with our client, and it certainly doesn’t appear to be a problem with authentication, as Twitter’s response indicates. The token is still valid. Please advise, is there an open issue being tracked regarding this? I’ve done some searching, and I see similar issues described in the past, but everything recent I could find seems to indicate that Twitter considers this fixed/closed.
Response body (nothing special, but for completeness):
Error 401 Unauthorized
HTTP ERROR: 401
Problem accessing '/1.1/statuses/filter.json'. Reason:
Unauthorized