Issue with update

Hi there,

I tried to update the version is using bench update but i got this dialog:

:~$ bench update
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in ca ll
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 inv oke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invo ke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invo ke
return callback(*args, **kwargs)
File “/home/frappe/.bench/bench/commands/update.py”, line 30, in update
patches.run(bench_path=’.’)
File “/home/frappe/.bench/bench/patches/init.py”, line 21, in run
result = execute(bench_path)
File “/home/frappe/.bench/bench/patches/v3/celery_to_rq.py”, line 7, in execut e
frappe_branch = get_current_branch(‘frappe’, bench_path)
File “/home/frappe/.bench/bench/app.py”, line 171, in get_current_branch
return get_cmd_output(“basename $(git symbolic-ref -q HEAD)”, cwd=repo_dir)
File “/home/frappe/.bench/bench/utils.py”, line 321, in get_cmd_output
return subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devn ull, ‘wb’)).strip()
File “/usr/lib/python2.7/subprocess.py”, line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File “/usr/lib/python2.7/subprocess.py”, line 710, in init
errread, errwrite)
File “/usr/lib/python2.7/subprocess.py”, line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory: ‘./apps/frappe’

Appreciate your help

Hi @Mahdi_Bukhamseen
Please navigate into frappe-bench (I am guessing ‘/home/frappe/frappe-bench’ ) or where you find folders like apps, config, env, sites … before running bench update command.

Regards

Hi Bomsy

Thanks for reply…

I went to the folder and run the bench update but got this dialog

:/home/frappe/frappe-bench$ bench update
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/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 1057, in invoke
Command.invoke(self, 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/frappe/.bench/bench/commands/init.py”, line 21, in bench_command
setup_logging(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 265, in setup_logging
hdlr = logging.FileHandler(log_file)
File “/usr/lib/python2.7/logging/init.py”, line 903, in init
StreamHandler.init(self, self._open())
File “/usr/lib/python2.7/logging/init.py”, line 928, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: ‘/home/frappe/frappe-bench/logs/bench.log’

You can do a
sudo bench update

sorry even sudo didnt work, i got this:

/home/frappe/frappe-bench$ sudo bench update
INFO:bench.utils:updating bench
Updating 3fe7392…e3fa8c4
error: Your local changes to the following files would be overwritten by merge:
bench/commands/config.py
bench/commands/git.py
bench/commands/utils.py
bench/config/common_site_config.py
bench/config/nginx.py
bench/config/redis.py
bench/config/site_config.py
bench/tests/test_setup_production.py
Please, commit your changes or stash them before you can merge.
Aborting
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/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/frappe/.bench/bench/commands/update.py”, line 34, in update
update_bench()
File “/home/frappe/.bench/bench/utils.py”, line 227, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappe/.bench/bench/utils.py”, line 127, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

ok, you’ll need make sure you have proper permissions for both frappe-bench and .bench folders.
run the following commands : replace username with your system’s username without the square brackets

sudo chown -R [username]:[username] /home/frappe/.bench
sudo chown -R [username]:[username] /home/frappe/frappe-bench
cd /home/frappe/frappe-bench
bench update

Thank you very much for your help. i run these command but got another proplem:

/home/frappe/frappe-bench$ bench update
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/.bench/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 1057, in invoke
Command.invoke(self, 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/frappe/.bench/bench/commands/init.py”, line 21, in bench_command
setup_logging(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 267, in setup_logging
hdlr = logging.FileHandler(log_file)
File “/usr/lib/python2.7/logging/init.py”, line 903, in init
StreamHandler.init(self, self._open())
File “/usr/lib/python2.7/logging/init.py”, line 928, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: ‘/home/frappe/frappe-bench/logs/bench.log’
ubuntu@ip-172-31-43-21:/home/frappe/frappe-bench$ sudo bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream master
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    Backing up sites…
    Patching sites…
    Migrating site1.local
    Executing frappe.patches.v7_1.rename_scheduler_log_to_error_log in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_2.remove_in_filter in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘doctype’, force=True) #2017-03-09 in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v8_0.drop_in_dialog in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docfield’, force=True) #2017-03-03 in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docperm’) #2017-03-03 in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v8_0.drop_is_custom_from_docperm in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v8_0.update_records_in_global_search in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v8_0.update_published_in_global_search in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘custom_docperm’) in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘deleted_document’) in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘version’) #2017-04-01 in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v8_0.rename_page_role_to_has_role #2017-03-16 in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_2.setup_custom_perms #2017-01-19 in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v8_0.set_user_permission_for_page_and_report #2017-03-20 in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘user’) in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.clear_cache() in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_1.sync_language_doctype in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_1.rename_chinese_language_codes in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_1.setup_integration_services #2016-10-27 in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.core.doctype.language.language.update_language_names() # 2017-04-12 in site1.local (1bd3e0294da19198)
    Success
    Executing execute:frappe.db.set_default(‘language’, ‘’) in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_1.refactor_integration_broker in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_1.set_backup_limit in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_1.disabled_print_settings_for_custom_print_format in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_2.set_doctype_engine in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_2.merge_knowledge_base in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_0.update_report_builder_json in site1.local (1bd3e0294da19198)
    Success
    Executing frappe.patches.v7_2.set_in_standard_filter_property #1 in site1.local (1bd3e0294da19198)
    /home/frappe/frappe-bench/apps/erpnext/erpnext/schools/doctype/assessment/assessment.json missing
    /home/frappe/frappe-bench/apps/erpnext/erpnext/buying/doctype/quality_inspection/quality_inspection.json missing
    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 716, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 211, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/patches/v7_2/set_in_standard_filter_property.py”, line 13, in execute
    frappe.reload_doctype(doctype.name, force=True)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 651, in reload_doctype
    force=force, reset_permissions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 663, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 152, in reload_doc
    return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 19, in import_files
    reset_permissions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 24, in import_file
    ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 58, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 129, in import_doc
    doc.insert()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 220, in insert
    self.run_post_save_methods()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 790, in run_post_save_methods
    self.run_method(“on_update”)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 892, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 875, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 194, in on_update
    make_module_and_roles(self)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 719, in make_module_and_roles
    r.insert()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 214, in insert
    self.run_method(“after_insert”)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 892, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 875, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/role/role.py”, line 19, in after_insert
    user.add_roles(self.name)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 360, in add_roles
    self.save()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in save
    return self._save(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 264, in _save
    self.run_before_save_methods()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_before_save_methods
    self.run_method(“validate”)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 667, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 892, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 875, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 661, in
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 56, in validate
    self.set_system_user()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 140, in set_system_user
    if self.has_desk_access() or self.name == ‘Administrator’:
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py”, line 153, in has_desk_access
    [d.role for d in self.roles]))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 138, in sql
    self._cursor.execute(query, values)
    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 ‘desk_access’ in ‘where clause’”)

You can try this

It didnt work

:/home/frappe/frappe-bench$ bench --site site1.local reloa d-doctype Role
ubuntu@ip-172-31-43-21:/home/frappe/frappe-bench$ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream master
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling kanban
    INFO:bench.utils:git pull upstream master
    From https://github.com/aruizramon/erpnext-kanban
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    Updating Python libraries…
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requ ests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not availab le on this platform. This may cause the server to present an incorrect TLS certi ficate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.i o/en/latest/security.html#snimissingwarning.
    SNIMissingWarning
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requ ests/packages/urllib3/util/ssl.py:122: InsecurePlatformWarning: A true SSLConte xt object is not available. This prevents urllib3 from configuring SSL appropria tely and may cause certain SSL connections to fail. You can upgrade to a newer v ersion of Python to solve this. For more information, see https://urllib3.readth edocs.io/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.tx t
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/kanban/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
    INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
    Backing up sites…
    Patching sites…
    Migrating site1.local
    Executing erpnext.patches.v7_2.update_assessment_modules in site1.local (1bd3e02 94da19198)
    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”, lin e 79, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 211 , in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in mi grate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v7_2/update_asses sment_modules.py”, line 10, in execute
    rename_field(“Grading Scale Interval”, “to_score”, “threshold”)
    File "/home/frappe/frappe-bench/apps/frappe/frappe/model/utils/rename_field.py ", line 33, in rename_field
    (doctype, new_fieldname, old_fieldname))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 149, 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 ‘to_score’ in ‘field list’”)

ok, please list the content of your sites directory, you might need to drop the sites available (If not important) and create a new one

you mean this:

/home/frappe/frappe-bench/sites$ ls
apps.txt common_site_config.json languages.txt
assets currentsite.txt site1.local

run

bench backup
bench drop-site site1.local
bench new-site site1.local
bench update

Any updates on this? I am getting the same error.

Make sure you are on develop branch of frappe and erpnext.

in frappe.bench/apps/frappe : $git checkout develop
in frappe.bench/apps/erpnext : $git checkout develop

now in frappe.bench:$bench update