Test should detect and report invalid credentials
jvieille - October 19, 2009 - 15:23
| Project: | Amazon Module |
| Version: | 6.x-1.0-beta10 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | rfay |
| Status: | active |
| Issue tags: | 6.x-1.0 blocker |
Jump to:
Description
I am just trying this module, but cannot get anything working.
- the test fails with the subject message
- The cck field returns the following:
warning: Invalid argument supplied for foreach() in /home/controlc/www/sites/all/modules/amazon/amazon.module on line 348.
Amazon item : No Amazon product with the ASIN "0979560810" could be located.
warning: Invalid argument supplied for foreach() in /home/.../amazon/amazon.module on line 348.
My settings (associate ID, AWS account ID and access keys) are OK
Any idea?
Thanks for help

#1
What locale are you using? Does this ASIN show up on that locale?
I would not be surprised if your AWS access keys are the issue, so please check them again. Make sure no spaces have snuck in at the beginning and the end. Make sure that you used copy and paste from the AWS site, rather than typing them in.
I have no trouble with testing this... I'm sure interested in getting your problem solved.
I will evaluate a database dump if you want to provide one for me. Just put it somewhere and post a link, or attach it to the issue if it's relatively small, or email me with a link through the contact form.
#2
I did just run a test with invalid credentials, and got this message.
So I would say your problem is the credentials. Again, use copy and paste to put them in.
Changing the title to suggest improvement
#3
I have the same problem. I checked my credentials, created new and used copy and paste to put them in.
But nothing worked. I stell get the 348 message.
Is there maybe another reason why the message appears?
Thanks
#4
@redcap, I certainly want to get this solved for you. If you can dump your database and make it available to me, I'll load it up and debug it. You can email it to me at randy at randyfay.com if it's small, or email me a link to it.
#5
Thank you so much randy!
i just send it to you.
#6
@redcap, doing *nothing* but pasting in my AWS credentials made this work. I used ASIN 0596515804 and your admin account.
I should note that it looked like update.php had not been run on this database, and I did run it, so there are a number of errors that would result from that, assuming you're using 6.x-1.0-beta10. But even then it looked up everything just fine.
To anybody that is having this trouble:
Please, please copy and paste the credentials from the AWS website. Make sure you get the whole thing. Look at it twice. Consider generating a new set of keys if you're having this error.
To everybody: Whenever you update a module, please remember to run update.php.
#7
Randy helped me and togehter we fixed the problem.
My hosting Provider has an Outgoing Connection Manager and blocked all Connections to "ecs.amazon.com". I don´t know why he is doing that, but when you allow the access to "ecs.amazon.com" everthing works fine.
Thank you very much Randy for you help!
Tom
#8
I have been getting the same message on my local machine:
warning: Invalid argument supplied for foreach() in ..../sites/all/modules/amazon/amazon.module on line 348.However, on my remote server (VPS), where I have the exact same file structure and everything the same as my local machine (except the OS: Fedora 11 on my local machine and Centos 5 on the remote server), everything seems to work fine with the same credentials. While that's a relief, I would really like to have it working on my local machine too - so I can do the site development locally before uploading. Since it's working on my remote server using the same credentials, I guess the problem may have something to do with my local settings? I have no problem with Google Adsense, though - the ad blocks display fine on my local machine. Has anyone faced a similar situation - where it works on the remote server, but not on the local machine? Any help would be appreciated.
#9
I don't believe it has anything to do with remote vs local. In the case of @redcap, the issue was blocked ports.
Many local service providers block miscellaneous ports or hosts, so that may be your issue.
Please do report back when you get this solved.
I'm reopening this one, as the issue of reporting credential failure still needs to be looked at, and maybe we can give a better error message in the case of a blocked host.
#10