Issues upgrading from V10 to V12

Hello all,

Below is my erpnext version
image

I am following below steps for upgrading erpnext from ver. 10 to 12.

npm install -g yarn
bench update --reset
bench switch-to-branch version-12 --upgrade

After this step I get below error.

success Saved lockfile.
Done in 0.12s.
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 41, 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 43, in switch_to_branch
switch_to_branch(branch=branch, apps=list(apps), upgrade=upgrade)
File “/home/frappe/.bench/bench/app.py”, line 417, in switch_to_branch
switch_branch(branch, apps=apps, bench_path=bench_path, upgrade=upgrade)
File “/home/frappe/.bench/bench/app.py”, line 409, in switch_branch
reload_module(utils)
NameError: global name ‘utils’ is not defined
#####################################

Remaining commands which i plan to run post successful upgrade.

bench update --patch
reboot
bench start

Please advise

TIA
Hitesh

This is a bug in bench v5.0 which will be fixed in the next release. As a workaround, replace line 409 of /home/frappe/.bench/bench/app.py with reload_module(bench.utils) instead

1 Like

facing the same error

thanks @gavindsouza. After changing that…facing another error with redis.

success Saved lockfile.
Done in 0.13s.
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a release (2.7.7+) that supports hmac.compare_digest as soon as possible.
utils.PersistentlyDeprecated2018,
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a release (2.7.7+) that supports hmac.compare_digest as soon as possible.
utils.PersistentlyDeprecated2018,
Migrating erp.xyz.com
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 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, 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 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, 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 1137, 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 956, 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 555, 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 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 239, in migrate
migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 40, in migrate
clear_global_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 54, in clear_global_cache
clear_website_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 295, in clear_cache
frappe.clear_cache(“Guest”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 579, in clear_cache
frappe.cache_manager.clear_user_cache(user)
File “/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 32, in clear_user_cache
clear_notifications(user)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 120, in clear_notifications
config = get_notification_config()
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 200, in get_notification_config
return frappe.cache().hget(“notification_config”, user, _get)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 178, in hget
value = super(RedisWrapper, self).hget(_name, key)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/client.py”, line 1963, in hget
return self.execute_command(‘HGET’, name, key)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/client.py”, line 668, in execute_command
return self.parse_response(connection, command_name, **options)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/redis/client.py”, line 680, in parse_response
response = connection.read_response()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/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

Any pointers are appreciated.

TIA
Hitesh

it got resolved using below command

redis-cli -p 13000 FLUSHALL

but now facing another issue

Executing frappe.patches.v10_0.refactor_social_login_keys in erp.abc.com (1bd3e0294da19198)
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 97, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, 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 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1137, 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 1137, 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 956, 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 555, 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 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 239, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website, skip_failing=skip_failing)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 48, in migrate
    frappe.modules.patch_handler.run_all(skip_failing)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 41, in run_all
    run_patch(patch)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 30, in run_patch
    if not run_single(patchmodule = patch):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 71, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 91, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1046, in get_attr
    return getattr(get_module(modulename), methodname)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 827, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named refactor_social_login_keys

Please use pre-formatted text when pasting error logs or use pastebin link.

It makes the reading to read the log easily and keeps the forum clean.

1 Like

@fkardame Done, thanks for the tip!

Any pointers are helpful…

Thanks
Hitesh

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.