function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
openairhosteropenairhoster 

Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host

Hi,

all of a sudden, after years of running fine, and definitely after the last code change, we are getting the infamous

 

Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host

 

php error log says: curl_exec error 7 couldn't connect to host

 

message. We are using PHP toolkit 13.1 and we really, really didn't change anything in our code.

Nor did we switch servers.Some old posts here suggest  We tested with some really simple select queries, and it still doesn't work.

Some old posts here suggest that this happened to people (connection working on and off) in the distant past.

Can this still happen? Or did anything change in the API?

 

Greetings

Michael

CalatravaCalatrava

We have exactly the same problem and have been playing phone tag with Salesforce support for a week now. Our problem started happening shortly after midnight on the 1st of December. The latest message we got from Salesforce is that they do not support PHP.

 

We have been using our system for 6 years now and are completely pissed about their support response.

 

A lot of our critical infrastructure is affected and we are considering migrating to a different system. Unfortunately this will take at least a month and a couple of thousand USD, so we are hesitant to do that.

 

I can say that we have had this system running for a long time without trouble but that whenever we had trouble, the **bleep** really hit the fan because of the incredibly inadequate support we got.

SuperfellSuperfell

Which instance are you on? a number of instanced moved/migrated recently perhaps you have a cached DNS lookup to the old IP addresses? which specifc host are you failing to connect to ?

CalatravaCalatrava

Interesting answer. Wish "Tier 3" support were as prompt as you... Thank you already.

 

From the error message, it looks like eu0-api.salesforce.com, but will confirm with my sysop.

SuperfellSuperfell

the EU0 instance was split this weekend, you may now be on EU1 (you or your admin should of gotten emails about this). Make sure your login requests are going to www.salesforce.com or login.salesforce.com and that you're following the serverUrl returned in the LoginResult for your subsequent calls. Also make sure to flush any cached DNS lookups (I know for example in Java that DNS lookups get cached for the lifetime of the process by default).

SuperfellSuperfell

Also, EU1 is in a new data center, so if you were moved there, i think there are new IP blocks, so your firewall etc may need updating to allow access to the new data center.

CalatravaCalatrava

Thanks, Simon. This is a great answer, I'll direct my guys to do that.

 

I am really wondering why nobody at support pointed out those simple facts. It's quite likely that this is the source of the problem.

 

We never got any notification of those changes though.

BenjiJasikBenjiJasik

Please post your case number or email me the info directly at bjasik at salesforce dot com so we can look into why support didn't respond to you with information about the split.

 

Also please post an update here if you are still having problems or if Simon's info helped you track down the problem.

 

Thanks,


Benji Jasik

V.P. Customer Centric Engineering.

CalatravaCalatrava

Our case number is 04132091.

 

We checked and don't have any hardcoded instance in the source code. We also pinged the IP ranges provided by support and don't have any trouble getting a return.

 

We are positive we have not made modifications to our code when it stopped working last week.

CalatravaCalatrava

The issue is still there and we are  very sure it's on Salesforce's side. We can successfully log onto Salesforce. However we cannot execute any additional requests. Any Queries, but also a request for the server timestamp fail.

 

Here is our code. We implemented a barebone example using the latest (20) toolkit for PHP, but the same error occurs in our original code with the unchanged older PHP toolkit code.

 

 

require_once("sfphp/soapclient/SforceEnterpriseClient.php");
require_once("sfphp/soapclient/SforceHeaderOptions.php");

$oSalesforce = new SforceEnterpriseClient();

print "<p>Created</p>";

if (!$oSalesforce->createConnection("sfphp/soapclient/enterprise.wsdl.xml"))
{
	print "<p>Unable to create a connection</p>";
}

print "<p>Connected</p>";

if (!$oSalesforce->login("name","password"))
{
	print "<p>Unable to log on</p>";
	exit;
}
	
print "<p>Logged On</p>";

print "<p>End Point is " . $oSalesforce->getLocation() . "</p>";

print "<p>Last response is <br/><i> " . $oSalesforce->getLastResponse() . "</i></p>";

print "<p>Server timestamp is <br/><i> " . $oSalesforce->getServerTimestamp() . "</i></p>";

The output is:

 

Created

 

Connected

 

Logged On

 

End Point is https://eu0-api.salesforce.com/services/Soap/c/20.0/00D200000000MSH

 

Last response is 
https://eu0-api.salesforce.com/services/Soap/m/20.0/00D200000000MSHfalsefalsehttps://eu0-api.salesforce.com/services/Soap/c/20.0/00D200000000MSH00D20(cut)


Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in (REMOVED HOST NAME)/sfphp/soapclient/SforceBaseClient.php:873 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://eu0-api...', '', 1, 0) #1 [internal function]: SoapClient->__call('getServerTimest...', Array) #2 (REMOVED HOST NAME)/sfphp/soapclient/SforceBaseClient.php(873): SoapClient->getServerTimestamp() #3 (REMOVED HOST NAME)/index.php(60): SforceBaseClient->getServerTimestamp() #4 {main} thrown in (REMOVED HOST NAME)/sfphp/soapclient/SforceBaseClient.php on line 873

So just to recap. We can connect, log-in all fine. As soon as we attempt to use the connection, it fails, even if it's just getting the server time stamp.

 

SuperfellSuperfell

I'm able to connect to EU0 fine (just click the link in the post). Do you have a firewall or proxy in your network, perhaps that's blocking the connection request.

 

can you run nslookup on the host that can't connect, and report what IP address it says?

BenjiJasikBenjiJasik

I'd like to see tracerts from the box that's failing to eu0-api.salesforce.com