Receive "CurlException uncaught: 7: couldn't connect to host"

Error in deserializing body of reply message for operation 'Translate'. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 9460.
Error in deserializing body of reply message for operation 'Translate'. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 12442.

mycodesourceNew MemberRegistered: 2010-12-31Posts: 7

Fatal error: Uncaught CurlException: 7: couldn't connect to host thrown in /home/......./public_html/event/facebook.php on line 622

I have tried clearing cookies, cache, new browser but it keeps coming up. I set 60 seconds before timeout and there is no reason why a script should need so much time.

takwing_Moderator_From: Hong KongRegistered: 2010-05-05Posts: 4346Website

the error is throwing out at the server side and so cleaning your cookies, new browser won't help.

I heard that there are free hosting that "block" there connection to facebook servers.

anyway, I think you have to check this out with the server team

mycodesourceNew MemberRegistered: 2010-12-31Posts: 7

i have VPS so server quality should not be an issue

takwing_Moderator_From: Hong KongRegistered: 2010-05-05Posts: 4346Website

why not just simply ask the server team.

one of the common problem that I found people using hosting is "they trust the hosting team too much".
I know they may be providing quality service.... and if this is the case, they should be helpful in helping you to find out what is the problem.

I personally use a not that famous hosting company (as it is in local in HK)... but they are really helpful!  They will answer all server related issues... at least they don't say something like "server is ok... check your own scripts".

dburns_Moderator_Registered: 2008-02-09Posts: 6363

@mycodesource: please don't cross-post.  Just pick one section and post there.  I've deleted the duplicate posts.

takwing's right that it's definitely something you need to talk to your server team about.  If your server can't talk to Facebook's servers, nothing's going to work.

DXWebdesignsNew MemberFrom: Leeds, UKRegistered: 2011-04-06Posts: 111Website

It seems you guys love throwing these errors on the host, I am on a dedicated server and I get this error, and have done all the way up the various packages from vps to dedicated, it a shame there are so many people who get this error and the csrf error and all fb can do is blame the host.

I for one will not be pushing Facebook anymore from my external sources the issues with credits after the forceful push and also everything else that just gets swept to the side after we are forced to migrate to a system that clearly isnt ready for production yet is a joke and I am quite frankly fed up of fighting against the sdk and getting no support.

Last edited by DXWebdesigns (2011-08-31 12:40:13)

Custom CMS Systems, MiniSites, Apps and Games On Facebook in 7 countries throughout the world.
App Development And Support  - Need A Quote ?
DXWebdesigns - DXWebdesigns On FacebookMad RogNew MemberFrom: England in Asia (BKK and HK)Registered: 2010-09-17Posts: 64Website

Hi DXWebdesigns,

How's everything going in Leeds? Good I hope!

The issue is caused (I think) by your server connecting to  Facebook (maybe your server is UK located, however I don't see why that should cause such a delay) and timing out, you can solve this by doing the following...

In the file: base_facebook.php

On line: 129 (or search for it), you will see the code:

CURLOPT_CONNECTTIMEOUT => 10,

This is how many seconds it will take for the request via CURL to timeout with the connection from your server to Facebook - I've seen the advice many times saying 'get a faster server' but that is not always practical so a fix is...

Increase the timeout, you could go for...

CURLOPT_CONNECTTIMEOUT => 30,

however I have seen this time increased to 60.

Please note that if you increase this time to 60 I think your script will keep trying to contact Facebook to 60 seconds which is a long wait so although it might fix your issues to increase the timeout above 10 it also increases the wait for your users which is not recommend - if you get what I mean.

All that said, I've just done a project in Asia where I increased the time to 60 as a safeguard!

Good luck,

Rog.

DXWebdesignsNew MemberFrom: Leeds, UKRegistered: 2011-04-06Posts: 111Website

Hi thanks for the response we actually did that about three months ago and the problem stopped but now its back sad

Also we are on a fast server I am on standard dedicated server heres my stats

    Intel Xeon 3450 (Quad Core)
    4 GB DDR3 Memory
    2 X 250 GB Hard Drive
    10 TB Bandwidth

Last edited by DXWebdesigns (2011-08-31 12:38:26)

Custom CMS Systems, MiniSites, Apps and Games On Facebook in 7 countries throughout the world.
App Development And Support  - Need A Quote ?
DXWebdesigns - DXWebdesigns On FacebookMad RogNew MemberFrom: England in Asia (BKK and HK)Registered: 2010-09-17Posts: 64Website

Hi DXWebdesigns,

What SDK release are you using?

Is there any chance that you've upgraded but not modified the new base_facebook.php?

Cheers,

Rog.

DXWebdesignsNew MemberFrom: Leeds, UKRegistered: 2011-04-06Posts: 111Website

Hi mate using the latest version and I have updated it to 45 now it was 100% on 30 but trying 45:

Still getting

PHP Fatal error:  Uncaught CurlException: 52: Empty reply from server
PHP Fatal error:  Uncaught CurlException: 56: SSL read: error:00000000:lib(0):func(0):reason(0), errno 104

I think where it is coming from is an Ajaxed refreshed div but still there should be no issues, tbh yesterday pages werent even loading at even though server load was totally fine averaging at 0.5, when I looked at Facebooks live stats there were heavy API calls and errors so I guess this is the problem, too many apps.

Last edited by DXWebdesigns (2011-09-01 09:43:37)

Custom CMS Systems, MiniSites, Apps and Games On Facebook in 7 countries throughout the world.
App Development And Support  - Need A Quote ?
DXWebdesigns - DXWebdesigns On FacebookMad RogNew MemberFrom: England in Asia (BKK and HK)Registered: 2010-09-17Posts: 64Website

Can you zip a simple example or provide a link to test on so I can try and help out?

Pages: 1

Home » Graph API » keep getting "Uncaught CurlException: 7: couldn't connect to host"