Error while installing non_profit module on site (v14)

Hi I am trying to install non_profit module on my site, but it shows this error:

Installing non_profit…
An error occurred while installing non_profit: (‘Module Def’, ‘Non Profit’, IntegrityError(1062, “Duplicate entry ‘Non Profit’ for key ‘PRIMARY’”))
Traceback (most recent call last):
File “apps/frappe/frappe/model/base_document.py”, line 504, in db_insert
frappe.db.sql(
File “apps/frappe/frappe/database/database.py”, line 221, 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 ‘Non Profit’ 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 416, in install_app
_install_app(app, verbose=context.verbose, force=force)
File “apps/frappe/frappe/installer.py”, line 292, in install_app
add_module_defs(name, ignore_if_duplicate=force)
File “apps/frappe/frappe/installer.py”, line 623, in add_module_defs
d.insert(ignore_permissions=True, ignore_if_duplicate=ignore_if_duplicate)
File “apps/frappe/frappe/model/document.py”, line 270, in insert
self.db_insert(ignore_if_duplicate=ignore_if_duplicate)
File “apps/frappe/frappe/model/base_document.py”, line 531, in db_insert
raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: (‘Module Def’, ‘Non Profit’, IntegrityError(1062, “Duplicate entry ‘Non Profit’ for key ‘PRIMARY’”))

hi @tushar-badhwar
did you solved this issue?
thank you

I’m trying to install Non Profit in frontend site. I still get the error as mentioned above. Below are the logs

frappe@5612f26a1684:~/frappe-bench$ bench --site frontend install-app non_profit
App erpnext already installed

Installing non_profit…
An error occurred while installing non_profit: (‘Module Def’, ‘Non Profit’, IntegrityError(1062, “Duplicate entry ‘Non Profit’ for key ‘PRIMARY’”))
Traceback with variables (most recent call last):
File “apps/frappe/frappe/commands/site.py”, line 484, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {‘sites’: [‘frontend’], ‘force’: False, ‘verbose’: False, ‘profile’: False}
apps = (‘non_profit’,)
force = False
_install_app = <function install_app at 0xf2d776e4e5c0>
filelock = <function filelock at 0xf2d778090900>
exit_code = 0
site = ‘frontend’
app = ‘non_profit’
err = DuplicateEntryError(‘Module Def’, ‘Non Profit’, IntegrityError(1062, “Duplicate entry ‘Non Profit’ for key ‘PRIMARY’”))
File “apps/frappe/frappe/installer.py”, line 314, in install_app
add_module_defs(name, ignore_if_duplicate=force)
name = ‘non_profit’
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0xf2d7763cade0>
sync_for = <function sync_for at 0xf2d7763cbc40>
sync_customizations = <function sync_customizations at 0xf2d777e2b600>
sync_fixtures = <function sync_fixtures at 0xf2d7763cbf60>
app_hooks = {‘after_install’: [‘non_profit.setup.setup_non_profit’], ‘app_color’: [‘grey’], ‘app_description’: [‘Non Profit’], ‘app_email’: [‘pandikunta@frappe.io’], ‘app_icon’: [‘octicon octicon-file-directory’], ‘app_license’: [‘MIT’], ‘app_name’: [‘non_profit’], ‘app_publisher’: [‘Frappe’], ‘app_title’: [‘Non Profit’], ‘before_tests’: [‘non_profit.non_profit.utils.before_tests’], ‘doctype_js’: {‘Sales Invoice’: [‘public/js/payment_entry.js’]}, ‘global_search_doctypes’: {‘Non Profit’: [{‘doctype’: ‘Certified Consultant’, ‘index’: 1}, {‘doctype’: ‘Certification Application’, ‘index’: 2}, {‘doctype’: ‘Volunteer’, ‘index’: 3}, {‘doctype’: ‘Membership’, ‘index’: 4}, {‘doctype’: ‘Member’, ‘index’: 5}, {‘doctype’: ‘Donor’, ‘index’: 6}, {‘doctype’: ‘Chapter’, ‘index’: 7}, {‘doctype’: ‘Grant Application’, ‘index’: 8}, {‘doctype’: ‘Volunteer Type’, ‘index’: 9}, {‘doctype’: ‘Donor Type’, ‘index’: 10}, {‘doctype’: ‘Membership Type’, ‘index’: 11}]}, ‘override_doctype_class’: {‘Payment Entry’: ['non_profit.n…
installed_apps = [‘frappe’, ‘erpnext’, ‘payments’]
app = ‘erpnext’
required_app = ‘erpnext’
File “apps/frappe/frappe/installer.py”, line 683, in add_module_defs
d.insert(ignore_permissions=True, ignore_if_duplicate=ignore_if_duplicate)
app = ‘non_profit’
ignore_if_duplicate = False
modules = [‘Non Profit’]
module = ‘Non Profit’
d = <ModuleDef: Non Profit>
File “apps/frappe/frappe/model/document.py”, line 320, in insert
self.db_insert(ignore_if_duplicate=ignore_if_duplicate)
self = <ModuleDef: Non Profit>
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 603, in db_insert
raise frappe.DuplicateEntryError(self.doctype, self.name, e)
self = <ModuleDef: Non Profit>
ignore_if_duplicate = False
conflict_handler = ‘’
d = {‘name’: ‘Non Profit’, ‘creation’: ‘2025-07-26 13:42:20.095210’, ‘modified’: ‘2025-07-26 13:42:20.095210’, ‘modified_by’: ‘Administrator’, ‘owner’: ‘Administrator’, ‘docstatus’: 0, ‘idx’: 0, ‘module_name’: ‘Non Profit’, ‘custom’: 0, ‘package’: None, ‘app_name’: ‘non_profit’, ‘restrict_to_domain’: None, ‘_user_tags’: None, ‘_comments’: None, ‘_assign’: None, ‘_liked_by’: None}
columns = [‘name’, ‘creation’, ‘modified’, ‘modified_by’, ‘owner’, ‘docstatus’, ‘idx’, ‘module_name’, ‘custom’, ‘package’, ‘app_name’, ‘restrict_to_domain’, ‘_user_tags’, ‘_comments’, ‘_assign’, ‘_liked_by’]
frappe.exceptions.DuplicateEntryError: (‘Module Def’, ‘Non Profit’, IntegrityError(1062, “Duplicate entry ‘Non Profit’ for key ‘PRIMARY’”))