Mws product update error

hi,

I was trying the new feature “Amazon MWS Integration” introduced in V11 and I get this error while updating products. I have around 4000 products on amazon.

    Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1007, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 84, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/run_method.py", line 36, in runserverobj
    r = doc.run_method(method)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py", line 22, in get_products_details
    get_products_details()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 47, in get_products_details
    create_item_code(product, sku)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 166, in create_item_code
    create_item_price(amazon_item_json, item.item_code)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 202, in create_item_price
    item_price.insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 216, in insert
    self.set_new_name()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 378, in set_new_name
    set_new_name(self)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py", line 42, in set_new_name
    set_name_from_naming_options(autoname, doc)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py", line 77, in set_name_from_naming_options
    doc.name = make_autoname(autoname, doc=doc)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py", line 116, in make_autoname
    n = parse_naming_series(parts, doctype, doc)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py", line 132, in parse_naming_series
    part = getseries(n, digits, doctype)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/naming.py", line 157, in getseries
    current = frappe.db.sql("select `current` from `tabSeries` where name=%s for update", (key,))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 199, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute
    result = self._query(query)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query
    conn.query(q)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result
    result.read()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1356, in read
    self._read_result_packet(first_packet)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1422, in _read_result_packet
    self._read_rowdata_packet()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1456, in _read_rowdata_packet
    packet = self.connection._read_packet()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
    packet.check_error()
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
InternalError: (1205, u'Lock wait timeout exceeded; try restarting transaction')

Can you share your amazon credentials so that someone can check? Otherwise try to use the Date filter on the settings page to import few products, maybe about 200-500, at a time.

I have increased the value of variable " innodb wait timeout" to 120 and now i am getting this error

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1007, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 84, in runserverobj
    frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/run_method.py", line 36, in runserverobj
    r = doc.run_method(method)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 772, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1048, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1031, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 766, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_mws_settings.py", line 22, in get_products_details
    get_products_details()
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 47, in get_products_details
    create_item_code(product, sku)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 140, in create_item_code
    new_manufacturer = create_manufacturer(amazon_item_json)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/amazon_methods.py", line 172, in create_manufacturer
    filters={"short_name":amazon_item_json.Product.AttributeSets.ItemAttributes.Manufacturer})
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/amazon_mws_settings/xml_utils.py", line 35, in __getattr__
    d = self.__getitem__(item)
KeyError: 'Manufacturer'

Further, I think the date filter can be used to filter out orders not products, right???

any update???

No update, if you need anyone to look at the issue you need to be willing to “share” your access credentials.

1 Like

Is there any update on this? I’m receiving the same KeyError: 'Manufacturer' as @dollar_singh

Im receiving the same KeyError: ‘Manufacturer’, any idea?

hi, any update??? tkanks