In the Ecommerce Integration log I have the following error:
Integration
shopify
Status
Error
Method
ecommerce_integrations.shopify.order.sync_sales_order
Message
Error: Document has been modified after you have opened it (2022-04-12 18:33:11.500360, 2022-04-12 18:33:11.588083). Please refresh to get the latest document.
Traceback
Traceback (most recent call last):
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/order.py", line 49, in sync_sales_order
create_order(order, setting)
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/order.py", line 61, in create_order
so = create_sales_order(order, setting, company)
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/order.py", line 119, in create_sales_order
so.submit()
File "apps/frappe/frappe/model/document.py", line 943, in submit
return self._submit()
File "apps/frappe/frappe/model/document.py", line 932, in _submit
return self.save()
File "apps/frappe/frappe/model/document.py", line 287, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 318, in _save
self.check_if_latest()
File "apps/frappe/frappe/model/document.py", line 732, in check_if_latest
frappe.msgprint(_("Error: Document has been modified after you have opened it") \
File "apps/frappe/frappe/__init__.py", line 423, in msgprint
_raise_exception()
File "apps/frappe/frappe/__init__.py", line 378, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.TimestampMismatchError: Error: Document has been modified after you have opened it (2022-04-12 18:33:11.500360, 2022-04-12 18:33:11.588083). Please refresh to get the latest document.
I am not sure what to do to get this order to sync. Anyone have any suggestions?
All of my webhooks are now returning this same error. Something changed and now the connector is not working.
When a script is creating something like in create_sales_order() how can the document have been modified since it was opened? It doesn’t exist yet in the database.
This is all very puzzling. I am still digging into it.
In apps/ecommerce_integrations/ecommerce_integrations/shopify/order.py if I comment out so.submit() it will create the order in a draft form. So something seems to be modifying the order (or it thinks it is) between these two lines:
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 68, in application
response = frappe.api.handle()
File "apps/frappe/frappe/api.py", line 55, in handle
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 31, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 68, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1213, in call
return fn(*args, **newargs)
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/connection.py", line 98, in store_request_data
_validate_request(frappe.request, hmac_header)
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/connection.py", line 128, in _validate_request
create_shopify_log(status="Error", request_data=req.data)
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/utils.py", line 19, in create_shopify_log
return create_log(module_def=MODULE_NAME, **kwargs)
File "apps/ecommerce_integrations/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.py", line 65, in create_log
log.save(ignore_permissions=True)
File "apps/frappe/frappe/model/document.py", line 287, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 318, in _save
self.check_if_latest()
File "apps/frappe/frappe/model/document.py", line 732, in check_if_latest
frappe.msgprint(_("Error: Document has been modified after you have opened it") \
File "apps/frappe/frappe/__init__.py", line 423, in msgprint
_raise_exception()
File "apps/frappe/frappe/__init__.py", line 378, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.TimestampMismatchError: Error: Document has been modified after you have opened it (2022-04-15 09:35:21.368145, 2022-04-15 09:35:21.543169). Please refresh to get the latest document.
So it can’t seem to create even error logs at the moment.