Closed (fixed)
Project:
Amazon Product Advertisement API
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2010 at 04:03 UTC
Updated:
12 Feb 2011 at 22:40 UTC
After the upgrade to 6.x-1.2, all images from Amazon's database are lost. Refreshing them via Cron fails without exception with massive errors, e.g.:
Error retrieving Amazon item AWS.InvalidParameterValue, message: B000O5B4QU is not a valid value for ItemId. Please change this value and retry your request..
With 6.x-1.1 there were no even remotely related problems; Views worked just fine with 'Amazon' data.
Also, the watchdog log is flooded with PHP errors like "User warning: You have an error in your SQL syntax..." and "User warning: Column 'uid' in on clause is ambiguous query".
Comments
Comment #1
rfaySounds bad. Please give the full warnings.
It sounds like you failed to run update.php. Is that possible?
Comment #2
asb commented> It sounds like you failed to run update.php. Is that possible?
No, definitely not, at least not if Drush works. When revisiting
./update.phpthere are no pending updates left.>Please give the full warnings.
I'm not sure if they're related to error mentioned above.
Example for "User warning: You have an error in your SQL syntax...":
Comment #3
rfaySo the two new database updates in 6.x-1.2 as opposed to 6.x-1.1 are amazon_update_6014() and amazon_update_6015().
(Please confirm that you were updating from 6.x-1.1.)
The biggest database differences that could mess everything up are that Amazon removed the customerreviews feature (basically). So update #6015 removed the amazon_item_customer_review table and added the customerreviews_iframe field to amazon_item.
If you could check the database to see if your table actually got updated.
should show a field called customerreviews_iframe.
Did you use drush to do the update to 6.x-1.2, with drush updatecode? Or some other technique?
Do you see any errors in the dblog from the update time?
Thanks for your help sorting this out.
-Randy
Comment #4
rfaySo for all non-US locales, basically everything is broken. You can't do a lookup of an amazon item. My bet is that they changed something in the API and we updated the schema version because of the removal of customer reviews.
Comment #5
rfayNot all ASINs fail. For example, 1405318635 works.
Comment #6
rfay@asb, The specific example you gave in the original post was asin B000O5B4QU. That is in fact, not a valid ASIN on amazon.de. I'm not sure whether amazon.de has shifted underneath us or what, but I think you may actually have a bunch of invalid ASINs. You won't find B000O5B4QU searching amazon.de.
The amazon.de version seems to be http://www.amazon.de/High-School-Musical-Vanessa-Hudgens/dp/B000PHVYJ4/r..., asin B000PHVYJ4.
Please take a look at the other ASINs that were failing and see if they exist on amazon.de. If they do, please post some here.
You may like the cool new lookup autocomplete-by-title interface to fix these if that's what's going on.
Comment #7
asb commented> Please confirm that you were updating from 6.x-1.1.
Yes.
> If you could check the database to see if your table actually got updated.
> Did you use drush to do the update to 6.x-1.2, with drush updatecode?
The usual sequence I'm using is
drush rf ; drush up ; drush updatedb, and an optionaldrush cc(all).> Do you see any errors in the dblog from the update time?
Sorry, I can't help with that; for performace reasons I'm keeping the log only for 24 hrs, and watchdog log is flooded with errors after minutes (~10 PHP errors per minute). At least Drush indicated no problems when running the updates.
Regarding invalid ASINs etc.: If I see an item that is successfully updated I'll start looking into the bad ones ;) But there at least two distinct issues here, I think:
Gut feeling: I don't think that this has anything to do with customer reviews, I can't remember having them used anyway; IMHO this is a Views issue, at least the cover images are still rendered in the CCK fields attached to nodes. However, if I'm filtering down in views to
invalid_asinonfield_asin_asin, I'm getting no (zero) invalid items; if I'm filtering onfield_legacy_asin_asin, I'm getting exactly 15 items, and this view does include Amazon cover images. This doesn't even come close to the hundreds of ASINs reported in watchdog with an "AWS.InvalidParameterValue".> The specific example you gave in the original post was asin B000O5B4QU. That is in fact, not a valid ASIN on amazon.de.
How do you still validate an ASIN at Amazon? For me, searching (entering a number in the search box) works only for ISBNs (books), not for the proprietary ASINs (DVDs etc.). Also, the old scool, manually constructed URLs to ASINs seem not to work anymore. Or have them maybe all become all invalid? If they were so unstable and not even redirected (as they used to), all this hassling with 'Amazon' module and it's never-being-up-to-date-data would be quite futile, wouldn't it?
Comment #8
rfayI agree there are two problems.
1. There's something wrong with your view that's generating the sql errors. Not sure about that.
2. You have a number of invalid ASINs. That seems to be the key issue here. We may have to split these into two separate issues.
For now, since it was the main focus of your posting, I'm going to focus on the invalid ASINs for this issue.
To check whether an ASIN is valid, go to the Amazon site in question and search for it. You'll easily find B000O5B4QU on Amazon.com, but not on Amazon.de.
An easy validation technique for Amazon.com is a URL of the format:
http://www.amazon.com/gp/product/B000O5B4QU
For Amazon.de and other locales,
http://amazon.de/o/ASIN/B000O5B4QU
(Note that that one fails, because the correct ASIN for amazon.de seems to be B000PHVYJ4.)
http://www.amazon.de/o/ASIN/B000PHVYJ4
I definitely feel your pain, as Amazon moves these things around and confuses all of us.
Keeping this as "Postponed" awaiting your tests on the ASINs that are failing.
BTW: On the views issue, please test the provided default view and see if it works for you. You may need to rebuild your view. As mentioned in the release notes and elsewhere, if your view is referring to the customer reviews it will be broken.
Comment #9
asb commentedOK, what I can say so far:
SELECT DISTINCT(node.nid), at least not the ASIN check. I'll have to build a couple of views to check this.Bottomline: Only one of these issues are directly related to the vanished Amazon cover images: the new "Link behavior" setting.
Greetings, -asb
Comment #10
rfayThanks, asb. As I said, we're only going to deal with the "error retrieving" issue here.
I have my sandbox set to amazon.de.
As far as I can tell, ASINs that get redirected by amazon.de are *not* valid ASINs.
You gave me just one ASIN, 3933131650, which you believe to be valid and which you're having trouble with. I'm able to create a node with it, and it shows the picture fine. If I create an "amazon_example" node with it, the picture shows. If I view the amazon_example_view, the image shows in the view.
The "link behavior" is not new - I could be wrong but I think that's been there since before I started maintaining the module. Maybe not.
I think that it's likely that Amazon.de has done you a disservice by dropping or changing a lot of ASINs.
If you want to render all invalid items invalid, you can "update amazon_item set timestamp=0" and then "drush cron" many times. You'll then go through all of them.
Thanks,
-Randy
Comment #11
asb commentedThat's probably the reason why they're redirected ;) Anyway they're handled by Amazon in a sensible way. More examples for ASINs which are reported invalid by 'Amazon' module but which are still processed correctly by Amazon through redirects: B003DSHK2M, B003DSHK2M, B001VKY8FG, B001VKY8FG, B001VKY8FG. Imho the 'Amazon' module would require a sensible way to handle this, e.g. by comparing the values and replacing them with the new values in the local database (-> potential feature request). It is impossible to fix this by hand:
Also, should those maintenance processes not run through Batch API (as 'Pathauto' does)? (-> potential feature request)?
If it was there before, the update obviously has tampered with the settings, at least on all my sites with active 'Amazon' module. This (changed) setting is the reason for the broken views.
Anway, there should a third setting (link to node) which would need another issue (-> potential feature request).
Does it make sense to open feature requests, even if the 'Amazon' module currently seeks co-maintainers?
Greetings, -asb
Comment #12
rfayHmm. I seem to have lost my response to this. Shucks.
1. You've changed the title - does that mean link behavior is the only outstanding issue?
2. Views image "Link to node" has been removed in D7 and in D6 because Views 3 can't do it without messing up other things. I think you've found the culprit. I didn't realize that this had made it into the 1.2 release.
Thanks for your patience on this!
There is a large community contributing to Amazon features, so I would encourage you to make feature requests. There have been new features added in recent months, some sponsored, some not. The great new feature by frando that allows you to autocomplete-by-title when entering a CCK ASIN is a case in point. So the fact that I don't use amazon for any of my own sites doesn't mean that there aren't some very talented people who do.
Comment #13
asb commentedI changed the issue's title because unsetting the "link behaviour" setting caused the initial issue (symptom: "all images from Amazon's database are lost" in Views). I don't know if this is a localization issue or if/why I'm the only one experiencing this. If this is a freak accident not caused by code changes, there's no need for a patch, so this could be closed; if "link to node" existed in 1.1 and was removed in 1.2, there would be a fix necessary to prevent 'Amazon' module to fall into an undefinded state, causing wrong behaviour.
The other problems would require separate issues, even if they might be somehow related to this one.
Greetings, -asb
Comment #14
rfayComment #15
rfayI'm going to resolve this as fixed. Sorry for breaking things in the first place. If it's not resolved, speak up.