-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TwitterBridge: Could not parse guest token #2366
Comments
seeing the same. this has been previously working. I am also using http not https for the requests to rss-bridge since all the requests are from the same machine. if i use a browser on that system and use the same query it works. the software making the request is written in php and running php8 and php-fpm under nginx |
How to reproduce this? |
It's intermittent. |
This is also happening to me intermittently since 12/9 for Twitter user "pants", after months of working without issue. |
It likely doesn't make any difference, but just for reference, I am checking the Twitter feeds with FreshRSS running on the same machine as RSS-bridge. PHP 8.0 FPM via Apache. I have 10 Twitter feeds, each checked once every 20 minutes. On average the error occurs roughly once per hour. |
I'm having this same problem.
I'm using a discord bot called MonitoRSS, compared to @triatic's FreshRSS. This is an example output from the bot when retrieving something from my instance of RSS-Bridge: |
I have created a pull request but I don't think it will close this issue. It should reduce the error frequency though. |
It would be useful for people to experiment with higher values of I know I can do 100 hits every three hours before I get errors, but it might be that one or the other of these limits can be further increased still. We want to fetch guest tokens as infrequently as possible. |
If I run a second instance of rss-bridge on my server are the guest tokens separate or are they tied to an IP address or something about the machine making the requests? This could be a work around. |
I don't know exactly, but tweaking |
I created PR #2396 which will continue to use old/cached guesttokens until we successfully got a new one. |
I've been trying to treat either 403 or 500 as EAGAIN. Here's why:
If we receive a 403, getting a new guest token and refreshing seems to always work. If we receive a 500, there's no cookie in the document body -- everything else is there -- and a refresh usually gets a valid guest token, which we can then use to retrieve the contents. When retrieving the guest token, it's always at the very end of the document. The document is just sometimes short and missing the last line. So I've got code that loops 3 times with a usleep, and then returns error 503 instead of the default 500 to tell the RSS client to try again later. Assuming the clients are well written, that should be OK. Of course, 503 only matters if error output is http. I've had to rewrite that code a few times, as I get a bit more information from Twitter every time, and I need to run it for a few days to be confident it's fixed -- or at least better. |
Error rate has been extremely elevated today, so if anyone needed to test against this intermittent issue, it would be a good time to gather your data. Pretty sure I've gotten more failed feed retrievals than successful. I wandered into Twitter's API forum, and there's multiple topics on similar issues, i.e. unable to retrieve tokens, invalid tokens, etc. This post in particular had some findings on token lifespans. https://twittercommunity.com/t/unable-to-obtain-new-access-token-by-using-refresh-token/164123/7 tl;dr it seems that if you request a new token before yours expires, you're okay. Otherwise, you're not. Given the nature of RSS-Bridge, I don't know that this finding is particularly useful, beyond "yep, something's broken." Twitter's API status page shows "degraded performance" for the RESTful API. It also seems they don't really use issue history at all. If I had to guess, all of this might be a load issue that Twitter either hasn't addressed, or is expecting to pass on its own, i.e. they're not going to address it. |
We may need to start thinking about adding Twitter API v2 support: https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/introduction |
Seems like they have changed the API now. Guest Tokens are now aquired through a post request to https://api.twitter.com/1.1/guest/activate.json It's mandatory to have a authorization header to be allowed for making the request: If i use a header which i captured by visiting the website via my browser, i was succesfully able to request a guest token. So next step would be, to figure out, how to get a authorization token. |
I create a new PR #2414 which should finaly solve the issues. |
Closing as resolved |
I'm seeing an increasing number of these in my twitter bridge feeds:
It happens randomly and doesn't seem to be specific to any one of my twitter feeds.
PHP error:
The text was updated successfully, but these errors were encountered: