Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib2.HTTPError: HTTP Error 503: Service Unavailable #160

Closed
Karlheinzniebuhr opened this issue Aug 14, 2019 · 5 comments
Closed

urllib2.HTTPError: HTTP Error 503: Service Unavailable #160

Karlheinzniebuhr opened this issue Aug 14, 2019 · 5 comments

Comments

@Karlheinzniebuhr
Copy link

Karlheinzniebuhr commented Aug 14, 2019

I'm getting this error on my gcloud app which runs python 2.7.16
Same error occurs on python 3.7.1 when executing the command line demo of the documentation

>>> amazon.lookup(ItemId='B07MFZY2F2') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\amazon\api.py", line 174, in lookup response = self.api.ItemLookup(ResponseGroup=ResponseGroup, **kwargs) File "C:\Python27\lib\site-packages\bottlenose\api.py", line 274, in __call__ {'api_url': api_url, 'cache_url': cache_url}) File "C:\Python27\lib\site-packages\bottlenose\api.py", line 235, in _call_api return urllib2.urlopen(api_request, timeout=self.Timeout) File "C:\Python27\lib\urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "C:\Python27\lib\urllib2.py", line 435, in open response = meth(req, response) File "C:\Python27\lib\urllib2.py", line 548, in http_response 'http', request, response, code, msg, hdrs) File "C:\Python27\lib\urllib2.py", line 473, in error return self._call_chain(*args) File "C:\Python27\lib\urllib2.py", line 407, in _call_chain result = func(*args) File "C:\Python27\lib\urllib2.py", line 556, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 503: Service Unavailable

@prafulbagai708
Copy link

Same Error.
Were you able to fix this?

@Karlheinzniebuhr
Copy link
Author

Nope :(

@prafulbagai708
Copy link

@Karlheinzniebuhr - I found the issue. You need to pass region too. See the code snippet below.

amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, region='IN')

By default, it's US. If your affiliateId belongs to some other region, pass into it.

Check this file.

@ankurpandeyvns
Copy link

@Karlheinzniebuhr - I found the issue. You need to pass region too. See the code snippet below.

amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, region='IN')

By default, it's US. If your affiliateId belongs to some other region, pass into it.

Check this file.

Still raises the same exception.

@Karlheinzniebuhr
Copy link
Author

T

@Karlheinzniebuhr - I found the issue. You need to pass region too. See the code snippet below.
amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, region='IN')
By default, it's US. If your affiliateId belongs to some other region, pass into it.
Check this file.

Still raises the same exception.

Thanks @ankurpandeyvns , my code just magically started working again, the only thing I did was to get a new API key and wait a few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants