Closed markdwhite closed 13 years ago
Hi,
which version are you using?
v1.3.1...aha, we're now at 1.3.2...
I can only see new locales and code cleanup. Is there any other potential benefit from upgrading? I'll have to wait through a release deployment cycle to know if it does solve the issue if I do upgrade.
No there is no benefit only the locale has been added.
I tested the lookup functionallity with version 1.3.1 and there are no problems for me. So currently im not able to reproduce this error you're getting.
The function call youve implemented is correct: $response = $amazonEcs->responseGroup('Large')->lookup($ASIN);
Interesting is the first part of the StackTrace:
PHP Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in /var/www/booklending/lib/AmazonECS.class.php:229\nStack trace:\n#0 [internal function]: SoapClient->doRequest('<?xml version="...', 'https://webserv...', 'http://soap.ama...', 1, 0)\n#1
Could you try to get some more information according to the URLs which are displayed there? Maybe there is the error.
And could you also try to test the class on your system with the sampleItemLookup.php ? Is there also an Exception Thrown when you run this example file?
Thanks
Thanks for following up.
I'd increased the logging and have a little more information. The code centers around some page scrapers which are being run regularly. Usually, this particular one runs in less than a minute. The webserver access logs show that it actually took 2 mins to return. Could this possible be a timeout error?
AmazonECS is being instantiated in the standard way, using constants, like so: $amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'com', AWS_ASSOCIATE_TAG); $amazonEcs->setReturnType(AmazonECS::RETURN_TYPE_ARRAY);
I can provide any information that might help to track this down, but I'm unsure how to best do this. Should I just dump $webserviceWsdl and $webserviceEndpoint to a logfile before #229 "return $soapClient->__soapCall($function,array($params));". or would you suggest something else.
No problems when I use sampleItemLookup.php, and this has been my only test so far - to take the ASINs that caused the error and test them in sampleItemLookup.php to see if they are causing the error to be thrown. And they don't. But this is a very occasional error - I'm calling this method thousands of times during the day, and yesterday saw just two of these errors.
So what should the best next steps be to help?
Hm.. Its possible that this is a timeout error. Maybe the Webservice is so milliseconds not available for some reasons and this is why the request fails. But i'm not sure.
It is very difficult to reproduce that. Maybe try to refetch the product information when it fails by catching the exception and restart the procedure?
I understand it's not an obvious one...
So are you suggesting something like this? If so, sounds reasonable...
try { $response = $amazonEcs->responseGroup('Large')->lookup($ASIN); } catch (Exception $e) { // Dump $e to log with retrying message try { $response = $amazonEcs->responseGroup('Large')->lookup($ASIN); } catch (Exception $e) { // Dump $e to log with failed message } }
Yes something like this.
If your running the product Lookup in a loop try to use the sleep function between the requests. Maybe this also could help.
Sounds good. Thanks for following this one through - it's much appreciated
I'm getting very occasional isolated errors with the library, but i'm not able to see the exact cause of the error, as I only get this in apache2/error.log:
[Thu Oct 06 00:01:17 2011] [error] [client 127.0.0.1] PHP Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in /var/www/booklending/lib/AmazonECS.class.php:229\nStack trace:\n#0 [internal function]: SoapClient->doRequest('<?xml version="...', 'https://webserv...', 'http://soap.ama...', 1, 0)\n#1 /var/www/booklending/lib/AmazonECS.class.php(229): SoapClient->soapCall('ItemLookup', Array)\n#2 /var/www/booklending/lib/AmazonECS.class.php(126): AmazonECS->performSoapRequest('ItemLookup', Array)\n#3 /var/www/booklending/inc/functions.inc.php(640): AmazonECS->lookup('B001DJU2D2')\n#4 /var/www/booklending/inc/scriptfunctions.inc.php(594): getBookInfo('B001DJU2D2')\n#5 /var/www/booklending/scripts/scripts.php(65): scrapeFreeSearchPages()\n#6 /var/www/booklending/index.php(348): include('/var/www/bookle...')\n#7 {main}\n thrown in /var/www/booklending/lib/AmazonECS.class.php on line 229
functions.inc.php line 640 calls the class method with this, as it does thousands of times each day with no problems: $response = $amazonEcs->responseGroup('Large')->lookup($ASIN);
Searching for the same ASIN today with test code shows no problems. The code is running on AWS EC2 instances so I would expect it to be done to connection problems, though it's possible.
Is this likely to be an error with the class, or should I be looking at trying to catch the exception in the calling function and trying to figure out what's going wrong there?
Cheers,
Mark...