Error when Upgrading to V13

Hi,

I’m trying to upgrade my ERPNext from V12 to V13.

When running below command:
bench switch-to-branch version-12 frappe erpnext --upgrade

I got this error:

Installing node dependencies for erpnext
$ yarn install
yarn install v1.22.10
[1/4] Resolving packages…
success Already up-to-date.
$ yarn run snyk-protect
yarn run v1.22.10
$ snyk protect
Successfully applied Snyk patches

Done in 5.17s.
Done in 5.92s.
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 163, in _run_module_as_main
mod_name, _Error)
File “/usr/lib/python2.7/runpy.py”, line 102, in _get_module_details
loader = get_loader(mod_name)
File “/usr/lib/python2.7/pkgutil.py”, line 464, in get_loader
return find_loader(fullname)
File “/usr/lib/python2.7/pkgutil.py”, line 474, in find_loader
for importer in iter_importers(fullname):
File “/usr/lib/python2.7/pkgutil.py”, line 430, in iter_importers
import(pkg)
File “/home/johnny/frappe-bench/apps/frappe/frappe/init.py”, line 143
db: typing.Union[MariaDBDatabase, PostgresDatabase]
^
SyntaxError: invalid syntax

After that, whenever I run bench, it end up with error:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
sys.exit(cli())
File “/usr/local/lib/python2.7/dist-packages/bench/cli.py”, line 48, in cli
if sys.argv[1] in get_frappe_commands() + ["–site", “–verbose”, “–force”, “–profile”]:
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘list’

Any help is appreciated.

Use 13 instead of 12

bench switch-to-branch version-13 frappe erpnext --upgrade

Sorry, it was a typo. But yes, I’m using version-13. And those errors are the one I got.

Has bench update --patch been tried?

Now whenever I execute “bench”, it always response with an error

Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 163, in _run_module_as_main
mod_name, _Error)
File “/usr/lib/python2.7/runpy.py”, line 102, in _get_module_details
loader = get_loader(mod_name)
File “/usr/lib/python2.7/pkgutil.py”, line 464, in get_loader
return find_loader(fullname)
File “/usr/lib/python2.7/pkgutil.py”, line 474, in find_loader
for importer in iter_importers(fullname):
File “/usr/lib/python2.7/pkgutil.py”, line 430, in iter_importers
import(pkg)
File “/home/johnny/frappe-bench/apps/frappe/frappe/init.py”, line 143
db: typing.Union[MariaDBDatabase, PostgresDatabase]
^
SyntaxError: invalid syntax

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 10, in
sys.exit(cli())
File “/usr/local/lib/python3.7/site-packages/bench/cli.py”, line 48, in cli
if sys.argv[1] in get_frappe_commands() + ["–site", “–verbose”, “–force”, “–profile”]:
TypeError: unsupported operand type(s) for +: ‘NoneType’ and ‘list’

Upgrade your bench then check.

sudo -H pip3 install --upgrade pip
bench migrate-env python3

I’ve tried that. Same problem. Seems like I can’t run bench at all.

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/lib/python2.7/runpy.py", line 102, in _get_module_details
    loader = get_loader(mod_name)
  File "/usr/lib/python2.7/pkgutil.py", line 464, in get_loader
    return find_loader(fullname)
  File "/usr/lib/python2.7/pkgutil.py", line 474, in find_loader
    for importer in iter_importers(fullname):
  File "/usr/lib/python2.7/pkgutil.py", line 430, in iter_importers
    __import__(pkg)
  File "/home/johnny/frappe-bench/apps/frappe/frappe/__init__.py", line 143
    db: typing.Union[MariaDBDatabase, PostgresDatabase]
      ^
SyntaxError: invalid syntax

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/bench/cli.py", line 48, in cli
    if sys.argv[1] in get_frappe_commands() + ["--site", "--verbose", "--force",                                                                                                              "--profile"]:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

have the same error. did you find solution for this?

1 Like