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

sync error #60

Open
saeidfeyziniya opened this issue Jul 19, 2022 · 3 comments · May be fixed by #66
Open

sync error #60

saeidfeyziniya opened this issue Jul 19, 2022 · 3 comments · May be fixed by #66

Comments

@saeidfeyziniya
Copy link

frappe.exceptions.CharacterLengthExceededError: Error Log 901: 'Title' (SELECT `tabItem`.`name`, 
                                     `tabItem`.`item_code`, 
                                     `tabItem`.`item_name`, 
                                     `tabItem`.`item_group`, 
                                     `tabItem`.`description`,
                                     `tabItem`.`woocommerce_description`, 
                                     `tabItem`.`has_variants`, 
                                     `tabItem`.`variant_of`, 
                                     `tabItem`.`stock_uom`, 
                                     `tabItem`.`image`, 
                                     `tabItem`.`woocommerce_product_id`,
                                     `tabItem`.`woocommerce_variant_id`, 
                                     `tabItem`.`sync_qty_with_woocommerce`, 
                                     `tabItem`.`weight_per_unit`, 
                                     `tabItem`.`weight_uom`
        FROM `tabItem`, `tabItem Price`
        WHERE `tabItem Price`.`price_list` = 'Standard Selling' 
          AND `tabItem`.`name` = `tabItem Price`.`item_code`
          AND `tabItem`.`sync_with_woocommerce` = 1 
          AND (`tabItem`.`disabled` IS NULL OR `tabItem`.`disabled` = 0) ) will get truncated, as max characters allowed is 140

why I get these error?
I don't have any fiels in tabItem with more 140 char.

@lasalesi
Copy link
Contributor

It is actually the error log, which is exceeding the limit, not the items themself. If you could post the full error trace, this might help locate the issue.

@sptechcue
Copy link

sptechcue commented Aug 24, 2022

I have the same error, please can you help me.
Regards

Estado
Error
Método
sync_woocommerce_resources
Mensaje
Traceback (most recent call last):
File "apps/woocommerceconnector/woocommerceconnector/api.py", line 50, in sync_woocommerce_resources
sync_products(woocommerce_settings.price_list, woocommerce_settings.warehouse, True if woocommerce_settings.sync_items_from_woocommerce_to_erp == 1 else False)
File "apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 24, in sync_products
sync_erpnext_items(price_list, warehouse, woocommerce_item_list)
File "apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 397, in sync_erpnext_items
for item in get_erpnext_items(price_list):
File "apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 457, in get_erpnext_items
frappe.log_error("{0}".format(item_from_item_price))
File "apps/frappe/frappe/init.py", line 2228, in log_error
return get_doc(
File "apps/frappe/frappe/model/document.py", line 256, in insert
self._validate()
File "apps/frappe/frappe/model/document.py", line 528, in _validate
self._validate_length()
File "apps/frappe/frappe/model/base_document.py", line 907, in _validate_length
self.throw_length_exceeded_error(df, max_length, value)
File "apps/frappe/frappe/model/base_document.py", line 941, in throw_length_exceeded_error
frappe.throw(
File "apps/frappe/frappe/init.py", line 524, in throw
msgprint(
File "apps/frappe/frappe/init.py", line 492, in msgprint
_raise_exception()
File "apps/frappe/frappe/init.py", line 444, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.CharacterLengthExceededError: Error Log 18: 'Title' (SELECT tabItem.name,
tabItem.item_code,
tabItem.item_name,
tabItem.item_group,
tabItem.description,
tabItem.woocommerce_description,
tabItem.has_variants,
tabItem.variant_of,
tabItem.stock_uom,
tabItem.image,
tabItem.woocommerce_product_id,
tabItem.woocommerce_variant_id,
tabItem.sync_qty_with_woocommerce,
tabItem.weight_per_unit,
tabItem.weight_uom
FROM tabItem, tabItem Price
WHERE tabItem Price.price_list = 'Venta estándar'
AND tabItem.name = tabItem Price.item_code
AND tabItem.sync_with_woocommerce = 1
AND (tabItem.disabled IS NULL OR tabItem.disabled = 0) AND tabItem.variant_of NOT IN ('123-159-3697')) will get truncated, as max characters allowed is 140

@Haschtl
Copy link

Haschtl commented Oct 30, 2022

Same issue here
Here is the full error trace:

Traceback (most recent call last):
  File "apps/woocommerceconnector/woocommerceconnector/api.py", line 50, in sync_woocommerce_resources
    sync_products(woocommerce_settings.price_list, woocommerce_settings.warehouse, True if woocommerce_settings.sync_items_from_woocommerce_to_erp == 1 else False)
  File "apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 24, in sync_products
    sync_erpnext_items(price_list, warehouse, woocommerce_item_list)
  File "apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 397, in sync_erpnext_items
    for item in get_erpnext_items(price_list):
  File "apps/woocommerceconnector/woocommerceconnector/sync_products.py", line 457, in get_erpnext_items
    frappe.log_error("{0}".format(item_from_item_price))
  File "apps/frappe/frappe/__init__.py", line 2225, in log_error
    return error_log.insert(ignore_permissions=True)
  File "apps/frappe/frappe/model/document.py", line 258, in insert
    self._validate()
  File "apps/frappe/frappe/model/document.py", line 530, in _validate
    self._validate_length()
  File "apps/frappe/frappe/model/base_document.py", line 908, in _validate_length
    self.throw_length_exceeded_error(df, max_length, value)
  File "apps/frappe/frappe/model/base_document.py", line 942, in throw_length_exceeded_error
    frappe.throw(
  File "apps/frappe/frappe/__init__.py", line 522, in throw
    msgprint(
  File "apps/frappe/frappe/__init__.py", line 490, in msgprint
    _raise_exception()
  File "apps/frappe/frappe/__init__.py", line 442, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.CharacterLengthExceededError: Error Log 80: 'Title' (SELECT `tabItem`.`name`, 
                                     `tabItem`.`item_code`, 
                                     `tabItem`.`item_name`, 
                                     `tabItem`.`item_group`, 
                                     `tabItem`.`description`,
                                     `tabItem`.`woocommerce_description`, 
                                     `tabItem`.`has_variants`, 
                                     `tabItem`.`variant_of`, 
                                     `tabItem`.`stock_uom`, 
                                     `tabItem`.`image`, 
                                     `tabItem`.`woocommerce_product_id`,
                                     `tabItem`.`woocommerce_variant_id`, 
                                     `tabItem`.`sync_qty_with_woocommerce`, 
                                     `tabItem`.`weight_per_unit`, 
                                     `tabItem`.`weight_uom`
        FROM `tabItem`, `tabItem Price`
        WHERE `tabItem Price`.`price_list` = 'Standard-Vertrieb' 
          AND `tabItem`.`name` = `tabItem Price`.`item_code`
          AND `tabItem`.`sync_with_woocommerce` = 1 
          AND (`tabItem`.`disabled` IS NULL OR `tabItem`.`disabled` = 0) AND `tabItem Price`.`modified` >= '2022-10-04 21:57:00'  AND `tabItem`.`variant_of` NOT IN ('132' ,'133' ,'134' ,'135' ,'136' ,'159' ,'160' ,'187' ,'193' ,'194' ,'200' ,'201' ,'205' ,'206' ,'291' ,'294' ,'297' ,'311' ,'328' ,'351' ,'356' ,'361' ,'371' ,'386' ,'390' ,'400' ,'424' ,'425' ,'426' ,'427' ,'428' ,'429' ,'430' ,'431' ,'468')) will get truncated, as max characters allowed is 140

I think this error can be resolved by simply removing the error_log in document.py
frappe.log_error("{0}".format(item_from_item_price)) is called when there is actually no error, but it's responsible for creating an error

Haschtl added a commit to Haschtl/WooCommerceConnector that referenced this issue Oct 30, 2022
@Haschtl Haschtl linked a pull request Oct 30, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

4 participants