davidtsadler / ebay-sdk-php

An eBay SDK for PHP. Use the eBay API in your PHP projects.
Apache License 2.0
350 stars 343 forks source link

Server error: `POST https://svcs.ebay.com/services/search/FindingService/v1` resulted in a `500 Internal Server Error` #222

Closed ganeshswami990 closed 6 years ago

ganeshswami990 commented 6 years ago

i am using sdk from a year and it was working perfect, but now same code stop working, but when i change credentials productions to sandbox it receive response without any items (a empty response), and same was working fine almost a month ago, i checked it many times with production and sandbox credentials and everything was fine, but from a month productions credentials giving me 500 internal server error and sandbox giving me a empty response, even i tried with 3 different credentials from 3 different accounts, and still same error, i am sure that credentials are correct,

$service = new Services\FindingService([
    'credentials' => $config['production']['credentials'],
    'globalId'    => Constants\GlobalIds::US
]);
/**
 * Create the request object.
 */
$request = new Types\FindItemsByKeywordsRequest();
/**
 * Assign the keywords.
 */
$request->keywords = 'Harry Potter';
/**
 * Send the request.
 */
$response = $service->findItemsByKeywords($request);
/**
 * Output the result of the search.
 */
if (isset($response->errorMessage)) {
    foreach ($response->errorMessage->error as $error) {
        printf(
            "%s: %s\n\n",
            $error->severity=== Enums\ErrorSeverity::C_ERROR ? 'Error' : 'Warning',
            $error->message
        );
    }
}
if ($response->ack !== 'Failure') {
    foreach ($response->searchResult->item as $item) {
        printf(
            "(%s) %s: %s %.2f\n",
            $item->itemId,
            $item->title,
            $item->sellingStatus->currentPrice->currencyId,
            $item->sellingStatus->currentPrice->value
        );
    }
}

and here is the error

Fatal error: Uncaught GuzzleHttp\Exception\ServerException: Server error:POST https://svcs.ebay.com/services/search/FindingService/v1resulted in a500 Internal Server Errorresponse: <?xml version='1.0' encoding='UTF-8'?><errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services"><error><e (truncated...) in /home/ebaylis/public_html/update/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:117 Stack trace: #0 /home/ebaylis/public_html/update/vendor/guzzlehttp/guzzle/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /home/ebaylis/public_html/update/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /home/ebaylis/public_html/update/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array) #3 /home/ebaylis/public_html/update/vendor/guzzlehttp/promises/ in /home/ebaylis/public_html/update/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 117

michabbb commented 6 years ago

As always: use the api test tool at your developer account and compare the requests to find the difference

ganeshswami990 commented 6 years ago

Thanks @michabbb , i don't know what was the issue but my error resolved after updating the newest version of sdk. and now it is working fine with same credentials

michabbb commented 6 years ago

btw.. why don´t people never close their issues... i will never understand this... 🤔

ganeshswami990 commented 6 years ago

Thanks, for everyone , i was getting this error because of api call limit,