Error during installing Helpdesk

bench --site site1.local install-app helpdesk

Installing helpdesk...
An error occurred while installing helpdesk: ('Module Def', 'Helpdesk', IntegrityError(1062, "Duplicate entry 'Helpdesk' for key 'PRIMARY'"))
Traceback (most recent call last):
  File "apps/frappe/frappe/model/base_document.py", line 517, in db_insert
    frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 220, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry 'Helpdesk' for key 'PRIMARY'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/commands/site.py", line 415, in install_app
    _install_app(app, verbose=context.verbose, force=force)
  File "apps/frappe/frappe/installer.py", line 295, in install_app
    add_module_defs(name, ignore_if_duplicate=force)
  File "apps/frappe/frappe/installer.py", line 635, in add_module_defs
    d.insert(ignore_permissions=True, ignore_if_duplicate=ignore_if_duplicate)
  File "apps/frappe/frappe/model/document.py", line 272, in insert
    self.db_insert(ignore_if_duplicate=ignore_if_duplicate)
  File "apps/frappe/frappe/model/base_document.py", line 544, in db_insert
    raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: ('Module Def', 'Helpdesk', IntegrityError(1062, "Duplicate entry 'Helpdesk' for key 'PRIMARY'"))

I unistalled helpdesk app, but as of now i need to install it because customer doctype not allowing the delete the record without HD Ticket doctype. error ss given below

image

Thanks

@nilpatel42 ,

Login to ERPNext, go to Module Def List, and delete Help Desk from list.

Thanks.

image

and erpnext not allowed to delete ticket summary and other report of HD Ticket

Thank You

try

bench --site site1.local uninstall-app helpdesk --force
bench --site site1.local clear-cache
bench --site site1.local clear-website-cache
supervisorctl restart all

bench --site site1.local install-app helpdesk

Can you try this with force flag

bench --site site1.local install-app helpdesk --force

Thank you @Suresh_Thakor @Sandeep_Kakde

when i run this code i get a error code

raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:13000. Connection refused.

Are you on a development or production?

if in development then keep bench start in another terminal then try the above command.

I am in production

while removing the app this should be not an issue. you can try it after restarting your server.

after installing helpdesk, helpdesk is installed successfully but this installation error which i get
any problem in this installation ?


An error occurred while installing helpdesk: ('HD Service Holiday List', 'Default', IntegrityError(1062, "Duplicate entry 'Default' for key 'PRIMARY'"))
Traceback (most recent call last):
  File "apps/frappe/frappe/model/base_document.py", line 517, in db_insert
    frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 220, in sql
    self._cursor.execute(query, values)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 158, in execute
    result = self._query(query)
  File "env/lib/python3.10/site-packages/pymysql/cursors.py", line 325, in _query
    conn.query(q)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 549, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 779, in _read_query_result
    result.read()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 1157, in read
    first_packet = self.connection._read_packet()
  File "env/lib/python3.10/site-packages/pymysql/connections.py", line 729, in _read_packet
    packet.raise_for_error()
  File "env/lib/python3.10/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "env/lib/python3.10/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry 'Default' for key 'PRIMARY'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/commands/site.py", line 415, in install_app
    _install_app(app, verbose=context.verbose, force=force)
  File "apps/frappe/frappe/installer.py", line 307, in install_app
    frappe.get_attr(after_install)()
  File "apps/helpdesk/helpdesk/setup/install.py", line 20, in after_install
    add_default_sla()
  File "apps/helpdesk/helpdesk/setup/install.py", line 75, in add_default_sla
    add_default_holidy_list()
  File "apps/helpdesk/helpdesk/setup/install.py", line 179, in add_default_holidy_list
    ).insert()
  File "apps/frappe/frappe/model/document.py", line 272, in insert
    self.db_insert(ignore_if_duplicate=ignore_if_duplicate)
  File "apps/frappe/frappe/model/base_document.py", line 544, in db_insert
    raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: ('HD Service Holiday List', 'Default', IntegrityError(1062, "Duplicate entry 'Default' for key 'PRIMARY'"))

Thank @Suresh_Thakor

@nilpatel42 , in the HD Service Holiday List data already available while you installing Help Desk App. All doctype must be deleted from the database related to this app.

to delete all doctype from the database.

bench --site site-name uninstall-app helpdesk --force

After login, check Doctype list filter by Module = Hepdesk. Reinstall app if you find nothing.

Thanks.

By using these command its work

bench remove-app helpdesk
bench --site site-name clear-website-cache
bench get-app --branch version-14 GitHub - frappe/helpdesk: Modern, Streamlined, Free and Open Source Customer Service Software
bench --site site-name install-app helpdesk