Try ERPNext Buy Support Partners Foundation

Easy Install fails with timeout

I’ve a running setup. Now I try to setup a test system following this:

because it used to work for me. This time when I login for the first time I get a timeout and in the logs I get this:

[2021-02-20 20:07:15 +0100] [919] [CRITICAL] WORKER TIMEOUT (pid:1058)
[2021-02-20 20:07:15 +0100] [1058] [ERROR] Error handling request /api/method/frappe.desk.page.setup_wizard.setup_wizard.setup_complete
Traceback (most recent call last):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/app.py", line 67, in application
    response = frappe.api.handle()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/api.py", line 59, in handle
    return frappe.handler.handle()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 24, in handle
    data = execute_cmd(cmd)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/handler.py", line 64, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 1071, in call
    return fn(*args, **newargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/desk/page/setup_wizard/setup_wizard.py", line 72, in setup_complete
    task.get('fn')(task.get('args'))
  File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/setup/setup_wizard/setup_wizard.py", line 101, in setup_defaults
    fixtures.install_defaults(frappe._dict(args))
  File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/setup/setup_wizard/operations/install_fixtures.py", line 450, in install_defaults
    domain_settings.set_active_domains(args.get('domains'))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/domain_settings/domain_settings.py", line 19, in set_active_domains
    self.save()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 273, in save
    return self._save(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 326, in _save
    self.run_post_save_methods()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 927, in run_post_save_methods
    self.run_method("on_update")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 797, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1073, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1056, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 791, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/domain_settings/domain_settings.py", line 27, in on_update
    domain.setup_domain()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/domain/domain.py", line 20, in setup_domain
    self.set_values()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/domain/domain.py", line 104, in set_values
    doc.save()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 273, in save
    return self._save(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 309, in _save
    self.run_before_save_methods()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 896, in run_before_save_methods
    self.run_method("validate")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 797, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1073, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1056, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 791, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_settings/stock_settings.py", line 31, in validate
    'value': 0 if self.show_barcode_field else 1})
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 1130, in make_property_setter
    ps.insert()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 260, in insert
    self.run_post_save_methods()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 927, in run_post_save_methods
    self.run_method("on_update")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 797, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1073, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 1056, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 791, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py", line 74, in on_update
    validate_fields_for_doctype(self.doc_type)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 674, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype, cached=False))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 787, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 43, in get_meta
    return load_meta(doctype)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 46, in load_meta
    return Meta(doctype)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 84, in __init__
    self.process()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 102, in process
    self.apply_property_setters()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/meta.py", line 300, in apply_property_setters
    if not frappe.db.table_exists('Property Setter'):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database/database.py", line 769, in table_exists
    return ("tab" + doctype) in self.get_tables()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database/database.py", line 772, in get_tables
    return [d[0] for d in self.sql("select table_name from information_schema.tables where table_schema not in ('pg_catalog', 'information_schema')")]
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database/database.py", line 171, in sql
    self._cursor.execute(query)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 517, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 732, in _read_query_result
    result.read()
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1082, in read
    self._read_result_packet(first_packet)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1152, in _read_result_packet
    self._read_rowdata_packet()
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1186, in _read_rowdata_packet
    packet = self.connection._read_packet()
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 684, in _read_packet
    packet.check_error()
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/protocol.py", line 215, in check_error
    if self.is_error_packet():
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/protocol.py", line 212, in is_error_packet
    return self._data[0:1] == b'\xff'
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/gunicorn/workers/base.py", line 202, in handle_abort
    sys.exit(1)
SystemExit: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/werkzeug/local.py", line 231, in application
    return ClosingIterator(app(environ, start_response), self.cleanup)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/werkzeug/wrappers/base_request.py", line 237, in application
    resp = f(*args[:-2] + (request,))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/app.py", line 95, in application
    frappe.db.rollback()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database/database.py", line 753, in rollback
    self.sql("rollback")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database/database.py", line 171, in sql
    self._cursor.execute(query)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 517, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 732, in _read_query_result
    result.read()
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 1075, in read
    first_packet = self.connection._read_packet()
  File "/home/erpnext/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py", line 671, in _read_packet
    % (packet_number, self._next_seq_id))
pymysql.err.InternalError: Packet sequence number wrong - got 49 expected 1
[2021-02-20 20:07:15 +0100] [1058] [INFO] Worker exiting (pid: 1058)
[2021-02-20 20:07:16 +0100] [1110] [INFO] Booting worker with pid: 1110

How to fix this?

Found, that the initial user permissions could not be set for some reason. Wen I start over I get the normal website and my initial user is logged in. When I logout and login as administrator I can set the permissions for my initial user and then every thins works as expected as far as I can see.