question

daviga_66 avatar image
0 Likes"
daviga_66 asked ·

Connection refused response from API

Hello, I'm using the API to make various automated queries, I'm not passing the limits though (as far as I know). Yet, in the past few days, I've started getting connection refused error, for some of the requests being sent. What could be the reason? how do I debug this?
api-problem
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

daviga_66 avatar image
0 Likes"
daviga_66 answered ·
Hello, thanks for the tips, I'm afraid though they didn't change my results. I've tried making the request as XML this time, I fixed the API Version into 1.13.0, the category I'm using is a valid one (123 was just an example), also the 1000 entries per page was a type in this post, it actually is 100. For testing purposes, I took off most of my filters, and still the error prevail. See the following code: curl_setopt($ch, CURLOPT_URL, http://svcs.ebay.com/services/search/FindingService/v1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS,' ' .' ' .' ' .' 100 ' .' '.$pageNo.' ' .' ' .' 20081 ' .' StoreInfo ' .' SellerInfo ' .' FeedbackScoreMin 100 ' .' '); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "X-EBAY-SOA-SECURITY-APPNAME:$appID", 'X-EBAY-SOA-SERVICE-VERSION:1.13.0', 'X-EBAY-SOA-OPERATION-NAME:findItemsAdvanced', 'X-EBAY-SOA-RESPONSE-DATA-FORMAT:JSON', 'Cache-Control: no-cache', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language: en-US,en;q=0.8', 'Avail-Dictionary: QVXIyG1O', 'Cache-Control: max-age=0', 'Pragma:no-cache', 'Upgrade-Insecure-Requests: 1' )); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36"); $respnse = curl_exec($ch); I ran this script as a cron job every 1 minutes for over two hours (197 minutes), and logged the results. The connection refusal response seems to be completely random, and occurred in 44 cases, which means a significant 22% failure rate - could this really be normal server issues on eBay's end? that's way too much. In my test, the refusal occurred between one time, up to 4 times in a row (every minute in a 4 minutes). I tried routing requests from another IP on my server, and it didn't help neither. What else can I do?
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered ·
You might be getting dumped for the SDCH stuff or insecure upgrades. And again it might be a particular pool server. Turn on curl verbose and see if it gives any hints. I don't see any 500 errors in my call logs. And I only see one API server with dig svcs.ebay.com svcs.g.ebay.com. 37 IN A 66.211.179.158 If you have more than one IP, uou can also dump details out about which server (IP) is being contacted with each request. Check to see if there's a pattern such as all the 500's coming from one IP. That would indicate a bad server/config on eBay's end. https://stackoverflow.com/questions/3757071/php-debugging-curl/3760294
· 1 · Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi, I solved the problem, it turned out to be a problem with my host firewall. for some reason, it started blocking some of eBay's IPs. Thanks.
0 Likes 0 · ·
clickimusprime avatar image
0 Likes"
clickimusprime answered ·
bad categoryID 123 entriesPerPage is limited to 100 UnitPriceInfo is currently only relevant to Buy It Now items on EU sites, but you are searching the US site because you didn't specify GLOBAL-ID. You may be hitting a particular server in the eBay pool that can't handle one of these. We ask for a sample URL so that we can test specifically what is failing. Providing a URL with values substituted out (expect for APPID) may prevent anyone from seeing the issue you are seeing. Also you should use the current version of the API: 1.13.0 There are times when 500 errors just occur due to server or code issues at eBay.
· 4 · Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I'm trying to post a reply but its waiting for a "moderator" to approve my reply. Why eBay? I don't get it.
0 Likes 0 · ·
Hello, thanks for the tips, I'm afraid though they didn't change my results. I've tried making the request as XML this time, I fixed the API Version into 1.13.0, the category I'm using is a valid one (123 was just an example), also the 1000 entries per page was a type in this post, it actually is 100. For testing purposes, I took off most of my filters, and still the error prevail.
0 Likes 0 · ·
I ran the script as a cron job every 1 minutes for over two hours (197 minutes), and logged the results. The connection refusal response seems to be completely random, and occurred in 44 cases, which means a significant 22% failure rate - could this really be normal server issues on eBay's end? that's way too much. In my test, the refusal occurred between one time, up to 4 times in a row (every minute in a 4 minutes). I tried routing requests from another IP on my server, and it didn't help neither.
0 Likes 0 · ·
![CODE:][1] [1]: /storage/temp/1712-code-ebay.png
0 Likes 0 · ·
code-ebay.png (47.0 KiB)
daviga_66 avatar image
0 Likes"
daviga_66 answered ·
Hi, I'm not sure what is a REST URL. Also, what is an endpoint? keep in mind my code does work most of the times, so I'm not sure what's wrong. Basically I'm using this piece of code in order to pull results: $eurl = " http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=[My-CODE]&OPERATION-NAME=findItemsAdvanced&SERVICE-VERSION=1.9.0&RESPONSE-DATA-FORMAT=JSON&REST-PAYLOAD&paginationInput.pageNumber=1&outputSelector(0)=UnitPriceInfo&outputSelector(1)=StoreInfo&outputSelector(2)=SellerInfo&DestinationCountryCode=US&categoryId=123&paginationInput.entriesPerPage=1000";; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $eurl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_HEADER, 0); $respnse = curl_exec($ch);
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

helios825 avatar image
0 Likes"
helios825 answered ·
Help us repeat your experience and see for ourselves. Can you provide a simple REST URL that we can use to see the effect? (Please be sure to mask your AppID.) Also, check to make sure you're using the correct endpoint.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.