Bench Update Reset Error

I ran “bench update --reset” and encountered this error.

Anyone know how to resolve it?

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/chimso/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/chimso/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/chimso/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/chimso/frappe-bench/apps/frappe/frappe/commands/site.py”, line 233, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/home/chimso/frappe-bench/apps/frappe/frappe/migrate.py”, line 40, in migrate
clear_global_cache()
File “/home/chimso/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 48, in clear_global_cache
clear_website_cache()
File “/home/chimso/frappe-bench/apps/frappe/frappe/website/render.py”, line 295, in clear_cache
frappe.clear_cache(“Guest”)
File “/home/chimso/frappe-bench/apps/frappe/frappe/init.py”, line 567, in clear_cache
frappe.cache_manager.clear_user_cache(user)
File “/home/chimso/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 31, in clear_user_cache
clear_notifications(user)
File “/home/chimso/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 120, in clear_notifications
config = get_notification_config()
File “/home/chimso/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 198, in get_notification_config
return frappe.cache().hget(“notification_config”, frappe.session.user, _get)
File “/home/chimso/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 172, in hget
value = super(RedisWrapper, self).hget(_name, key)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/redis/client.py”, line 1963, in hget
return self.execute_command(‘HGET’, name, key)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/redis/client.py”, line 668, in execute_command
return self.parse_response(connection, command_name, **options)
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/redis/client.py”, line 680, in parse_response
response = connection.read_response()
File “/home/chimso/frappe-bench/env/lib/python3.6/site-packages/redis/connection.py”, line 629, in read_response
raise response
redis.exceptions.ResponseError: WRONGTYPE Operation against a key holding the wrong kind of value

This is a redis cache problem…fixable like so

redis-cli -p 13000 FLUSHALL
bench update --reset

from here…

Worked like a charm.

not worked for me

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/commands/site.py”, line 233, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/migrate.py”, line 48, in migrate
frappe.modules.patch_handler.run_all(skip_failing)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/modules/patch_handler.py”, line 41, in run_all
run_patch(patch)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/modules/patch_handler.py”, line 30, in run_patch
if not run_single(patchmodule = patch):
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/modules/patch_handler.py”, line 71, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/modules/patch_handler.py”, line 91, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/patches/v11_0/make_all_prepared_report_attachments_private.py”, line 10, in execute
file_doc.save()
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/model/document.py”, line 272, in save
return self._save(*args, **kwargs)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/model/document.py”, line 308, in _save
self.run_before_save_methods()
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/model/document.py”, line 888, in run_before_save_methods
self.run_method(“validate”)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/model/document.py”, line 787, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/model/document.py”, line 781, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/netmanthan/netmanthan-bench/apps/frappe/frappe/core/doctype/file/file.py”, line 117, in validate
os.path.join(private_files, self.file_name))
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/shutil.py”, line 564, in move
copy_function(src, real_dst)
File “/home/netmanthan/netmanthan-bench/env/lib/python3.6/shutil.py”, line 263, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)

In your case, I think there’s a permissions error relating to the symbolic links. Maybe try this…

cd /home/netmanthan/
sudo chown -R netmanthan:netmanthan /home/netmanthan/netmanthan-bench
redis-cli -p 13000 FLUSHALL
bench update --reset