Error {main} thrown in Phirehose.php on line 745

82 views
Skip to first unread message

Athbi Almutairi

unread,
Apr 22, 2014, 5:49:51 PM4/22/14
to phireho...@googlegroups.com
Hello

I keep having this error in my log files, after few tweets, this error appear


[22-Apr-2014 16:34:49 Asia/Kuwait] PHP Fatal error:  Uncaught exception 'Exception' with message 'Twitter did not send a chunking header. Is this really HTTP/1.1? Here are headers:
connection: close
Content-Type: application/json
transfer-encoding: chunked
date: Tue, 22 Apr 2014 13:34:49 UTC
x-connection-hash: 27b16153dafa551f744b4e19a93a2cdc
' in /phirehose/Phirehose.php:745
Stack trace:
#0 /phirehose/Phirehose.php(836): Phirehose->connect()
#1 /phirehose/Phirehose.php(411): Phirehose->reconnect()
#2 /file.php(60): Phirehose->consume()
#3 {main}
  thrown in /phirehose/Phirehose.php on line 745



any suggestions?


Thanks

Athbi Almutairi

unread,
Apr 22, 2014, 5:51:21 PM4/22/14
to phireho...@googlegroups.com
I tried both Master and Chunked version.. same error

Phil G

unread,
Apr 22, 2014, 6:03:25 PM4/22/14
to phireho...@googlegroups.com

Phil G

unread,
Apr 22, 2014, 6:20:25 PM4/22/14
to phireho...@googlegroups.com
Long answer: I got that error twice today as well. I'm sure it has happened occasionally in the past but the frequency seems to have increased all of a sudden today. Until Fenn merges it into master, you can manually pull in the change that my pull request is for (https://github.com/fennb/phirehose/pull/63).

I've also opened a discussion on the Twitter dev site to address this, but regardless, I think it's a safe bet to make the client tolerate this glitch either way.

Darren Cook

unread,
Apr 22, 2014, 7:17:40 PM4/22/14
to phireho...@googlegroups.com
> https://github.com/fennb/phirehose/pull/63).

I just merged this. Does anyone fancy doing a quick code review to see
if there are any other potential case issues?

I also wondered if we ought to use a regex, just in case the space is
missing. E.g.
if(preg_match('/^transfer-encoding:\s*chunked$/i', $hLine))
$isChunking = true;

?

Darren

Darren Cook

unread,
Apr 22, 2014, 9:08:12 PM4/22/14
to phireho...@googlegroups.com
Ironically, after doing this merge, I carried on working through my
morning email, server logs, and found my own servers were all stopped
because of this. I guess Twitter did an upgrade, and chose today to
roll-out to everyone?

Thanks again to "fubar" for the speedy fix.

Q1. As old versions of Phirehose are now basically broken, I guess we
ought to do another proper release? Change from "1.0RC" to Version
"1.0.1"? Git tag as "1.0.1". Anything else we do? Is there a zip
download file kept somewhere? (If so it also ought to be mentioned in
the github Readme.md file.)

Q2. Does anyone have a contact at Twitter, so we could get advance
warning of even minor system updates? Then we could do tests against
their staging server, and catch these problems before they affect live
users!

(Actually it amazes me that Twitter haven't reached out to us;
encouraging library developers is common-sense for any company with an API.)

Darren

P.S. If anyone has some time, I noticed
https://github.com/fennb/phirehose/wiki/Introduction is quite out of
date now.



--
Darren Cook, Software Researcher/Developer
My new book: Data Push Apps with HTML5 SSE
Published by O'Reilly: (ask me for a discount code!)
http://shop.oreilly.com/product/0636920030928.do
Also on Amazon and at all good booksellers!

Phil G

unread,
Apr 22, 2014, 9:41:40 PM4/22/14
to phireho...@googlegroups.com
Thanks for merging this so quickly Darren. Though this issue was rather disruptive and it would be nice to get ahead notices, I am speculating that it is an unfortunate bug that made it into production as part of one of frequent minor releases that don't grant any announcements. Major changes such as deprecating HTTP 1.0 in favour of 1.1 are always well planned and publicly announced well ahead of time.

Phil

Athbi Almutairi

unread,
Apr 23, 2014, 5:08:32 PM4/23/14
to phireho...@googlegroups.com
Thanks Darren for the quick merge

Phil G

unread,
Apr 25, 2014, 8:24:53 PM4/25/14
to phireho...@googlegroups.com
Quick update for everyone: HTTP header field names actually are case-insensitive. See https://dev.twitter.com/discussions/27837#comment-63086
Reply all
Reply to author
Forward
0 new messages