Updating problem

I’m having problems with updating ERPnext. After running the update, the ERP is in a fixed “Updating. We will be back in a few moments…” message. Here is the console view:

root@vps212471:~# bench update
remote: Counting objects: 5479, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 5479 (delta 1439), reused 1469 (delta 1439), pack-reused 4010
Receiving objects: 100% (5479/5479), 10.95 MiB | 6.09 MiB/s, done.
Resolving deltas: 100% (4166/4166), completed with 443 local objects.
From https://github.com/frappe/frappe



Migrating site1.local
Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘patch_log’) #2016-10-31 in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_9.int_float_not_null #2015-11-25 in site1.local (1bd3e0294d)
Success
Executing execute:frappe.permissions.reset_perms(“Web Page”) in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_6.user_last_active in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_6.rename_slovak_language in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_6.fix_file_url in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_9.rename_burmese_language in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_11.rename_field_in_email_account in site1.local (1bd3e0294d)
Success
Executing execute:frappe.delete_doc_if_exists(“Report”, “Item-wise Last Purchase Rate”) in site1.local (1bd3e0294d)
Success
Executing erpnext.patches.v6_6.fix_website_image in site1.local (1bd3e0294d)
Success
Executing erpnext.patches.v6_6.remove_fiscal_year_from_leave_allocation in site1.local (1bd3e0294d)
Success
Executing execute:frappe.delete_doc_if_exists(“DocType”, “Stock UOM Replace Utility”) in site1.local (1bd3e0294d)
Success
Executing erpnext.patches.v6_8.make_webform_standard #2015-11-23 in site1.local (1bd3e0294d)
Success
Executing erpnext.patches.v6_8.move_drop_ship_to_po_items in site1.local (1bd3e0294d)
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 213, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v6_8/move_drop_ship_to_po_items.py”, line 7, in execute
for po in frappe.get_all(“Purchase Order”, filters={“delivered_by_supplier”: 1}, fields=[“name”]):
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 936, in get_all
return get_list(doctype, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 909, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 50, in execute
return self.build_and_run()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 62, in build_and_run
return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 146, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, “Unknown column ‘tabPurchase Order.delivered_by_supplier’ in ‘where clause’”)
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/cli.py”, line 240, in _update
update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
File “/home/frappe/bench-repo/bench/cli.py”, line 269, in update
patch_sites(bench=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 158, in patch_sites
run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
File “/home/frappe/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)
root@vps212471:~# sudo bench update
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    Migrating site1.local
    Executing erpnext.patches.v6_8.move_drop_ship_to_po_items in site1.local (1bd3e0294d)
    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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 213, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v6_8/move_drop_ship_to_po_items.py”, line 7, in execute
    for po in frappe.get_all(“Purchase Order”, filters={“delivered_by_supplier”: 1}, fields=[“name”]):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 936, in get_all
    return get_list(doctype, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 909, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 50, in execute
    return self.build_and_run()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 62, in build_and_run
    return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 146, in sql
    self._cursor.execute(query)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
    self.errorhandler(self, exc, value)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
    raise errorclass, errorvalue
    _mysql_exceptions.OperationalError: (1054, “Unknown column ‘tabPurchase Order.delivered_by_supplier’ in ‘where clause’”)
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 60, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/bench-repo/bench/cli.py”, line 240, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/frappe/bench-repo/bench/cli.py”, line 269, in update
    patch_sites(bench=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 158, in patch_sites
    run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/frappe/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)
    root@vps212471:~# sudo bench update
    Already up-to-date.
    Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
    From https://github.com/frappe/frappe
  • branch master -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    Migrating site1.local
    Executing erpnext.patches.v6_8.move_drop_ship_to_po_items in site1.local (1bd3e0294d)
    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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 213, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v6_8/move_drop_ship_to_po_items.py”, line 7, in execute
    for po in frappe.get_all(“Purchase Order”, filters={“delivered_by_supplier”: 1}, fields=[“name”]):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 936, in get_all
    return get_list(doctype, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 909, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 50, in execute
    return self.build_and_run()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 62, in build_and_run
    return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 146, in sql
    self._cursor.execute(query)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
    self.errorhandler(self, exc, value)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
    raise errorclass, errorvalue
    _mysql_exceptions.OperationalError: (1054, “Unknown column ‘tabPurchase Order.delivered_by_supplier’ in ‘where clause’”)
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 60, in cli
    bench()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/bench-repo/bench/cli.py”, line 240, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/frappe/bench-repo/bench/cli.py”, line 269, in update
    patch_sites(bench=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 158, in patch_sites
    run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/frappe/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)

Fixed via https://github.com/frappe/erpnext/commit/f7911687a05e28205f6f70a901043f28cc54ffe2