Error during update to V7

Dear all,

I am running into a problem updating my erpnext install to the latest master version.
See the error log:

erpnext@erpnext-vm:~/frappe-bench$ bench update --upgrade
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe
 * branch            master     -> FETCH_HEAD
Already up-to-date.
INFO:bench.app:pulling erpnext
From https://github.com/frappe/erpnext
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
Migrating erpnext.erpnext-vm
Executing finally:frappe.patches.v6_24.sync_desktop_icons in erpnext.erpnext-vm (erpnext)
Success
Executing frappe.patches.v7_0.desktop_icons_hidden_by_admin_as_blocked in erpnext.erpnext-vm (erpnext)
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/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/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/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 27, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 26, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 60, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 80, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v7_0/desktop_icons_hidden_by_admin_as_blocked.py", line 9, in execute
    frappe.db.sql('update `tabDesktop Icon` set blocked = 1 where standard=1 and hidden=1')
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/database.py", line 148, in sql
    self._cursor.execute(query)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, "Table 'erpnext.tabDesktop Icon' doesn't exist")
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/erpnext/bench-repo/bench/commands/update.py", line 90, in _update
    patch_sites(bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 161, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
  File "/home/erpnext/bench-repo/bench/utils.py", line 501, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')
erpnext@erpnext-vm:~/frappe-bench$

I have tried a lot of things but i’am stuck in updating to the latest version. Hope anybody can help me with the problem!

btw trying to upgrade from version:
ERPNext: v6.16.1
Frappe Framework: v6.17.2

greetings, Bram

try this
https://discuss.frappe.io/t/six-step-guide-to-upgrade-from-v6-to-v7/14637

Thanks for your reply but i still have the error on Executing frappe.patches.v7_0.desktop_icons_hidden_by_admin_as_blocked in erpnext.erpnext-vm (erpnext)

erpnext@erpnext-vm:~/frappe-bench$ node -v
v6.4.0
erpnext@erpnext-vm:~/frappe-bench$ npm -v
3.10.3

Run bench --site <your-site-name> reload_doc desk doctype desktop_icon first, then try to run bench update again.

Hi,

The command doesn’t work for me:

bench --site site1.local reload_doc desk doctype desktop_icon
Usage: bench frappe [OPTIONS] COMMAND [ARGS]…

Error: No such command “reload_doc”.

Thanks

Try reload-doc

Thanks! that seems to work. But now the next doc is giving a problem:

Executing finally:frappe.patches.v6_24.sync_desktop_icons in erpnext.erpnext-vm (erpnext)
Success
Executing erpnext.patches.v6_16.update_billing_status_in_dn_and_pr in erpnext.erpnext-vm (erpnext)
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)

Is there maybe a way to reload all the docs?

Thanks, this worked to me and then I could upgrade without problems! :slight_smile: