thybag / PHP-SharePoint-Lists-API

A simple PHP API to make working with SharePoint lists easy.
MIT License
184 stars 95 forks source link

Intermittent Curl error: Error (Sender) Curl error: Operation timed out after 0 milliseconds with 0 out of 0 bytes received #113

Closed mgroat closed 8 years ago

mgroat commented 8 years ago

I've been intermittantly getting this error the past few days:

Fatal error: Uncaught exception 'Exception' with message 'Error (Sender) Curl error: Operation timed out after 0 milliseconds with 0 out of 0 bytes received,more=' in C:\inetpub\wwwroot\sharepointAPI\src\Thybag\SharePointAPI.php:1013 Stack trace: #0 C:\inetpub\wwwroot\sharepointAPI\src\Thybag\SharePointAPI.php(327): Thybag\SharePointAPI->onError(Object(SoapFault)) #1 C:\inetpub\wwwroot\sharepointAPI\src\Thybag\Service\QueryObjectService.php(174): Thybag\SharePointAPI->readListMeta('Quality Action ...', true) #2 C:\inetpub\wwwroot\tests\sharePoint.php(24): Thybag\Service\QueryObjectService->all_fields() #3 {main} thrown in C:\inetpub\wwwroot\sharepointAPI\src\Thybag\SharePointAPI.php on line 1013

Is this something other people are seeing, or is it more likely to be something misconfigured on my end? I tried the below test code:

<?php
$xmlFile = "myXmlFile.xml";
$account = "myName@myCompany.com";
$password = "myPassword";

//Run as long as we need to, and show all errors
ini_set('max_execution_time', 30000);
ini_set('display_errors', 1); 
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

//Set up our sharepoint object
require "../sharepointAPI/SharePointAPI.php";
$sp = new Thybag\SharePointAPI($account,$password,$_SERVER['DOCUMENT_ROOT']."/".$xmlFile,'SPONLINE');

//Run a bunch of queries, and see if we get errors
for($i=0;$i<50;$i++) {
    $startTime = time();
    //I'm generating a new connection every time
    //Otherwise, the connection times out after about 20 runs through the loop
    $sp = new Thybag\SharePointAPI($account,$password,$_SERVER['DOCUMENT_ROOT']."/".$xmlFile,'SPONLINE');
    $sp->query("My List Name")->where("Title","=","Some string")->all_fields()->get();
    echo "<br>Test $i took ".(time()-$startTime)." seconds<br>";
}

The output I get from the above script is:

Test 0 took 1 seconds

Test 1 took 2 seconds

Test 2 took 8 seconds

Test 3 took 5 seconds

Test 4 took 2 seconds

Test 5 took 5 seconds

Test 6 took 2 seconds

Test 7 took 2 seconds

Test 8 took 1 seconds

Test 9 took 4 seconds

Test 10 took 1 seconds

Test 11 took 10 seconds

Test 12 took 2 seconds

Test 13 took 5 seconds

Test 14 took 10 seconds

Test 15 took 6 seconds

Test 16 took 1 seconds

Test 17 took 8 seconds

Test 18 took 5 seconds

Test 19 took 2 seconds

Test 20 took 5 seconds

Test 21 took 1 seconds

Test 22 took 6 seconds

Test 23 took 5 seconds

Test 24 took 1 seconds

Test 25 took 2 seconds

Test 26 took 2 seconds

Test 27 took 2 seconds

Test 28 took 4 seconds

Test 29 took 6 seconds

Test 30 took 4 seconds

Test 31 took 3 seconds

Test 32 took 1 seconds

Test 33 took 13 seconds

Test 34 took 5 seconds

Test 35 took 2 seconds

Test 36 took 2 seconds

Test 37 took 1 seconds

Test 38 took 5 seconds

Fatal error: Uncaught exception 'Exception' with message 'Error (Sender) Curl error: Operation timed out after 0 milliseconds with 0 out of 0 bytes received,more=' in C:\inetpub\wwwroot\sharepointAPI\src\Thybag\SharePointAPI.php:1013 Stack trace: #0 C:\inetpub\wwwroot\sharepointAPI\src\Thybag\SharePointAPI.php(327): Thybag\SharePointAPI->onError(Object(SoapFault)) #1 C:\inetpub\wwwroot\sharepointAPI\src\Thybag\Service\QueryObjectService.php(174): Thybag\SharePointAPI->readListMeta('Quality Action ...', true) #2 C:\inetpub\wwwroot\tests\sharePoint.php(24): Thybag\Service\QueryObjectService->all_fields() #3 {main} thrown in C:\inetpub\wwwroot\sharepointAPI\src\Thybag\SharePointAPI.php on line 1013

mgroat commented 8 years ago

This issue seems to have disappeared shortly after it started. Since nobody else seems to have had the same issue, I'll assume it was some temporary issue on my end and mark it closed.