Nick
Nick

Reputation: 315

PHP Fatal error: Uncaught CurlException: 28 and 35 on Facebook apps

I randomly get following error. It doesn't happen everytimes.

PHP Fatal error:  Uncaught CurlException: 28: Operation timed out after 60 seconds with 47 out of 47 bytes received
PHP Fatal error:  Uncaught CurlException: 28: connect() timed out!
PHP Fatal error:  Uncaught CurlException: 35: Unknown SSL protocol error in connection to graph.facebook.com:443 

What I did try are

1. adding CURLOPT_SSLVERSION     => 3 (even try changing to 2)
2. changing 'https://api-read.facebook.com/' to 'api_read'  => 'https://api.facebook.com/'
3. adding   $opts[CURLOPT_SSLVERSION] = 3;                                          
            curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
4. Changing CURLOPT_CONNECTTIMEOUT => from 10 to 60
5. closing IPv6 and add 69.171.224.54   graph.facebook.com to /etc/hosts (several other IPs also added)
6. telnet graph.facebook.com 443 and nslookup graph.facebook.com

I don't know where to look further. Please help!

FYI: cURL support = enabled, cURL Information = 7.15.5, OpenSSL Version = 0.9.8e (latest i can update on Centos 5.7)

Upvotes: 5

Views: 3791

Answers (1)

IMSoP
IMSoP

Reputation: 97783

All of these errors relate to the connection timing out during various phases of the HTTP process:

  • in the first, the connection was established, but no (or very little) data was returned
  • in the second, the connection couldn't be established at all
  • in the third, the TCP connection was established, but was dropped somewhere in the negotiation of a secure channel

As Shawn E. Carter says above, this bug appears to be the same issue https://developers.facebook.com/bugs/328399317246454?browse=search_4ff4817e0c5ec9768956669 as is this question Can not connect to Facebook with a curl request

Ultimately, it just means that Facebook's API server was a little slower than expected. You could try using a longer timeout, or, since it's intermittent, catching the exception and trying again.

Upvotes: 3

Related Questions