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

Cannot See Item webpage after installation #1126

Closed
asoral opened this issue Apr 18, 2023 · 1 comment · Fixed by #1127
Closed

Cannot See Item webpage after installation #1126

asoral opened this issue Apr 18, 2023 · 1 comment · Fixed by #1127

Comments

@asoral
Copy link

asoral commented Apr 18, 2023

I am on v-14 latest with helpdesk installed.

I have created a website item and when I click on "See on website" button from the sidebar to see how the item looks like, I get the following error

Traceback (most recent call last):
File "apps/frappe/frappe/website/serve.py", line 18, in get_response
response = renderer_instance.render()
File "apps/frappe/frappe/website/page_renderers/document_page.py", line 52, in render
html = self.get_html()
File "apps/frappe/frappe/website/utils.py", line 510, in cache_html_decorator
html = func(*args, **kwargs)
File "apps/frappe/frappe/website/page_renderers/document_page.py", line 61, in get_html
self.update_context()
File "apps/frappe/frappe/website/page_renderers/document_page.py", line 77, in update_context
ret = self.doc.get_context(self.context)
File "apps/erpnext/erpnext/e_commerce/doctype/website_item/website_item.py", line 225, in get_context
self.set_shopping_cart_data(context)
File "apps/erpnext/erpnext/e_commerce/doctype/website_item/website_item.py", line 314, in set_shopping_cart_data
context.shopping_cart = get_product_info_for_website(
File "apps/erpnext/erpnext/e_commerce/shopping_cart/product_info.py", line 34, in get_product_info_for_website
else _set_price_list(cart_settings, None)
File "apps/erpnext/erpnext/e_commerce/shopping_cart/cart.py", line 439, in _set_price_list
party_name = quotation.get("party_name") if quotation else get_party().get("name")
File "apps/erpnext/erpnext/e_commerce/shopping_cart/cart.py", line 530, in get_party
contact.insert(ignore_permissions=True)
File "apps/frappe/frappe/model/document.py", line 276, in insert
self.run_method("after_insert")
File "apps/frappe/frappe/model/document.py", line 914, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1264, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1248, in runner
add_to_return_value(self, f(self, method, *args, **kwargs))
File "apps/helpdesk/helpdesk/helpdesk/doctype/hd_customer/hd_customer.py", line 24, in get_contact_count
customer = frappe.get_doc("HD Customer", doc.links[0].link_name)
File "apps/frappe/frappe/init.py", line 1184, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 74, in get_doc
return controller(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 106, in init
self.load_from_db()
File "apps/frappe/frappe/model/document.py", line 149, in load_from_db
frappe.throw(
File "apps/frappe/frappe/init.py", line 525, in throw
msgprint(
File "apps/frappe/frappe/init.py", line 493, in msgprint
_raise_exception()
File "apps/frappe/frappe/init.py", line 442, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: HD Customer Apoorv Soral not found

@ssiyad ssiyad linked a pull request Apr 18, 2023 that will close this issue
@ZhangLianK
Copy link

ZhangLianK commented Apr 26, 2023

I got similar issue. The reproduce step like following.

  1. Enable e commerce and shopping cart, check out. and publish a item to website item.
  2. In the website all product page, I can see the product published.
  3. and I sign up a new website user in the website.
  4. after administrator comfirm the signup, the login using the website user.
  5. user can't view the product list. and there will be error log output to error log list.
    File "apps/erpnext/erpnext/e_commerce/shopping_cart/product_info.py", line 34, in get_product_info_for_website else _set_price_list(cart_settings, None) item_code = 'xxxxx' skip_quotation_creation = True cart_settings = <ECommerceSettings: E Commerce Settings> cart_quotation = {} File "apps/erpnext/erpnext/e_commerce/shopping_cart/cart.py", line 439, in _set_price_list party_name = quotation.get("party_name") if quotation else get_party().get("name") cart_settings = <ECommerceSettings: E Commerce Settings> quotation = None get_default_price_list = <function get_default_price_list at 0x7f1e30ba95a0> File "apps/erpnext/erpnext/e_commerce/shopping_cart/cart.py", line 524, in get_party customer.insert(ignore_permissions=True) user = '[email protected]' contact_name = 'website03' party = None contact = <Contact: website03> cart_settings = <ECommerceSettings: E Commerce Settings> debtors_account = '1122 - 应收账款 - 鸿锟' customer = <Customer: website03> fullname = 'website03' File "apps/frappe/frappe/model/document.py", line 270, in insert self.db_insert(ignore_if_duplicate=ignore_if_duplicate) self = <Customer: website03> ignore_permissions = True ignore_links = None ignore_if_duplicate = False ignore_mandatory = None set_name = None set_child_names = True File "apps/frappe/frappe/model/base_document.py", line 502, in db_insert frappe.db.sql( self = <Customer: website03> ignore_if_duplicate = False conflict_handler = '' d = {'name': 'website03', 'owner': '[email protected]', 'creation': '2023-04-26 10:14:16.794221', 'modified': '2023-04-26 10:14:16.794221', 'modified_by': '[email protected]', 'docstatus': 0, 'idx': 0, 'naming_series': 'CUST-.YYYY.-', 'salutation': None, 'customer_name': 'website03', 'customer_type': 'Individual', 'customer_group': '个人', 'territory': '所有的区域', 'gender': None, 'lead_name': None, 'opportunity_name': None, 'account_manager': None, 'image': None, 'default_price_list': None, 'default_bank_account': None, 'default_currency': None, 'is_internal_customer': 0, 'represents_company': None, 'market_segment': None, 'industry': None, 'customer_pos_id': None, 'website': None, 'language': 'zh', 'customer_details': None, 'customer_primary_contact': None, 'mobile_no': None, 'email_id': None, 'customer_primary_address': None, 'primary_address': None, 'tax_id': None, 'tax_category': None, 'tax_withholding_category': None, 'payment_terms': None, 'loyalty_program': None, 'loyalty_program_tier'... columns = ['name', 'owner', 'creation', 'modified', 'modified_by', 'docstatus', 'idx', 'naming_series', 'salutation', 'customer_name', 'customer_type', 'customer_group', 'territory', 'gender', 'lead_name', 'opportunity_name', 'account_manager', 'image', 'default_price_list', 'default_bank_account', 'default_currency', 'is_internal_customer', 'represents_company', 'market_segment', 'industry', 'customer_pos_id', 'website', 'language', 'customer_details', 'customer_primary_contact', 'mobile_no', 'email_id', 'customer_primary_address', 'primary_address', 'tax_id', 'tax_category', 'tax_withholding_category', 'payment_terms', 'loyalty_program', 'loyalty_program_tier', 'default_sales_partner', 'default_commission_rate', 'so_required', 'dn_required', 'is_frozen', 'disabled'] File "apps/frappe/frappe/database/database.py", line 228, in sql raise frappe.QueryTimeoutError(e) from e self = <frappe.database.mariadb.database.MariaDBDatabase object at 0x7f1e318e1de0> query = 'INSERT INTO tabCustomer (name, owner, creation, modified, modified_by, docstatus, idx, naming_series, salutation, customer_name, customer_type, customer_group, territory, gender, lead_name, opportunity_name, account_manager, image, default_price_list, default_bank_account, default_currency, is_internal_customer, represents_company, market_segment, industry, customer_pos_id, website, language, customer_details, customer_primary_contact, mobile_no, email_id, customer_primary_address, primary_address, tax_id, tax_category, tax_withholding_category, payment_terms, loyalty_program, loyalty_program_tier, default_sales_partner, default_commission_rate, so_required, dn_required, is_frozen, disabled)\n\t\t\t\t\tVALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' values = ['website03', '[email protected]', '2023-04-26 10:14:16.794221', '2023-04-26 10:14:16.794221', '[email protected]', 0, 0, 'CUST-.YYYY.-', None, 'website03', 'Individual', '个人', '所有的区域', None, None, None, None, None, None, None, None, 0, None, None, None, None, None, 'zh', None, None, None, None, None, None, None, None, None, None, None, None, None, 0.0, 0, 0, 0, 0] as_dict = 0 as_list = 0 formatted = 0 debug = False ignore_ddl = 0 as_utf8 = 0 auto_commit = 0 update = None explain = False run = True pluck = False frappe.exceptions.QueryTimeoutError: (1205, 'Lock wait timeout exceeded; try restarting transaction')

and I checked DB lock log. it like following.

| Type | Name | Status
| InnoDB | |

2023-04-26 09:02:15 0x7f6e5931c640 INNODB MONITOR OUTPUT

Per second averages calculated from the last 12 seconds

BACKGROUND THREAD

srv_master_thread loops: 0 srv_active, 0 srv_shutdown, 1928096 srv_idle
srv_master_thread log flush and writes: 1927510

SEMAPHORES

LATEST DETECTED DEADLOCK

2023-04-26 08:52:55 0x7f6e592d1640
*** (1) TRANSACTION:
TRANSACTION 247306, ACTIVE 21 sec inserting
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1128, 2 row lock(s)
MariaDB thread id 207508, OS thread handle 140111919257152, query id 7812369 localhost 127.0.0.1 _217a84fccbdaf160 Update
INSERT INTO tabCustomer (name, owner, creation, modified, modified_by, docstatus, idx, naming_series, salutation, customer_name, customer_type, customer_group, territory, gender, lead_name, opportunity_name, account_manager, image, default_price_list, default_bank_account, default_currency, is_internal_customer, represents_company, market_segment, industry, customer_pos_id, website, language, customer_details, customer_primary_contact, mobile_no, email_id, customer_primary_address, primary_address, tax_id, tax_category, tax_withholding_category, payment_terms, loyalty_program, loyalty_program_tier, default_sales_partner, default_commission_rate, so_required, dn_required, is_frozen, disabled)
VALUES ('website03', '[email protected]', '2023-04-26 08:52:34.556984', '2023-04-26 08:52:34.556984'
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 471 page no 3 n bits 16 index PRIMARY of table _217a84fccbdaf160.tabCustomer trx id 247306 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 4 PHYSICAL RECORD: n_fields 52; compact format; info bits 0

*** CONFLICTING WITH:
RECORD LOCKS space id 471 page no 3 n bits 16 index PRIMARY of table _217a84fccbdaf160.tabCustomer trx id 247305 lock mode S locks gap before rec
Record lock, heap no 4 PHYSICAL RECORD: n_fields 52; compact format; info bits 0

RECORD LOCKS space id 471 page no 3 n bits 16 index PRIMARY of table _217a84fccbdaf160.tabCustomer trx id 247306 lock mode S locks gap before rec
Record lock, heap no 4 PHYSICAL RECORD: n_fields 52; compact format; info bits 0

*** (2) TRANSACTION:
TRANSACTION 247305, ACTIVE 30 sec inserting
mysql tables in use 1, locked 1
LOCK WAIT 4 lock struct(s), heap size 1128, 2 row lock(s)
MariaDB thread id 207497, OS thread handle 140111905146432, query id 7812110 localhost 127.0.0.1 _217a84fccbdaf160 Update
INSERT INTO tabCustomer (name, owner, creation, modified, modified_by, docstatus, idx, naming_series, salutation, customer_name, customer_type, customer_group, territory, gender, lead_name, opportunity_name, account_manager, image, default_price_list, default_bank_account, default_currency, is_internal_customer, represents_company, market_segment, industry, customer_pos_id, website, language, customer_details, customer_primary_contact, mobile_no, email_id, customer_primary_address, primary_address, tax_id, tax_category, tax_withholding_category, payment_terms, loyalty_program, loyalty_program_tier, default_sales_partner, default_commission_rate, so_required, dn_required, is_frozen, disabled)
VALUES ('website03', '[email protected]', '2023-04-26 08:52:25.094825', '2023-04-26 08:52:25.094825'
*** WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 471 page no 3 n bits 16 index PRIMARY of table _217a84fccbdaf160.tabCustomer trx id 247305 lock_mode X locks gap before rec insert intention waiting
Record lock, heap no 4 PHYSICAL RECORD: n_fields 52; compact format; info bits 0

RECORD LOCKS space id 471 page no 3 n bits 16 index PRIMARY of table _217a84fccbdaf160.tabCustomer trx id 247306 lock mode S locks gap before rec
Record lock, heap no 4 PHYSICAL RECORD: n_fields 52; compact format; info bits 0

*** WE ROLL BACK TRANSACTION (1)

TRANSACTIONS

Trx id counter 247619
Purge done for trx's n:o < 247619 undo n:o < 0 state: running but idle
History list length 111
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION (0x7f6e5b3feb80), not started
0 lock struct(s), heap size 1128, 0 row lock(s)

FILE I/O

Pending flushes (fsync) log: 0; buffer pool: 0
7630 OS file reads, 148699 OS file writes, 148933 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s

INSERT BUFFER AND ADAPTIVE HASH INDEX

Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:
insert 0, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
0.00 hash searches/s, 0.00 non-hash searches/s

LOG

Log sequence number 161903038
Log flushed up to 161903038
Pages flushed up to 98965926
Last checkpoint at 98963483
0 pending log flushes, 0 pending chkp writes
142253 log i/o's done, 0.00 log i/o's/second

BUFFER POOL AND MEMORY

Total large memory allocated 167772160
Dictionary memory allocated 4815912
Buffer pool size 8112
Free buffers 26
Database pages 8086
Old database pages 2964
Modified db pages 5876
Percent of dirty pages(LRU & free pages): 72.427
Max dirty pages percent: 90.000
Pending reads 0
Pending writes: LRU 0, flush list 0
Pages made young 7898, not young 51527
0.00 youngs/s, 0.00 non-youngs/s
Pages read 6763, created 9307, written 6405
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 8086, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]

ROW OPERATIONS

0 read views open inside InnoDB
Process ID=0, Main thread ID=0, state: sleeping
Number of rows inserted 65606, updated 180187, deleted 6938, read 44751216
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
Number of system rows inserted 0, updated 0, deleted 0, read 0
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s

END OF INNODB MONITOR OUTPUT

1 row in set (0.000 sec)

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.

2 participants