Support » Plugin: Amazon Link » Problems connecting to API (Again)

  • Hello there,

    I started last month having problems with the connection to the API most of the time (sometimes oddly it worked), only with plugins and only in my domain.

    The plugin says: AWS Request Failed, please check keys – Error Message: AWS query failed to get a response – try again later.

    I need the use of plugins for the links, because I work with two countries.

    Some of the things I did

    – I deleted and created my keys lots of times.
    – I tried disabling other plugins.
    – I tried reinstalling plugins.
    – I tried rolling back to a previous wordpress version (because this started after the 5.0 update).
    – In another site, locally, it works.
    – I cloned my site, and there it worked. In theory, a total clone from my site, without touching anything.
    – I have checked my API keys here and they work too https://webservices.amazon.es/scratchpad/
    -It is really odd, and I do not know what else to look at. I think it is something they did, because this happened to me before one year ago… but I already tried speaking with Amazon support, and they have no clue. They say must be plugin related.

    So… any idea? Someone can help me with this?

    This is driving me crazy…

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author paulstuttard

    (@paulstuttard)

    Hi,

    Sorry things aren’t working properly, that error is generated by the plugin when it does not get the expected response from Amazon’s servers.

    I have quickly hacked together a plugin which will use the amazon-link plugin to do a request and output the raw result from the server to your WordPress User Profile page.

    You can download the plugin from here:
    amazon-link-test.php

    This might give you some clues, try doing it with localisation turned on and turned off.

    Paul

    Oh! Very nice of you. I will take a look and try to see what is happening. Thanks!

    Ok, I added the code to my functions in some test environment.
    One in the same domain… And I see the “AMAZON QUERY RESPONSE” on my profile… but nothing else. 🙁
    I tried also in other test domain, locally, where it works (same API keys) and there I see the query, and all.

    I am not sure it is giving any response (or even making calls) when the keys could not be validated to begin with. 🙁 I have the message “AWS Request Failed, please check keys – Error Message: AWS query failed to get a response – try again later.”

    Or there is something from my domain blocking the calls? I already started talking with the hosting provider too.

    Thanks for all.

    Hi Paul!

    I am still working on solving this. The plugin didn’t help in my domain. But I tried it in other websites where the connection works and it worked there.

    At the end, I installed the Query monitor plugin, so I could see the API call errors.

    There I saw two things:
    – Amazon link plugin is using http instead of https for the calls. I don’t know if there is any option to change this, I couldn’t find it. (My site works on https).

    – The API call gets this answer:

    503 Service Unavailable-
    HTTP API Transport: curl
    DNS Resolution Time: 0,0042
    Connection Time: 0,0451
    Transfer Start Time (TTFB): 0,1812
    Response Size: 355 B
    Response Content Type: text/html
    IP Address: 52.94.218.55

    I used the same query on my browser and it worked. So it must really be something domain or host related. I am working now with the hosting providers to check if there is something there.

    Also, I found in other forum, that there are at least two people more experiencing the same problem.

    Plugin Author paulstuttard

    (@paulstuttard)

    Hi,

    If you want you could try editing one of the plugin files to change the requests to use https?

    In the file:

    wp-content/plugins/amazon-link/include/awsRequest.php

    Line 70 contains:

    
       $request = "http://".$host.$uri."?".$canonicalized_query."&Signature=".$signature;
    
    

    Simply change the http to https.

    Paul

    Thanks!

    I will take a look. Just to know, I would have to change it again after updating, is it?

    Yesterday I activated the cache options from your plugin… And it seems like it is working better now!

    I still have to wait and see, because this also happened before that it seemed to work and then stopped working again. If it now works… maybe it is because the plugin makes too fast or too many calls?

    Plugin Author paulstuttard

    (@paulstuttard)

    Hi,

    Yes, Amazon have some pretty low quotas on the AWS service, if you exceed them then it will block further requests for a while. The cache will definitely help with this.

    The plugin should only make one call per link/product, so if you have a lot of products on one page then it may struggle. The cache is also important, else every visitor to the site will cause a request to be made.

    Paul

    • This reply was modified 5 months, 2 weeks ago by  paulstuttard.
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.