Ошибка error fetching http headers

I'm trying to invoke a WS over https on a remote host:remote port and I get: Error fetching http headers using the PHP5 SoapClient; I can get the list of functions by doing $client->__getFun...

I’m trying to invoke a WS over https on a remote host:remote port and I get:

Error fetching http headers

using the PHP5 SoapClient; I can get the list of functions by doing $client->__getFunctions() but when I call $client->myFunction(...) I always get this error.

I’ve googled and found that increasing default_socket_timeout in php.ini should fix it, but it did not work.

Can anyone suggest me a solution?

EDIT: here is the code:

$wsdl="myWSDL";

$client = new SoapClient($wsdl,array('connection_timeout'=>5,'trace'=>true,'soap_version'=>SOAP_1_2));

var_dump($client->__getFunctions());

try {
    $response=$client->myFunction("1","2","3");
         } catch (SoapFault $fault) {
    var_dump($fault);
    }
}

always ends in the error.

How do I solve the problem?

Emma's user avatar

Emma

27.2k11 gold badges43 silver badges67 bronze badges

asked Feb 22, 2012 at 21:39

Cris's user avatar

5

This error is often seen when the default_socket_timeout value is exceeded for the SOAP response. (See this link.)

Note from the SoapClient constructor: the connection_timeout option is used for defining a timeout value for connecting to the service, not for the timeout for its response.

You can increase it like so:

ini_set('default_socket_timeout', 600); // or whatever new value you want

This should tell you if the timeout is the issue, or whether you have a different problem. Bear in mind that you should not use this as a permanent solution, but rather to see if it gets rid of the error before moving on to investigate why the SOAP service is responding so slowly. If the service is consistently this slow, you may have to consider offline/batch processing.

answered Feb 22, 2012 at 22:40

cmbuckley's user avatar

cmbuckleycmbuckley

38.8k8 gold badges77 silver badges91 bronze badges

8

Just wanted to share the solution to this problem in my specific situation (I had identical symptoms). In my scenario it turned out to be that the ssl certificate provided by the web service was no longer trusted. It actually turned out to be due to a new firewall that the client had installed which was interfering with the SOAP request, but the end result was that the certificate was not being correctly served/trusted.

It was a bit difficult to track down because the SoapClient call (even with trace=1) doesn’t give very helpful feedback.

I was able to prove the untrusted certificate by using:

openssl s_client -connect <web service host>:<port>

I know this won’t be the answer to everyone’s problem, but hopefully it helps someone. Either way I think it’s important to realise that the cause of this error (faultcode: «HTTP» faultstring: «Error Fetching http headers») is usually going to be a network/socket/protocol/communication issue rather than simply «not allowing enough time for the request». I can’t imagine expanding the default_socket_timeout value is going to resolve this problem very often, and even if it does, surely it would be better to resolve the issue of WHY it is so slow in the first place.

answered Jan 23, 2013 at 5:09

Manachi's user avatar

ManachiManachi

1,03316 silver badges30 bronze badges

I faced same problem and tried all the above solutions. Sadly nothing worked.

  1. Socket Timeout (Didn’t work)
  2. User Agent (Didn’t work)
  3. SoapClient configuration, cache_wsdl and Keep-Alive etc…

I solved my problem with adding the compression header property. This is actually required when you are expecting a response in gzip compressed format.

//set the Headers of Soap Client. 
$client = new SoapClient($wsdlUrl, array(
    'trace' => true, 
    'keep_alive' => true,
    'connection_timeout' => 5000,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'compression'   => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
));

Hope it helps.

Good luck.

joeybab3's user avatar

joeybab3

2932 gold badges7 silver badges23 bronze badges

answered May 26, 2018 at 10:19

Sanjay Mohnani's user avatar

2

I suppose it’s too late, but I have the same problem. I try the socket timeout but it doesn’t work.
My problem was that the client and the server where in the same physical server. With the client code working in the same physical server , I get this error, but, with the same client code moved to my localhost, requesting the server, (client and server was executed in two differents mechines) all works fine.

Maybe that can help someone else!

answered Jul 25, 2013 at 16:31

Jonathan Huet's user avatar

1

Setting 'keep_alive' to false worked for me:

new SoapClient($api_url, array('keep_alive' => false));

joeybab3's user avatar

joeybab3

2932 gold badges7 silver badges23 bronze badges

answered Jun 19, 2018 at 15:48

Thiago Sathler's user avatar

The configuration that has worked for me was defining at my php script the following parameters:

ini_set('default_socket_timeout', 5000);
$client = new SoapClient($url,array(
    'trace' =>true,
    'connection_timeout' => 5000,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'keep_alive' => false,
));

Please, comment.

The most important parameter definition, as per my experience with this issue was

ini_set('default_socket_timeout', 5000);

During my tests I have defined the default_socket_timeout to 5 seconds and the error ‘Error Fetching http headers’ was raised instantaneously.

I hope it helps you!

answered Nov 30, 2017 at 10:56

Marcelo Tonon Chiovatto's user avatar

I just wanted to add, for completeness sake, that similar to Manachi I received this message because the client certificate I was using required a passphrase and I accidentally had an extra character at the end of the passphrase. This post is just to offer up another suggestion for what to look into. If the host requires the use of a client certificate (via local_cert parameter) make sure you provide the correct path to the cert and the correct passphrase (if one is needed). If you don’t, it is very likely you will see this same error message.

answered Nov 6, 2013 at 0:09

borq's user avatar

borqborq

6817 silver badges15 bronze badges

None of the above techniques worked for me.

When I analyzed the request header from __getLastRequestHeaders, I saw the following:

POST /index.php/api/index/index/?SID=012345 HTTP/1.1
Host: www.XYZ.com

The API URL I had been using was different, like www.ABC.com. I changed the API URL to www.XYZ.com/index.php/api?wsdl, and then it worked.

Both URLs returned the same WSDL from the same server, but only one allowed login.

answered Feb 27, 2016 at 23:42

humbads's user avatar

humbadshumbads

3,1521 gold badge27 silver badges22 bronze badges

In recent releases from Zend SOAP client not having «connection_timeout» and «Keep_alive» parameters at all.

enter image description here

You can see the piece of code I have attached as an image. The only way to solve this issue to increase your default socket timeout in php.ini

default_socket_timeout = 1000

I hope it will solve your issue. Give an upvote if it works.

answered Jan 14, 2020 at 9:18

sivaprakash's user avatar

I had this problem and I checked, and in my case, was the Firewall. The PHP not show the error correctly. To perform the request, the Firewall answered:

HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
...
<html
...
<h1>Direct Access IP is not allowed</h1>
...
</html>

The SoapClient expects the SOAP envelope but receives a HTML code.
That’s why PHP responds with: «Error Fetching Http Headers» because it can not understand what he received in response. To resolve the problem, contact your network administrator to verify if there is any Firewall, NAT or proxy getting in the way and then ask them to make the necessary arrangements.

hlscalon's user avatar

hlscalon

7,2144 gold badges32 silver badges40 bronze badges

answered Feb 4, 2014 at 22:45

Mauro's user avatar

MauroMauro

212 bronze badges

1

Please check for the response HTTP-Header. In my case, the following header was set on the API-Site:

<IfModule mod_headers.c>
    Header set Connection keep-alive
</IfModule>

It seems like the PHP SoapClient can’t deal with that option. As a result, the response body was empty, but content-length in the response-header has been set correctly.

Remove that line or change it to «close» solved my issue.

answered Aug 24, 2015 at 18:30

Matthias Kleine's user avatar

I had the same issue and tried the following by disabling keep_alive.

$api_proxy = new SoapClient($api_url, array('trace' => true, 'keep_alive' => false));

However, that didn’t work for me. What worked worked for me was disabling the SOAP cache. It appears to have been caching the wrong requests and after disabling I actually noticed my requests were executing faster.

On a linux server you can find this in your /etc/php.ini file.

Look for soap.wsdl_cache_enabled=1 and change it to soap.wsdl_cache_enabled=0.

Don’t forget to reload apache.
service httpd reload

answered Dec 16, 2016 at 18:17

MagentoMan's user avatar

MagentoManMagentoMan

8761 gold badge12 silver badges21 bronze badges

Another possible cause of this error could be some OpenSSL operations leaving not cleared errors. Put this piece of code before the SOAP request to clear them:

while (openssl_error_string()) {}

answered Oct 18, 2018 at 8:43

Furgas's user avatar

FurgasFurgas

2,7271 gold badge18 silver badges27 bronze badges

I got this same error and in my case the server I was sending the request to was replying with a 504 Gateway Time-out error. I didn’t realize this until I went to the URL in a browser that was being requested by the SOAP request:

eg.
https://soap-request-domain-here.com/path/to/file.wsdl

answered Jul 10, 2019 at 14:50

John Langford's user avatar

John LangfordJohn Langford

1,1622 gold badges11 silver badges14 bronze badges

We encountered Error fetching http headers on every second call of SoapClient::__soapCall(,). However, not every soap endpoint/soap server was affected.

It turned out that switching to http was working reliably for all servers, but connections via https/secure HTTP showed above symptoms.
The openssl_error_string() as suggested by Furgas did not return any errors.

It turned out that the misbehaving soap servers sent a HTTP-header with every response which lead to the soap client choking on the second soap call:
Connection: Upgrade, close. The well-behaving servers did not send a Upgrade on successive responses.

What worked for us:

  • setting keep_alive to false, as mentioned by Thiago
  • unsetting the Upgrade- and Connection-headers via .htaccess files

Although the well-behaving soap servers did not need any of this, the misbehaving once needed both the keep_alive set to false and the unsetting of the headers.

# .htaccess
Header unset Upgrade
Header unset Connection

The root-cause is still unclear, but there is a bug report at Apache regarding Upgrade headers when using HTTPS.

answered Aug 8, 2019 at 10:11

Richard Kiefer's user avatar

Richard KieferRichard Kiefer

1,7642 gold badges21 silver badges41 bronze badges

Bug #41983 Error Fetching http headers
Submitted: 2007-07-12 20:56 UTC Modified: 2017-03-31 14:03 UTC
Votes: 1
Avg. Score: 5.0 ± 0.0
Reproduced: 1 of 1 (100.0%)
Same Version: 1 (100.0%)
Same OS: 1 (100.0%)
From: ipso at snappymail dot ca Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.3 OS: Linux
Private report: No CVE-ID: None

 [2007-07-12 20:56 UTC] ipso at snappymail dot ca

Description:
------------
I'm trying to use a SOAP API on an embedded device, the device is responding to the SOAP request, however PHP is saying there is an error fetching headers.

Reproduce code:
---------------
SOAP Request:
--------------------------------------------------------------------------
POST /iWsService HTTP/1.1
Host: 192.168.1.201
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.2.3
Content-Type: text/xml; charset=utf-8
SOAPAction: "uri:zksoftware#GetDate"
Content-Length: 494
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="uri:zksoftware" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:GetDate><ArgComKey xsi:type="xsd:string">0</ArgComKey></ns1:GetDate></SOAP-ENV:Body></SOAP-ENV:Envelope>


Response from SOAP Server:
--------------------------------------------------------------------------
HTTP/1.0 200 OK
Server: ZK Web Server
Pragma: no-cache
Cache-control: no-cache
Content-Type: text/xml
Connection: close

<?xml version="1.0" encoding="iso8859-1" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<GetDateResponse>
<Row Date='2006-06-24' Time='14:24:11'></Row>
</GetDateResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

However PHP returns: [faultstring] => Error Fetching http headers




Expected result:
----------------
Expect PHP to parse the SOAP response properly.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2007-07-13 08:06 UTC] arrakami at gmail dot com

I have the same problem and i would like to give some feedback too. But i can't find a way to capture the HTTP response. Any suggestions how i could do that? The soap server is 3rd party.

 [2007-07-13 08:34 UTC] dmitry@php.net

It seems like some kind of incompatibility between ext/soap and your soap or HTTP server. To fix the problem I need capture of HTTP response in binary form (including all special chars). Or give me a real PHP code that access buggy SOAP server so I'll able to reproduce it myself.

 [2007-07-13 15:40 UTC] ipso at snappymail dot ca

I emailed a TCP dump of the SOAP request/response to: dmitry@php.net

 [2007-07-19 16:27 UTC] ipso at snappymail dot ca

Just wanted to follow-up and make sure you got the email okay and have all the data you need to help track down the issue?

Thanks for looking into this.

 [2007-07-21 17:20 UTC] ipso at snappymail dot ca

I had someone look into this for me, apparently the device isn't sending the "rn" at the end of the header, but only "n". 

So instead of:
if (strcmp(headerbuf, "rn") == 0) {

Use:
if (strcmp(headerbuf, "rn") == 0 || strcmp(headerbuf, "n") == 0) {

 [2007-07-21 17:22 UTC] ipso at snappymail dot ca

Sorry, here is the file and line that needs changing:

ext/soap/php_http.c:1298

 [2007-07-24 09:28 UTC] dmitry@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2017-03-31 13:51 UTC] maarten dot segers at amplexor dot com

How has this been resolved? We still experience the "Error Fetching http headers" error using SoapClient.

 [2017-03-31 13:53 UTC] spam2 at rhsoft dot net

> How has this been resolved? 
> We still experience the "Error Fetching http headers" 
> error using SoapClient

PHP Version: 5.2.3

how about stop re-open *10 years* old bugreports at least without mentioning you PHP version and if it's below 7.0.0 you won't get any change

 [2017-03-31 14:02 UTC] maarten dot segers at amplexor dot com

PHP 7.0.15-1~dotdeb+8.1

There's a ton of blog posts out there on "Error Fetching http headers" with SoapClient but after ten years the only ticket fixing this cryptic message doesn't explain how.

 [2017-03-31 14:03 UTC] requinix@php.net

-Block user comment: No
+Block user comment: Yes

Hi, I posted an issue with the Report Repository on the Google DFP API forums, they redirected me here, I’m having issues getting the Download URL of the report, when I make the request using the getReportDownloadURL method from ReportService I get the following:

PHP Laravel Log:

[2018-06-29 10:45:01] production.INFO: AdopsDfpCoordinator Searching oldest pending report [2018-06-29 10:55:19] production.ERROR: SoapFault exception: [HTTP] Error Fetching http headers in /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php:97 Stack trace: #0 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(97): SoapClient->__doRequest('<?xml version="...', 'https://ads.goo...', '', 1, 0) #1 [internal function]: GoogleAdsApiCommonAdsSoapClient->__doRequest('<?xml version="...', 'https://ads.goo...', '', 1, 0) #2 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/AdsSoapClient.php(152): SoapClient->__soapCall('getReportDownlo...', Array, NULL, Array, Array) #3 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Dfp/v201805/ReportService.php(96): GoogleAdsApiCommonAdsSoapClient->__soapCall('getReportDownlo...', Array) #4 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/app/Dfp/Repositories/ReportRepository.php(130): GoogleAdsApiDfpv201805ReportService->getReportDownloadURL(10160417517, 'CSV_DUMP') #5 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/app/Dfp/Repositories/ReportRepository.php(107): AdopsDfpRepositoriesReportRepository->downloadReport() #6 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/app/Dfp/Repositories/ReportRepository.php(98): AdopsDfpRepositoriesReportRepository->processReport() #7 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/app/Console/Commands/ReportScheduler.php(32): AdopsDfpRepositoriesReportRepository->processOldestReport() #8 [internal function]: AdopsConsoleCommandsReportScheduler->handle() #9 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array) #10 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): IlluminateContainerBoundMethod::IlluminateContainer{closure}() #11 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure)) #12 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL) #13 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): IlluminateContainerContainer->call(Array) #14 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/symfony/console/Command/Command.php(251): IlluminateConsoleCommand->execute(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle)) #15 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/laravel/framework/src/Illuminate/Console/Command.php(167): SymfonyComponentConsoleCommandCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle)) #16 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/symfony/console/Application.php(946): IlluminateConsoleCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput)) #17 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/symfony/console/Application.php(248): SymfonyComponentConsoleApplication->doRunCommand(Object(AdopsConsoleCommandsReportScheduler), Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput)) #18 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/symfony/console/Application.php(148): SymfonyComponentConsoleApplication->doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput)) #19 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): SymfonyComponentConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput)) #20 /app/shared/docroots/adops_dfp_coordinator/releases/20180604185549/artisan(35): IlluminateFoundationConsoleKernel->handle(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput)) #21 {main}

SOAP Log:

`[2018-06-29 10:45:02] DFP_SOAP.INFO: networkCode=4403 service=InventoryService method=getAdUnitsByStatement responseTime=186 requestId=565d077ac3267f6034c7c4dab6291a6a server=ads.google.com isFault=0 faultMessage=
[2018-06-29 10:45:19] DFP_SOAP.INFO: networkCode=4403 service=ReportService method=getReportJobStatus responseTime=313 requestId=c4cd221079c997b523f2872a24cbeba8 server=ads.google.com isFault=0 faultMessage=
[2018-06-29 10:50:03] DFP_SOAP.INFO: networkCode=4403 service=InventoryService method=getAdUnitsByStatement responseTime=186 requestId=ba2b09efa63a3ca5fea9c3b994617630 server=ads.google.com isFault=0 faultMessage=
[2018-06-29 10:55:02] DFP_SOAP.INFO: networkCode=4403 service=InventoryService method=getAdUnitsByStatement responseTime=196 requestId=97ff4eed55fe6d672635de4fe2086423 server=ads.google.com isFault=0 faultMessage=
[2018-06-29 10:55:19] DFP_SOAP.WARNING: networkCode=4403 service=ReportService method=getReportDownloadURL responseTime= requestId= server=ads.google.com isFault=1 faultMessage=Error Fetching http headers
[2018-06-29 10:55:19] DFP_SOAP.NOTICE: POST /apis/ads/publisher/v201805/ReportService?wsdl HTTP/1.1^M
Host: ads.google.com^M
Connection: close^M
User-Agent: PHP-SOAP/7.1.8^M
Content-Type: text/xml; charset=utf-8^M
SOAPAction: «»^M
Content-Length: 615^M
Authorization: REDACTED

<SOAP-ENV:Envelope xmlns:SOAP-ENV=»http://schemas.xmlsoap.org/soap/envelope/» xmlns:ns1=»https://www.google.com/apis/ads/publisher/v201805″>SOAP-ENV:Headerns1:RequestHeaderns1:networkCode4403</ns1:networkCode>ns1:applicationNameEvolve IQ Platform Brand Campaigns (DfpApi-PHP, googleads-php-lib/35.1.0, PHP/7.1.8)</ns1:applicationName></ns1:RequestHeader></SOAP-ENV:Header>SOAP-ENV:Bodyns1:getReportDownloadURLns1:reportJobId10160417517</ns1:reportJobId>ns1:exportFormatCSV_DUMP</ns1:exportFormat></ns1:getReportDownloadURL></SOAP-ENV:Body></SOAP-ENV:Envelope>

HTTP/1.1 200 OK^M
Content-Type: text/xml; charset=UTF-8^M
Date: Fri, 29 Jun 2018 17:45:19 GMT^M
Expires: Fri, 29 Jun 2018 17:45:19 GMT^M
Cache-Control: private, max-age=0^M
X-Content-Type-Options: nosniff^M
X-Frame-Options: SAMEORIGIN^M
X-XSS-Protection: 1; mode=block^M
Server: GSE^M
Alt-Svc: quic=»:443″; ma=2592000; v=»43,42,41,39,35″^M
Accept-Ranges: none^M
Vary: Accept-Encoding^M
Connection: close
`
AUTH info:

`[DFP]
networkCode = «4403»
applicationName = «Evolve IQ Platform Brand Campaigns»

[OAUTH2]
clientId = «348011291855-amje5jb8e7e66eok6q1dk1i1dij9vmai.apps.googleusercontent.com»
`

We are setup with iATS for credit/debit card and ACH transactions and are in the last stages of testing. One time card and ACH contributions are working. For the sake of testing, we are doing daily recurring contributions to make sure the mechanism works. We haven’t yet tested recurring ACH. Recurring credit card transactions are going through, but with mixed results.

Issue: Within the last week, we’ve gotten intermittent errors during the recurring contribution scheduled job that prevents the contribution from being marked Complete in Civi. The error is «Error Fetching HTTP Headers.»

Symptoms: Two transactions with through perfectly (Aug 17 12:00am; Aug 23 12:00am) and emailed automatic receipts. The other transactions, however, are processing (visible in iATS’ journal and with my bank), but marked Pending (Incomplete Transaction) in Civi. The Civi source reads: iATS Payments Recurring Contribution (id=2) Unexpected Server Error, please see your logs. Emails for these Pending transactions did not send.

Details:

In the Job Log for iatsrecurringcontributions:
The job last night started at 2016-08-24 00:00:04 and then finished at 2016-08-24 00:01:07 with these details:

Parameters parsed (and passed to API method):
a:1:{s:7:»version»;i:3;}

Full message: Finished execution of iATS Payments Recurring
Contributions with result: Success (1 contribution record(s) were
processed.

Failed to process recurring contribution id 2: Unexpected Server Error, please see your logs
Created activity record for contact id 203)

In looking at the Drupal logs, I have two relevant records for last night’s Pending (Incomplete Transaction), an error and a notice, both from hostname 127.0.0.1.

The error:

SoapFault: SoapFault Object (
[message:protected] => Error Fetching http headers
[...a long list of arrays detailing the transaction, our iATS information, API calls and drush commands]
[previous:Exception:private] => 
[faultstring] => Error Fetching http headers
[faultcode] => HTTP
)

The notice:

Raw Response:
HEADER:
BODY:
BODYEND:

Attempted Resolution: From initial searches in Stackexchange and Google at large, it might be a server setting, perhaps? After a couple days of trouble initially, I increased two settings in my /etc/my.cnf file just to test and then restarted httpd and nginx:

max_allowed_packet = 128M (was 16M)
wait_timeout = 300 (was 60)

Since I still had the issue last night, it must be something else. Any ideas on how to resolve the «Error Fetching http headers»?

Civi 4.6.14 (will be updating to 4.6.20 before go-live); Drupal 7.44; iATS Payments extension 1.5.3; CentOS Linux 7.2.1511; Plesk 12.5.3; PHP 5.6.24 on website; PHP 5.4.16 on command line; nginx 1.11.1; Apache 2.4.6

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Ошибка f 05 на стиральной машине hotpoint ariston как устранить
  • Ошибка error failed to load api ms win core libraryloader l1
  • Ошибка esc skoda octavia a7
  • Ошибка f003 рено
  • Ошибка f 05 на котле vaillant turbofit

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии