Twitter - 417 Expectation Failed
Twitter - 417 Expectation Failed
| Issue ID: | 3702 |
| Issue Category: | bug |
| Component: | plugin |
| Priority: | major |
| Status: | fixed |
| Assigned: | Unassigned |
| Version: | 0.9 |
| Keywords: | 417, Expectation, Failed, twitter |
This will be the log trying to say?. I can not connect to twitter, or in this instance or on identi.ca
2012-10-27 07:04:14 LOG_DEBUG: [legadolibre.com.ar:synctwitterfriends.php:5781] synctwitterfriends.generic- Grabbing friends IDs with OAuth.
2012-10-27 07:04:14 LOG_DEBUG: [legadolibre.com.ar:synctwitterfriends.php:5782] synctwitterfriends.generic- Grabbing friends IDs with OAuth.
2012-10-27 07:04:15 LOG_ERR: [legadolibre.com.ar:synctwitterfriends.php:5781] HTTPClient: HTTP GET https://api.twitter.com/1/friends/ids.json?oauth_consumer_key=wb30oVvV1x... - 417 Expectation Failed
2012-10-27 07:04:15 LOG_WARNING: [legadolibre.com.ar:synctwitterfriends.php:5781] synctwitterfriends.generic - error getting friend ids:
2012-10-27 07:04:15 LOG_DEBUG: [legadolibre.com.ar:synctwitterfriends.php:5781] synctwitterfriends.generic - Couldn't get friends from Twitter for Twitter user 494254871.
2012-10-27 07:04:15 LOG_ERR: [legadolibre.com.ar:synctwitterfriends.php:5782] HTTPClient: HTTP GET https://api.twitter.com/1/friends/ids.json?oauth_consumer_key=wb30oVvV1x... - 417 Expectation Failed
2012-10-27 07:04:15 LOG_WARNING: [legadolibre.com.ar:synctwitterfriends.php:5782] synctwitterfriends.generic - error getting friend ids:
2012-10-27 07:04:15 LOG_DEBUG: [legadolibre.com.ar:synctwitterfriends.php:5782] synctwitterfriends.generic - Couldn't get friends from Twitter for Twitter user 64313209.
2012-10-27 07:04:15 LOG_DEBUG: [legadolibre.com.ar:synctwitterfriends.php:5783] synctwitterfriends.generic- Grabbing friends IDs with OAuth.

Updates
#1
I also see this since ~10 hours. It causes the load on my server to go up significantly. imdaemon.php and imdaemon.php seem to go in an endless loop trying to post a notice to twitter and getting 417 back all the time.
[queuedaemon.php:7667] DBQueueManager (main): Got Notice 77026 for transport twitter
[imdaemon.php:7658] Waiting up to 0 seconds for socket data...
[imdaemon.php:7658] DBQueueManager (im): Checking for notices...
[imdaemon.php:7658] claiming queue item id = 20460 for transport twitter
[imdaemon.php:7658] claim succeeded.
[imdaemon.php:7658] DBQueueManager (im): Got Notice 77027 for transport twitter
[queuedaemon.php:7667] HTTPClient: HTTP POST https://api.twitter.com/1/statuses/update.json - 417 Expectation Failed
[queuedaemon.php:7667] Twitter bridge - 417 posting notice 77026 for User grote (user id: 4): .
[queuedaemon.php:7667] DBQueueManager (main): [twitter:Notice 77026] Failed to handle item
#2
I'm seeing this with 1.1.0 as well, but in my case my server load goes crazy because queuedaemon.php goes into an endless loop getting 417 all the time.
#3
mrb found the header injection for an empty 'Expect' header as we can see in this thread:
https://status.jbfavre.org/conversation/785074
Comment it out and stuff will work again. line 246(ish) in lib/oauthclient.php
Be careful however, as we can read in the linked conversation:
I just noticed that too. A bunch of bug reports from 2008/2009 tell .NET users to clear out the 'Expect' header when talking to the API. StatusNet source comment is: '// Twitter is strict about accepting invalid "Expect" headers'
I guess Twitter fixed the bug on their side (proxy?) now in 2012. I'd be careful about removing it entirely though. It might be a temporary behaviour.
So be alert if something similar happens again, and you've commented the line out.
#4
I made a merge request for this (aimed at master):
https://gitorious.org/statusnet/mainline/merge_requests/221
#5
Thanks a lot! That fixed it for me :)
#6
evan merged the patch on https://gitorious.org/statusnet/mainline/merge_requests/221
Marking fixed.
#7
It just stopped working from me on the 29-11-12. working now. Thanks a lot!
You can also subscribe to the
RSS feed for updates to this issue.