Errors while updating from V4 to V5

I have V4 installed and got these errors while trying to update to V5.
Can’t understand if it is related to Git or Bench. Please help.

[root@localhost frappe-bench]# bench update
Already up-to-date.
remote: Counting objects: 116, done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 116 (delta 58), reused 18 (delta 16), pack-reused 7
Receiving objects: 100% (116/116), 33.27 KiB | 0 bytes/s, done.
Resolving deltas: 100% (58/58), completed with 16 local objects.
From https://github.com/frappe/frappe
1935742…c8f9c6d develop -> upstream/develop
a7992a2…c8f9c6d master -> upstream/master

  • [new tag] v5.0.22 -> v5.0.22
    From https://github.com/frappe/frappe
  • [new tag] v5.0.20 -> v5.0.20
  • [new tag] v5.0.21 -> v5.0.21
    Traceback (most recent call last):
    File “/usr/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 56, in cli
    bench()
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 664, in call
    return self.main(*args, **kwargs)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 644, in main
    rv = self.invoke(ctx)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 991, in invoke
    return processresult(sub_ctx.command.invoke(sub_ctx))
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 464, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/bench-repo/bench/cli.py”, line 221, in update
    version_upgrade = is_version_upgrade()
    File “/home/frappe/bench-repo/bench/app.py”, line 98, in is_version_upgrade
    upstream_version = get_upstream_version(frappe_dir, branch=branch)
    File “/home/frappe/bench-repo/bench/app.py”, line 131, in get_upstream_version
    branch = get_current_branch(repo_dir)
    File “/home/frappe/bench-repo/bench/app.py”, line 120, in get_current_branch
    return get_cmd_output(“basename $(git symbolic-ref -q HEAD)”, cwd=repo_dir)
    File “/home/frappe/bench-repo/bench/utils.py”, line 257, in get_cmd_output
    return subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, ‘wb’)).strip()
    File “/usr/lib64/python2.7/subprocess.py”, line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
    subprocess.CalledProcessError: Command ‘basename $(git symbolic-ref -q HEAD)’ returned non-zero exit status 1
    erpnext4@erpnext4ubuntu:~$ bench switch-to-master
    remote: Counting objects: 13, done.
    remote: Compressing objects: 100% (13/13), done.
    remote: Total 13 (delta 2), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (13/13), done.
    From https://github.com/frappe/frappe
    f92b27b…b6c1ba6 develop -> upstream/develop
    Already on ‘master’
    Your branch is up-to-date with ‘upstream/master’.
    Already up-to-date.
    Already on ‘master’
    Your branch is up-to-date with ‘upstream/master’.
    Already up-to-date.

Switched to master
Please run bench update --patch to be safe from any differences in database sc hema
erpnext4@erpnext4ubuntu:~$ ^C
erpnext4@erpnext4ubuntu:~$ bench update --patch
/home/erpnext4/frappe-bench/env/bin/python: No module named num2words
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/erpnext4/bench-repo/bench/cli.py”, line 56, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 664, in ca ll
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 invo ke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 837, in invo ke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 464, in invo ke
return callback(*args, **kwargs)
File “/home/erpnext4/bench-repo/bench/cli.py”, line 249, in update
backup_all_sites()
File “/home/erpnext4/bench-repo/bench/utils.py”, line 331, in backup_all_sites
backup_site(site, bench=bench)
File “/home/erpnext4/bench-repo/bench/utils.py”, line 327, in backup_site
run_frappe_cmd(’–site’, site, ‘backup’, bench=bench)
File “/home/erpnext4/bench-repo/bench/utils.py”, line 437, in run_frappe_cmd
subprocess.check_call((f, ‘-m’, ‘frappe.utils.bench_helper’, ‘frappe’) + arg s, cwd=sites_dir)
File “/usr/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘(’/home/erpnext4/frappe-bench/env/bin/py thon’, ‘-m’, ‘frappe.utils.bench_helper’, ‘frappe’, ‘–site’, ‘site1.local’, ‘ba ckup’)’ returned non-zero exit status 1
erpnext4@erpnext4ubuntu:~$ backup’)’ returned non-zero exit status 1
No command ‘backup)’ found, did you mean:
Command ‘backup’ from package ‘openafs-client’ (universe)
backup): command not found