Bench Update Error frappe.exceptions.LinkExistsError:

Tried bench update, I am getting this error.

Please help. This is GST update.

Thanks

Jay

Backing up sites…
Patching sites…
Migrating acepl
Executing erpnext.patches.v8_1.delete_deprecated_reports in acepl (67a3d78f6737a20d)
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, 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/proman2/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 91, in
main()
File “/home/proman2/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 17, in main
click.Group(commands=commands)(prog_name=‘bench’)
File "/home/proman2/frappe-bench/env/local/lib/python2.7/site-packages/clickfrappe.exceptions.LinkExistsError: Cannot delete or cancel because Report Customer Addresses And Contacts is linked with Desktop Icon 7fc9eab62b

/core.py", line 722, in call
return self.main(*args, **kwargs)
File “/home/proman2/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/proman2/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/proman2/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/proman2/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/proman2/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/proman2/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/proman2/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/proman2/frappe-bench/apps/frappe/frappe/commands/site.py”, line 216, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/proman2/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/proman2/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/proman2/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_singlefrappe.exceptions.LinkExistsError: Cannot delete or cancel because Report Customer Addresses And Contacts is linked with Desktop Icon 7fc9eab62b

return execute_patch(patchmodule, method, methodargs)

File “/home/proman2/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/proman2/frappe-bench/apps/erpnext/erpnext/patches/v8_1/delete_deprecated_reports.py”, line 21, in execute
frappe.delete_doc(“Report”, report, ignore_permissions=True)
File “/home/proman2/frappe-bench/apps/frappe/frappe/init.py”, line 648, in delete_doc
ignore_permissions, flags)
File “/home/proman2/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 82, in delete_doc
check_if_doc_is_linked(doc)
File “/home/proman2/frappe-bench/apps/frappe/frappe/model/delete_doc.py”, line 187, in check_if_doc_is_linked
item.parent or item.name), frappe.LinkExistsError)
File “/home/proman2/frappe-bench/apps/frappe/frappe/init.py”, line 320, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/proman2/frappe-bench/apps/frappe/frappe/init.py”, line 310, in msgprint
_raise_exception()
File “/home/proman2/frappe-bench/apps/frappe/frappe/init.py”, line 283, in _raise_exception
raise raise_exception(encode(msg))
frappe.exceptions.LinkExistsError: Cannot delete or cancel because Report Customer Addresses And Contacts is linked with Desktop Icon 7fc9eab62b

I guess I need to delete 7fc9eab62b from Desktop Icon using bench mysql. Anybody can guide me how to do that.

Thanks

Jay

@JayRam,

This issue is already fixed, please pull the latest changes and run the bench migrate

Mak:

This is a multitenanted site. So the trouble is with one of them. You are making me humble, but when you say please pull the latest changes - how do I do that? git pull in the bench-repo, frappe, erpnext folders? Or using bench update?

I tried the git pull and tried to migrate the site that gave me the trouble in the first instance, I got the same error.

Thanks

Jay

@makarand_b: Buddy Mak, please help!

bench update --pull to pull the latest changes

I did that. Same error though @makarand_b.

@JayRam,

fixed the issue via [minor] fixed the report value for deprecated report patch by mbauskar · Pull Request #9537 · frappe/erpnext · GitHub, run bench update --pull and run bench migrate

Buddy @makarand_b. You saved my life. It went through fine. Remind me to buy you a beverage of your choice, the next time we meet.

There is another issue though. The Purchase Receipts are giving a bit of a bother. Would somebody check that out please.

Thanks

Jay

Stock module has got totally messed up with recent update. Please, please, please rectify quickly.

@makarand_b buddy. Please save my life again and allow me to owe you two beverages of your choice.

Thanks

Jay

can you share some details? error traceback may be …

My bad. It was a multitenanted setup. One of the sites had given an error last night and it was an inactive site, so I didn’t take that seriously. But because the update didn’t go through the complete cycle, it perhaps messed up some stuff.

Apologies @makarand_b for blaming your update. I still owe you two beverages.

Thanks

Jay