Update ERPNext Docker 13.26.0 to 14.23.3

Hi All,
i’ve been trying to update from 13.26.0 to 14.23.3 docker versions.
i made a backup from 13.26.0 and restored to 14.23.3
but when i run the migrate command bench --site Frappe migrate i get :

Traceback with variables (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
      mod_name = 'frappe.utils.bench_helper'
      alter_argv = True
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f36680cbfa0>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      code = <code object <module> at 0x7f3665f3eef0, file "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      main_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7f36680cbfa0>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f36680cbfa0>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/local/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/local/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/local/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/local/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/local/lib/python3...
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
      code = <code object <module> at 0x7f3665f3eef0, file "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 1>
      run_globals = {'__name__': '__main__', '__doc__': None, '__package__': 'frappe.utils', '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x7f36680cbfa0>, '__spec__': ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f36680cbfa0>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'), '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py', '__cached__': '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc', 'importlib': <module 'importlib' from '/usr/local/lib/python3.10/importlib/__init__.py'>, 'json': <module 'json' from '/usr/local/lib/python3.10/json/__init__.py'>, 'os': <module 'os' from '/usr/local/lib/python3.10/os.py'>, 'traceback': <module 'traceback' from '/usr/local/lib/python3.10/traceback.py'>, 'warnings': <module 'warnings' from '/usr/local/lib/python3...
      init_globals = None
      mod_name = '__main__'
      mod_spec = ModuleSpec(name='frappe.utils.bench_helper', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f36680cbfa0>, origin='/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py')
      pkg_name = 'frappe.utils'
      script_name = None
      loader = <_frozen_importlib_external.SourceFileLoader object at 0x7f36680cbfa0>
      fname = '/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py'
      cached = '/home/frappe/frappe-bench/apps/frappe/frappe/utils/__pycache__/bench_helper.cpython-310.pyc'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, in <module>
    main()
      ...skipped... 25 vars
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name="bench")
      commands = {'frappe': <Group frappe>, 'get-frappe-commands': <Command get-frappe-commands>, 'get-frappe-help': <Command get-frappe-help>}
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
      self = <Group None>
      args = ()
      kwargs = {'prog_name': 'bench'}
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
      self = <Group None>
      args = ['frappe', '--site', 'Frappe', 'migrate']
      prog_name = 'bench'
      complete_var = None
      standalone_mode = True
      extra = {}
      ctx = <click.core.Context object at 0x7f3665fdc0a0>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7f3665f4c9d0>
      args = ['migrate']
      cmd_name = 'frappe'
      cmd = <Group frappe>
      sub_ctx = <click.core.Context object at 0x7f366723cd60>
      ctx = <click.core.Context object at 0x7f3665fdc0a0>
      self = <Group None>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
      _process_result = <function MultiCommand.invoke.<locals>._process_result at 0x7f3665ff6a70>
      args = []
      cmd_name = 'migrate'
      cmd = <Command migrate>
      sub_ctx = <click.core.Context object at 0x7f3665f4bb50>
      ctx = <click.core.Context object at 0x7f366723cd60>
      self = <Group frappe>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
      self = <Command migrate>
      ctx = <click.core.Context object at 0x7f3665f4bb50>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      self = <click.core.Context object at 0x7f3665f4bb50>
      callback = <function migrate at 0x7f3665fa7130>
      ctx = <click.core.Context object at 0x7f3665f4bb50>
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      f = <function migrate at 0x7f3665fa6ef0>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
      ctx = <click.core.Context object at 0x7f3665f4bb50>
      args = ()
      kwargs = {'skip_failing': False, 'skip_search_index': False}
      profile = False
      f = <function migrate at 0x7f3665fa6e60>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 557, in migrate
    SiteMigration(
      context = {'sites': ['Frappe'], 'force': False, 'verbose': False, 'profile': False}
      skip_failing = False
      skip_search_index = False
      activate_by_import = <module 'traceback_with_variables.activate_by_import' from '/home/frappe/frappe-bench/env/lib/python3.10/site-packages/traceback_with_variables/activate_by_import.py'>
      SiteMigration = <class 'frappe.migrate.SiteMigration'>
      site = 'Frappe'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 169, in run
    if not self.required_services_running():
      self = <frappe.migrate.SiteMigration object at 0x7f3665f4b850>
      site = 'Frappe'
  File "/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py", line 150, in required_services_running
    service_status = check_connection(redis_services=["redis_cache"])
      self = <frappe.migrate.SiteMigration object at 0x7f3665f4b850>
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/connections.py", line 44, in check_connection
    service_status.update(check_redis(redis_services))
      redis_services = ['redis_cache']
      service_status = {'mariadb': True}
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/connections.py", line 36, in check_redis
    redis_host, redis_port = redis_url.split(":")
      redis_services = ['redis_cache']
      config = {'db_host': 'erpnext-db', 'db_port': 3306, 'dns_multitenant': False, 'redis_cache': 'redis://redis-cache', 'redis_queue': 'redis://redis-queue', 'redis_socketio': 'redis://redis-socketio', 'socketio_port': 9000, 'db_name': '_xxxxxxxxxx', 'db_password': 'xxxxxxxxxx', 'db_type': 'mariadb'}
      services = ['redis_cache']
      status = {}
      conn = 'redis_cache'
      redis_url = 'redis-cache'
builtins.ValueError: not enough values to unpack (expected 2, got 1)

Any Help appreciated
and welcoming any tips through this process.

Best Regards.

it needs to be redis://redis-cache:6379

2 Likes

Thanks Revant,
it solved the issue,
You are amazing man, saving me on every update.

1 Like

Greetings Revant,

I need you help once more :face_with_peeking_eye:
I’ve managed to restore all my my sites to the new installation, how ever one site generates corrupted backup, this site is still working perfectly on the old installation but only generating 173KB database backup size (should be 60MB or So), any thoughts to get this site to generate Full functional backup!

I get this on restore

Table `tabDefaultValue` not found in file.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 109, 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/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 200, in restore
    validate_database_sql(decompressed_file_name, _raise=not force)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 869, in validate_database_sql
    raise frappe.InvalidDatabaseFile
frappe.exceptions.InvalidDatabaseFile```

Many Thanks

Use mysqldump and mysql directly

1 Like

thanks a lot,
more details please :blush:

Hi Revant,
thanks for you continuous support, i’ve managed to fix the DB using the sql check.

restored the database and all in good shape

how do you do a sql check?