Installing erpnext app on new site issue

Hello,
I am facing an issue in installing my erpnext app on new site. when I try to install erpnext app from application Installer for my new site it shows error “Duplicate Name Accounts”. only modules of frappe is seen on desc but not of erpnext. i tried searching accounts and other modules in “Module def”, I can see all module listed in “module def” list but it is not visible on my desktop. please anyone can help me with this issue.

1 Like

@Deep Are you using Virtual Box? its old error, try to update erpnext using bench update command.

After that, you need to reinstall site usingbench reinstall command

1 Like

Hello @kolate_sambhaji I am not using virtual box. but trying to install erpnext app in new site. my erpnext already running on erpnext.local now i want another site example “xyz” and on this site i can see frappe modules but not erpnext modules. I tried to install erpnext through application installer. but i cant see the icons on desktop. but i can see erpnext all modules def in module def list.

1 Like

@Deep Hi you can not install erpnext once you complete setting up setup wizard
for that you have to do bench reinstall as suggested by @kolate_sambhaji and then you should use bench install-app erpnext for installing erpnext.

2 Likes

@Deep as suggested by @ravindra_l

You need to reinstall site.

Also, you can create new site and install erpnext using follwoing command(Instead of UI)

bench new-site mysite.local
bench --site mysite.local install-app erpnext
1 Like

Hello @ravindra_l and @kolate_sambhaji thanks for replying me. I have followed your suggested process but after executing second command my execution stopped in between with error of duplicate key “item_name”.

1 Like

@Deep please share the traceback

1 Like

Hello, Following is the traceback.

File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py” , line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py” , line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py” , line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py” , line 534, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/decorato rs.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 27, in _ func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 162, in install_app
_install_app(app, verbose=context.verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 122, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py”, line 43, in sync_for
import_file_by_path(doc_path, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 54, in import_file_by_path
import_doc(doc, force=force, data_import=data_import, pre_process=pre_proces s)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 122, in import_doc
doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 19 6, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 56 1, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 50 9, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 62 6, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 60 9, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 50 3, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctyp e.py”, line 101, in on_update
updatedb(self.name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 6 2, in updatedb
tab.sync()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 8 5, in sync
self.create()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 1 16, in create
COLLATE=utf8mb4_unicode_ci""" % (self.name, add_text))
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 146, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/cursor s.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/connec tions.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1061, “Duplicate key name ‘item_name’”)

1 Like

@Deep,
Did you reinstalled site?
Also, do you have changes in ERPNext APP?
You need to update ERPNext.

1 Like

@kolate_sambhaji Thanks for helping, Yes I reinstalled site and yes I also have done some changes in erpnext app. but I managed to installed it on new site by copying database to new site db. :sweat_smile:

2 Likes

@Deep Don’t make any change in directly ERPNext app, you can use your own app to add customization in ERPNext.
It will help you to easily update ERPNext to latest version

@kolate_sambhaji thank you. Yes I got it… :slight_smile:

1 Like