Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Uncaught GuzzleHttp\Exception\ServerException: Server error #98

Closed
taifunorkan opened this issue Nov 17, 2019 · 5 comments
Closed

Uncaught GuzzleHttp\Exception\ServerException: Server error #98

taifunorkan opened this issue Nov 17, 2019 · 5 comments

Comments

@taifunorkan
Copy link

taifunorkan commented Nov 17, 2019

Hello, this is my first issue here! Thank you for reading.

For the last five months this fatal error occurs more and more, almost every day. Otherwise my homepage is working. It is really annoying, because I put a lot of work in it: https://www.schnipp-schnapp-schnappi.de/search.php

I also work on a project to create rss feeds from ebay api and therefore I'm glad to use this great sdk.

I've tried to fix this problem by updating to sdk 18.0, but nothing changed. At times when the error occurs ebay system status seems to be in "good health". The problem has brought my projects to halt. It seems that I would need some assistance.

I'll give you some more details.

$config= EPNConfig::ePNCredentials();

`class EPNConfig {
static function ePNCredentials() {
return [
'sandbox' => [
'credentials' => [
'devId' => 'xxx',
'appId' => 'xxx',
'certId' => 'xxx',
],
'authToken' => 'YOUR_SANDBOX_USER_TOKEN_APPLICATION_KEY',
'oauthUserToken' => 'YOUR_SANDBOX_OAUTH_USER_TOKEN',
'ruName' => 'xxx'

        ],
        'production' => [
            'credentials' => [
                'devId' => 'xxx',
                'appId' => 'xxx',
                'certId' => 'xxx',
            ],
            'authToken' => 'xxxx',
            'oauthUserToken' => 'xxx',
            'ruName' => 'xxx'
        ],
        
        'FindingApiVersion' => '1.13.0',
        'ShoppingApiVersion'=> '1057',
        
        'affiliate' => [
    		'trackingId' => 'xxx',
    		'customId' => 'xxx',
    		'networkId' => '9',
    		'geoTargeting' => true
        ],

        'siteId'  => 77, // 77 Germany
        'globalId' => 'EBAY-DE'
    ];
}

}`

In the main script:

/** Composer Autoload to define Namespaces */
if ( file_exists(dirname(__FILE__).'/vendor/autoload.php') ) {
	require_once dirname(__FILE__).'/vendor/autoload.php';
}

$service = new Services\FindingService([
    'credentials' => $config['production']['credentials'],
    'globalId'    => $config['globalId']
]);

$request = new Types\FindItemsAdvancedRequest();

$response = $service->findItemsAdvanced($request);

@taifunorkan
Copy link
Author

I solved this problem, seems so. I updated my developer account credentials application and user authToken for production. With sandbox I wasn't able to register a new sandbox user with weird error messages. I hope this will not cause any future problems.

I think these tokens have a lifetime from 18 months. Maybe they were outdated. Now, seems that my projects are working again.

@taifunorkan
Copy link
Author

I am still dissapointed after updating the developer account it has beed working only for 2 hours and then stopped again.

@taifunorkan
Copy link
Author

taifunorkan commented Nov 18, 2019

<br />
<b>Fatal error</b>:  Uncaught GuzzleHttp\Exception\ServerException: Server error: `POST https://svcs.ebay.com/services/search/FindingService/v1` resulted in a `500 Internal Server Error` response:
&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;errorMessage xmlns=&quot;http://www.ebay.com/marketplace/search/v1/services&quot;&gt;&lt;error&gt;&lt;e (truncated...)
 in /var/www/html/used-guitars/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /var/www/html/used-guitars/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /var/www/html/used-guitars/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /var/www/html/used-guitars/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /var/www/html/used-guitars/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\P in <b>/var/www/html/used-guitars/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php</b> on line <b>113</b><br />

@taifunorkan
Copy link
Author

taifunorkan commented Nov 22, 2019

Would be nice if someone could respond to my dilemma! Even if the request api up and running, the request ends up in this horrible error message that explains nothing. I am sorry to say: This sdk seems to be not clever programmed and scarcely maintained. I feel let completely alone.

<br />
<b>Fatal error</b>:  Uncaught GuzzleHttp\Exception\ServerException: Server error: `POST https://svcs.ebay.com/services/search/FindingService/v1` resulted in a `500 Internal Server Error` response:
&lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;errorMessage xmlns=&quot;http://www.ebay.com/marketplace/search/v1/services&quot;&gt;&lt;error&gt;&lt;e (truncated...)
 in /var/www/html/used-guitars/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /var/www/html/used-guitars/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /var/www/html/used-guitars/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /var/www/html/used-guitars/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /var/www/html/used-guitars/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\P in <b>/var/www/html/used-guitars/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php</b> on line <b>113</b><br />

Api explorer test tool at https://developer.ebay.com/devzone/build-test/test-tool/Default.aspx?index=0&api=finding&call=findItemsAdvanced&variation=xml&env=production

says:

Call Response

Status: 200 OKTime: 612 ms

<?xml version='1.0' encoding='UTF-8'?>
<findItemsAdvancedResponse 
  xmlns="http://www.ebay.com/marketplace/search/v1/services">
  <ack>Success</ack>
  <version>1.13.0</version>
  <timestamp>2019-11-22T07:08:22.095Z</timestamp>
  <searchResult count="0"/>
  <paginationOutput>
    <pageNumber>0</pageNumber>
    <entriesPerPage>3</entriesPerPage>
    <totalPages>0</totalPages>
    <totalEntries>0</totalEntries>
  </paginationOutput>
  <itemSearchURL>https://www.ebay.com/sch/i.html?_sasl=xx&amp;_saslop=1&amp;_fss=1&amp;LH_SpecificSeller=1&amp;_ddo=1&amp;_ipg=3&amp;_os=S%7CD&amp;_pgn=1</itemSearchURL>
</findItemsAdvancedResponse>

@taifunorkan
Copy link
Author

This is the var_dump of my request:

  ["�DTS\eBaySDK\Types\BaseType�values"]=>
  array(7) {
    ["affiliate"]=>
    object(DTS\eBaySDK\Finding\Types\Affiliate)#52 (2) {
      ["values":"DTS\eBaySDK\Types\BaseType":private]=>
      array(4) {
        ["customId"]=>
        string(9) "schnappi1"
        ["networkId"]=>
        string(1) "9"
        ["trackingId"]=>
        string(10) "5337963632"
        ["geoTargeting"]=>
        bool(true)
      }
      ["attachment":"DTS\eBaySDK\Types\BaseType":private]=>
      array(2) {
        ["data"]=>
        NULL
        ["mimeType"]=>
        NULL
      }
    }
    ["descriptionSearch"]=>
    bool(false)
    ["categoryId"]=>
    object(DTS\eBaySDK\Types\RepeatableType)#31 (5) {
      ["data":"DTS\eBaySDK\Types\RepeatableType":private]=>
      array(2) {
        [0]=>
        string(4) "3858"
        [1]=>
        string(6) "181163"
      }
      ["position":"DTS\eBaySDK\Types\RepeatableType":private]=>
      int(0)
      ["class":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(50) "DTS\eBaySDK\Finding\Types\FindItemsAdvancedRequest"
      ["property":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(10) "categoryId"
      ["expectedType":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(6) "string"
    }
    ["itemFilter"]=>
    object(DTS\eBaySDK\Types\RepeatableType)#32 (5) {
      ["data":"DTS\eBaySDK\Types\RepeatableType":private]=>
      array(4) {
        [0]=>
        object(DTS\eBaySDK\Finding\Types\ItemFilter)#43 (2) {
          ["values":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["name"]=>
            string(11) "ListingType"
            ["value"]=>
            object(DTS\eBaySDK\Types\RepeatableType)#27 (5) {
              ["data":"DTS\eBaySDK\Types\RepeatableType":private]=>
              array(2) {
                [0]=>
                string(10) "FixedPrice"
                [1]=>
                string(14) "StoreInventory"
              }
              ["position":"DTS\eBaySDK\Types\RepeatableType":private]=>
              int(0)
              ["class":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(36) "DTS\eBaySDK\Finding\Types\ItemFilter"
              ["property":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(5) "value"
              ["expectedType":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(6) "string"
            }
          }
          ["attachment":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["data"]=>
            NULL
            ["mimeType"]=>
            NULL
          }
        }
        [1]=>
        object(DTS\eBaySDK\Finding\Types\ItemFilter)#44 (2) {
          ["values":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["name"]=>
            string(9) "Condition"
            ["value"]=>
            object(DTS\eBaySDK\Types\RepeatableType)#42 (5) {
              ["data":"DTS\eBaySDK\Types\RepeatableType":private]=>
              array(7) {
                [0]=>
                string(4) "2000"
                [1]=>
                string(4) "2500"
                [2]=>
                string(4) "3000"
                [3]=>
                string(4) "4000"
                [4]=>
                string(4) "5000"
                [5]=>
                string(4) "6000"
                [6]=>
                string(4) "7000"
              }
              ["position":"DTS\eBaySDK\Types\RepeatableType":private]=>
              int(0)
              ["class":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(36) "DTS\eBaySDK\Finding\Types\ItemFilter"
              ["property":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(5) "value"
              ["expectedType":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(6) "string"
            }
          }
          ["attachment":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["data"]=>
            NULL
            ["mimeType"]=>
            NULL
          }
        }
        [2]=>
        object(DTS\eBaySDK\Finding\Types\ItemFilter)#46 (2) {
          ["values":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["name"]=>
            string(11) "EndTimeFrom"
            ["value"]=>
            object(DTS\eBaySDK\Types\RepeatableType)#47 (5) {
              ["data":"DTS\eBaySDK\Types\RepeatableType":private]=>
              array(1) {
                [0]=>
                string(24) "2019-11-22T07:27:08.103Z"
              }
              ["position":"DTS\eBaySDK\Types\RepeatableType":private]=>
              int(0)
              ["class":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(36) "DTS\eBaySDK\Finding\Types\ItemFilter"
              ["property":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(5) "value"
              ["expectedType":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(6) "string"
            }
          }
          ["attachment":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["data"]=>
            NULL
            ["mimeType"]=>
            NULL
          }
        }
        [3]=>
        object(DTS\eBaySDK\Finding\Types\ItemFilter)#48 (2) {
          ["values":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["name"]=>
            string(15) "ExcludeCategory"
            ["value"]=>
            object(DTS\eBaySDK\Types\RepeatableType)#49 (5) {
              ["data":"DTS\eBaySDK\Types\RepeatableType":private]=>
              array(5) {
                [0]=>
                string(5) "38072"
                [1]=>
                string(6) "180009"
                [2]=>
                string(3) "621"
                [3]=>
                string(6) "118983"
                [4]=>
                string(6) "181168"
              }
              ["position":"DTS\eBaySDK\Types\RepeatableType":private]=>
              int(0)
              ["class":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(36) "DTS\eBaySDK\Finding\Types\ItemFilter"
              ["property":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(5) "value"
              ["expectedType":"DTS\eBaySDK\Types\RepeatableType":private]=>
              string(6) "string"
            }
          }
          ["attachment":"DTS\eBaySDK\Types\BaseType":private]=>
          array(2) {
            ["data"]=>
            NULL
            ["mimeType"]=>
            NULL
          }
        }
      }
      ["position":"DTS\eBaySDK\Types\RepeatableType":private]=>
      int(0)
      ["class":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(50) "DTS\eBaySDK\Finding\Types\FindItemsAdvancedRequest"
      ["property":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(10) "itemFilter"
      ["expectedType":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(36) "DTS\eBaySDK\Finding\Types\ItemFilter"
    }
    ["outputSelector"]=>
    object(DTS\eBaySDK\Types\RepeatableType)#50 (5) {
      ["data":"DTS\eBaySDK\Types\RepeatableType":private]=>
      array(5) {
        [0]=>
        string(11) "GalleryInfo"
        [1]=>
        string(15) "PictureURLLarge"
        [2]=>
        string(15) "AspectHistogram"
        [3]=>
        string(17) "CategoryHistogram"
        [4]=>
        string(10) "SellerInfo"
      }
      ["position":"DTS\eBaySDK\Types\RepeatableType":private]=>
      int(0)
      ["class":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(50) "DTS\eBaySDK\Finding\Types\FindItemsAdvancedRequest"
      ["property":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(14) "outputSelector"
      ["expectedType":"DTS\eBaySDK\Types\RepeatableType":private]=>
      string(6) "string"
    }
    ["paginationInput"]=>
    object(DTS\eBaySDK\Finding\Types\PaginationInput)#51 (2) {
      ["values":"DTS\eBaySDK\Types\BaseType":private]=>
      array(2) {
        ["entriesPerPage"]=>
        int(100)
        ["pageNumber"]=>
        int(1)
      }
      ["attachment":"DTS\eBaySDK\Types\BaseType":private]=>
      array(2) {
        ["data"]=>
        NULL
        ["mimeType"]=>
        NULL
      }
    }
    ["sortOrder"]=>
    string(15) "StartTimeNewest"
  }
  ["�DTS\eBaySDK\Types\BaseType�attachment"]=>
  array(2) {
    ["data"]=>
    NULL
    ["mimeType"]=>
    NULL
  }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants