Duplicate Name Error - Jasper Report

We tried to install Jasper Report module from Application Installer. It shows the following error :

@asneha1 try re-installing the app.

bench --site [sitename] uninstall-app erpnext_jasper_report
bench --site [sitename] install-app erpnext_jasper_report

And share the full trace.

Hi, tried the commands and the results are as follows :

ubuntu@ip-172-31-6-19:~/frappe-bench/apps$ dir
erpnext frappe jasper_erpnext_report mandrill_integration

ubuntu@ip-172-31-6-19:~/frappe-bench/apps$ cd …

ubuntu@ip-172-31-6-19:~/frappe-bench$ bench --site sunseap-erp-dev.cloude8.com u ninstall-app jasper_erpnext_report
All doctypes (including custom), modules related to this app will be deleted. Ar e you sure you want to continue (y/n) ? y
Backing up…
removing Jasper Reports…
removing Jasper Parameter…
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 79, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/de corators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _ func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 917, in uninstall
remove_app(app, dry_run)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 177, in remove_app
frappe.db.sql("drop table tab{0}".format(doctype.name))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 108, in sql
self.check_transaction_status(query)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 206, in check_transaction_status
raise Exception, ‘This statement can cause implicit commit’
Exception: This statement can cause implicit commit

ubuntu@ip-172-31-6-19:~/frappe-bench$ bench --site sunseap-erp-dev.cloude8.com i nstall-app jasper_erpnext_report
Installing jasper_erpnext_report…
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 79, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/de corators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _ func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py”, line 163, in install_app
_install_app(app, verbose=context.verbose)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 122, in install_app
add_module_defs(name)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py”, line 292, in add_module_defs
d.save(ignore_permissions=True)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 23 1, in save
self.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 20 3, in insert
self.db_insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/base_document.py”, li ne 276, in db_insert
), d.values())
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 135, in sql
self._cursor.execute(query, values)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/ cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/ connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
frappe.exceptions.DuplicateEntryError: (u’Module Def’, u’Jasper Erpnext Report’, IntegrityError(1062, "Duplicate entry ‘Jasper Erpnext Report’ for key ‘PRIMARY’ "))

@asneha1 yeah this probably needs to be fixed.

Can you just use a new site, if you are testing.

@rmehta
Deleted Jasper Erpnext Report from Module Def list and uninstalled.
Thank you.