frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.83k stars 7.33k forks source link

Amazon Integration Error #22925

Closed lb9591 closed 4 years ago

lb9591 commented 4 years ago

Description of the issue

Sync products returns error as does Sync Orders. I have tried running $bench update --reset and now have a new set of errors.

Context information (for bug reports)

Output of bench version

5.0.0

Steps to reproduce the issue

  1. Navigate to Amazon Integration
  2. Click sync products
  3. View error log

Observed result

Multiple errors generated in log

Expected result

Product and order sync

Stacktrace / full error message

{'method_name': 'erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_methods.get_products_details', 'log': <function log at 0x7fd668472950>, 'retry': 0, 'is_async': True, 'user': 'logan@iconicbusiness.com', 'kwargs': {}, 'job_name': 'erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_methods.get_products_details', 'event': None, 'method': <function get_products_details at 0x7fd6681fd048>, 'site': 'iconic2'}
Traceback (most recent call last):
  File "/home/icfrappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py", line 193, in make_request
    response.raise_for_status()
  File "/home/icfrappe/frappe-bench/env/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://mws.amazonservices.com/Products/2011-10-01?ASINList.ASIN.1=B00NHIBFJC&ASINList.ASIN.10=B073MBQ157&ASINList.ASIN.2=B00PVDU4VQ&ASINList.ASIN.3=B07R18CCKK&ASINList.ASIN.4=B00AQMDGV2&ASINList.ASIN.5=B012B1A6ZE&ASINList.ASIN.6=B01K1JVUIK&ASINList.ASIN.7=B01M2D4GV0&ASINList.ASIN.8=B00JJP6C40&ASINList.ASIN.9=B06XKF7PP8&AWSAccessKeyId=AKIAJY6WKPMBYQEEMS7Q&Action=GetMatchingProduct&MarketplaceId=ATVPDKIKX0DER&SellerId=A5JI03758X016&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2020-08-05T22%3A52%3A17Z&Version=2011-10-01&Signature=lr%2BAbo0Azfx7Q5qcYz9AfG/44XzoThoMsui0iOevRvQ%3D

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/icfrappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 116, in call_mws_method
    response = mws_method(*args, **kwargs)
  File "/home/icfrappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py", line 466, in get_matching_product
    return self.make_request(data)
  File "/home/icfrappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_api.py", line 209, in make_request
    raise error
erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_api.MWSError: 503 Server Error: Service Unavailable for url: https://mws.amazonservices.com/Products/2011-10-01?ASINList.ASIN.1=B00NHIBFJC&ASINList.ASIN.10=B073MBQ157&ASINList.ASIN.2=B00PVDU4VQ&ASINList.ASIN.3=B07R18CCKK&ASINList.ASIN.4=B00AQMDGV2&ASINList.ASIN.5=B012B1A6ZE&ASINList.ASIN.6=B01K1JVUIK&ASINList.ASIN.7=B01M2D4GV0&ASINList.ASIN.8=B00JJP6C40&ASINList.ASIN.9=B06XKF7PP8&AWSAccessKeyId=AKIAJY6WKPMBYQEEMS7Q&Action=GetMatchingProduct&MarketplaceId=ATVPDKIKX0DER&SellerId=A5JI03758X016&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2020-08-05T22%3A52%3A17Z&Version=2011-10-01&Signature=lr%2BAbo0Azfx7Q5qcYz9AfG/44XzoThoMsui0iOevRvQ%3D

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/utils/background_jobs.py", line 102, in execute_job
    method(**kwargs)
  File "/home/icfrappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 38, in get_products_details
    asins=asin_list)
  File "/home/icfrappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 120, in call_mws_method
    frappe.log_error(message=e, title=str(mws_method))
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1524, in log_error
    method=title)).insert(ignore_permissions=True)
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/model/document.py", line 231, in insert
    self._validate()
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/model/document.py", line 463, in _validate
    self._validate_length()
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 599, in _validate_length
    self.throw_length_exceeded_error(df, max_length, value)
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/model/base_document.py", line 615, in throw_length_exceeded_error
    .format(reference, _(df.label), max_length, value), frappe.CharacterLengthExceededError, title=_('Value too big'))
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/__init__.py", line 376, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable)
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/__init__.py", line 355, in msgprint
    _raise_exception()
  File "/home/icfrappe/frappe-bench/apps/frappe/frappe/__init__.py", line 315, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.CharacterLengthExceededError: Error Log e78c265565: 'Title' (<bound method Products.get_matching_product of <erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_api.Products object at 0x7fd6681a0b00>>) will get truncated, as max characters allowed is 140

Additional information

ErpNext hosted on a Ubuntu VM running on Azure.

barry86m commented 4 years ago

Does the same query work in the scratchpad? https://mws.amazonservices.com/scratchpad/index.html

According to the MWS documentation looks like your request might be missing the MWS Auth Token.

lb9591 commented 4 years ago

Does the same query work in the scratchpad? https://mws.amazonservices.com/scratchpad/index.html

According to the MWS documentation looks like your request might be missing the MWS Auth Token.

Honestly, I never even thought to try scratchpad... Anyways this can be closed we have since started developing a new application, I do not believe erpNext will suffice for what we're doing!