ubuntu 如何解决在erpnext中安装包/模块时重复输入错误,例如indain_compliance模块

bkhjykvo  于 2023-08-03  发布在  其他
关注(0)|答案(1)|浏览(107)

嘿,我一直在尝试在我的ubuntu虚拟机上安装indian_compliance模块,以便在erpnext上使用,在终端中使用以下命令:

bench get-app https://github.com/resilient-tech/india-compliance.git
bench install-app india_compliance

字符串
但由于某种原因失败了一次,在home\frappe-bench\apps\indian_compliance中创建了一个文件夹
然后在重试相同的命令时,得到了以下错误:

raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: ('Module Def', 'GST India', IntegrityError(1062, "Duplicate entry 'GST India' for key 'PRIMARY'"))


但后来尝试删除文件夹,但仍然得到相同的错误代码
在此之前,我在安装erpnext时遇到了类似的错误

Installing erpnext...
An error occurred while installing erpnext: ('Module Def', 'Accounts', IntegrityError(1062, "Duplicate entry 'Accounts' for key 'PRIMARY'"))
Traceback (most recent call last):
  File "apps/frappe/frappe/model/base_document.py", line 510, in db_insert
    frappe.db.sql(
  File "apps/frappe/frappe/database/database.py", line 229, 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 'Accounts' 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 463, in install_app
    _install_app(app, verbose=context.verbose, force=force)
  File "apps/frappe/frappe/installer.py", line 291, in install_app
    add_module_defs(name, ignore_if_duplicate=force)
  File "apps/frappe/frappe/installer.py", line 622, in add_module_defs
    d.insert(ignore_permissions=True, ignore_if_duplicate=ignore_if_duplicate)
  File "apps/frappe/frappe/model/document.py", line 279, in insert
    self.db_insert(ignore_if_duplicate=ignore_if_duplicate)
  File "apps/frappe/frappe/model/base_document.py", line 537, in db_insert
    raise frappe.DuplicateEntryError(self.doctype, self.name, e)
frappe.exceptions.DuplicateEntryError: ('Module Def', 'Accounts', IntegrityError(1062, "Duplicate entry 'Accounts' for key 'PRIMARY'"))


但我找到的唯一解决办法就是制造一台全新的机器!!从头开始我已经面对这个错误相当多次,它已经成为一个麻烦再次创建一个全新的机器,必须有一个方法来解决这样的错误,像不知何故删除它从机器上的mysql数据库,但无法找出太多

mysql -u root -p
SHOW DATABASES;
USE database_name_here;
SHOW TABLES;


那么下一步该怎么做如何找到重复的条目是我做不到的

qfe3c7zg

qfe3c7zg1#

我也遇到了类似的错误,我解决的方法是在mysql中找到重复的包并删除它们,在你的情况下,这也应该起作用,你的mysql步骤实际上是正确的,首先再次遵循它们:

mysql -u root -p
SHOW DATABASES;
USE database_name_here;
SHOW TABLES;

字符串
然后,

SELECT * FROM `tabModule Def`;
DELETE FROM `tabModule Def` WHERE app = 'Indian Compliance';


那么安装命令应该运行!!

相关问题