dmcquay / node-apac

node-apac - Node.js client for the Amazon Product Advertising API, including support of Request Signatures

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error 503 without "Accept : */*" header

michelelazzeri opened this issue · comments

commented

Hi,

starting from 23 January 2018 at 17:30 UTC, node-apac stop to work in our backed. All requests return status "503 service unavailable". Comparing curl requests with node-apac requests we found the problem and fix it adding header Accept (lib/operation-helper.js line 93)

        var options = {
            hostname: host,
            path: uri,
            method: 'GET',
            headers: {
                Accept: '*/*'
            }
        }

Can anyone confirm this behaviour?

Thank you @michelelazzeri!

I've been banging my head against the wall as to why I keep getting those "Website Temporarily Unavailable" HTML response from Amazon for the past few days. I consider this a very serious issue on Amazon's side, and I started getting it in January 23 too.

I've tried to use your fork (with the Accept: */* fix) but I still get the same 503 errors. So we share the same problem, but the solution doesn't work for me.

Did you change anything else while trying to solve this problem? Maybe the server type or IP?
Does the 503 problem reoccur to you if you stop sending Accept: */*?

Here's an interesting point:
I'm running node-apac 3.0.2 on my Mac (from Israel) and never get this error
I'm running the exact same node-apac from an EC2 server (Virginia, us-east-1) and keep getting this error for the past 4 days. With or without the Accept: */* fix.

Would appreciate any help trying to nail this issue.

commented

Hi @liorgrossman

I try now without "Accept" header and it's works...probably they fix somethings... and probably you occurs in another problems, but the event surely are the same, a new release of pa-api server software.

I suggest you to use cURL to test the same HTTP request in your environment and EC2 servers, logging the request done by apac.

var options = {
            hostname: host,
            path: uri,
            method: 'GET',
            headers: {
                Accept: '*/*'
            }
        }
        console.log(`curl -v "${host}${uri}" `);

I hope this will be useful to you

Thanks.
I wanted to update that the Error 503 stopped happening to me to, so I assume Amazon fixed it.
I'm not sure this issue would ever return, but I think it might be a good idea to integrate the fix (Accept */*) into node-apac, just in case.