[fixed] Bench update --upgrade error

after running command ‘bench update --upgrade’ i am getting the following error:

Executing execute:frappe.delete_doc_if_exists(“DocType”, “Manage Variants Item”) in acmestones (422a8894cf)
Success
Executing erpnext.patches.v4_2.repost_reserved_qty #2015-08-20 in acmestones (422a8894cf)
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/satishg/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/satishg/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/satishg/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/home/satishg/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/home/satishg/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/satishg/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/satishg/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/satishg/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/satishg/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/satishg/frappe-bench/apps/frappe/frappe/commands.py”, line 213, in migrate
frappe.modules.patch_handler.run_all()
File “/home/satishg/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/satishg/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/satishg/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/satishg/frappe-bench/apps/erpnext/erpnext/patches/v4_2/repost_reserved_qty.py”, line 28, in execute
“reserved_qty”: get_reserved_qty(item_code, warehouse)
File “/home/satishg/frappe-bench/apps/erpnext/erpnext/stock/stock_balance.py”, line 109, in get_reserved_qty
“”", (item_code, warehouse, item_code, warehouse))
File “/home/satishg/frappe-bench/apps/frappe/frappe/database.py”, line 135, in sql
self._cursor.execute(query, values)
File “/home/satishg/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/satishg/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 ‘delivered_by_supplier’ in ‘where clause’”)
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/satishg/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 664, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 644, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/satishg/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/satishg/bench-repo/bench/cli.py”, line 273, in update
patch_sites(bench=bench_path)
File “/home/satishg/bench-repo/bench/utils.py”, line 158, in patch_sites
run_frappe_cmd(‘–site’, ‘all’, ‘migrate’, bench=bench)
File “/home/satishg/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (‘–site’, ‘all’, ‘migrate’)

I has something to do with field ‘delivered_by_supplier’
How can i fix it??

I have not made any change to the files. So i don’t think its a case of changed files.
Any help??

Fixed it with the following command

bench reload-doc selling doctype sales_order_item

thanks

3 Likes