Error during migration to v13 from v12.19

Hello,

Can you help me with below error?

frappe-bench$ bench switch-to-branch version                                                                             -13 frappe erpnext --upgrade
LOG: Fetching upstream for frappe
$ git remote set-branches upstream  '*'
$ git fetch --all
Fetching upstream
Switching for frappe
$ git checkout version-13
Branch version-13 set up to track remote branch version-13 from upstream.
Switched to a new branch 'version-13'
LOG: Fetching upstream for erpnext
$ git remote set-branches upstream  '*'
$ git fetch --all
Fetching upstream
remote: Enumerating objects: 16366, done.
remote: Counting objects: 100% (16366/16366), done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 51882 (delta 16313), reused 16335 (delta 16298), pack-reused 35516
Receiving objects: 100% (51882/51882), 120.11 MiB | 25.53 MiB/s, done.
Resolving deltas: 100% (40211/40211), completed with 2290 local objects.
From https://github.com/frappe/erpnext
 * [new branch]      accounts_settings -> upstream/accounts_settings
 * [new branch]      dependabot/npm_and_yarn/ini-1.3.8 -> upstream/dependabot/np                                                                             m_and_yarn/ini-1.3.8
 * [new branch]      dependabot/npm_and_yarn/y18n-3.2.2 -> upstream/dependabot/n                                                                             pm_and_yarn/y18n-3.2.2
   5d03626..9864521  develop    -> upstream/develop
 * [new branch]      dynamic-links-in-report -> upstream/dynamic-links-in-report
 * [new branch]      enconnex_erpnext -> upstream/enconnex_erpnext
 * [new branch]      enterprise-v13-production -> upstream/enterprise-v13-produc                                                                             tion
 * [new branch]      enterprise-v13-staging -> upstream/enterprise-v13-staging
 * [new branch]      ishanloya-regional -> upstream/ishanloya-regional
 * [new branch]      rebrand-ui -> upstream/rebrand-ui
 * [new branch]      rebrand-ui-fixes -> upstream/rebrand-ui-fixes
 * [new branch]      repost-item-costing -> upstream/repost-item-costing
 * [new branch]      revert-24039-fixed-incorrect-gstr-report-issue -> upstream/                                                                             revert-24039-fixed-incorrect-gstr-report-issue
 * [new branch]      revert-24318-fix-currency-validation-for-party -> upstream/                                                                             revert-24318-fix-currency-validation-for-party
 * [new branch]      shopping-cart -> upstream/shopping-cart
   e269aa9..49b0afc  v10.x.x    -> upstream/v10.x.x
   5889a29..84c0490  v11-pre-release -> upstream/v11-pre-release
   bd6b180..ce3a680  v12-pre-release -> upstream/v12-pre-release
   5889a29..7e4f8fa  version-11 -> upstream/version-11
   15432c7..1d6bb39  version-11-hotfix -> upstream/version-11-hotfix
 * [new branch]      version-12-hotfix -> upstream/version-12-hotfix
 * [new branch]      version-12-hotfix-1 -> upstream/version-12-hotfix-1
 * [new branch]      version-13 -> upstream/version-13
 * [new branch]      version-13-beta -> upstream/version-13-beta
 * [new branch]      version-13-beta-pre-release -> upstream/version-13-beta-pre                                                                             -release
 * [new branch]      version-13-pre-release -> upstream/version-13-pre-release
 * [new tag]         v11.1.77   -> v11.1.77
 * [new tag]         v12.1.7    -> v12.1.7
 * [new tag]         v12.1.8    -> v12.1.8
 * [new tag]         v12.10.0   -> v12.10.0
 * [new tag]         v12.10.1   -> v12.10.1
 * [new tag]         v12.11.0   -> v12.11.0
 * [new tag]         v12.11.1   -> v12.11.1
 * [new tag]         v12.11.2   -> v12.11.2
 * [new tag]         v12.12.0   -> v12.12.0
 * [new tag]         v12.12.1   -> v12.12.1
 * [new tag]         v12.13.0   -> v12.13.0
 * [new tag]         v12.14.0   -> v12.14.0
 * [new tag]         v12.15.0   -> v12.15.0
 * [new tag]         v12.16.0   -> v12.16.0
 * [new tag]         v12.16.1   -> v12.16.1
 * [new tag]         v12.16.2   -> v12.16.2
 * [new tag]         v12.17.0   -> v12.17.0
 * [new tag]         v12.18.0   -> v12.18.0
 * [new tag]         v12.19.0   -> v12.19.0
 * [new tag]         v12.2.0    -> v12.2.0
 * [new tag]         v12.2.1    -> v12.2.1
 * [new tag]         v12.2.2    -> v12.2.2
 * [new tag]         v12.2.3    -> v12.2.3
 * [new tag]         v12.3.0    -> v12.3.0
 * [new tag]         v12.3.1    -> v12.3.1
 * [new tag]         v12.4.0    -> v12.4.0
 * [new tag]         v12.4.1    -> v12.4.1
 * [new tag]         v12.4.2    -> v12.4.2
 * [new tag]         v12.4.3    -> v12.4.3
 * [new tag]         v12.5.0    -> v12.5.0
 * [new tag]         v12.5.1    -> v12.5.1
 * [new tag]         v12.5.2    -> v12.5.2
 * [new tag]         v12.6.0    -> v12.6.0
 * [new tag]         v12.7.0    -> v12.7.0
 * [new tag]         v12.7.1    -> v12.7.1
 * [new tag]         v12.8.0    -> v12.8.0
 * [new tag]         v12.9.0    -> v12.9.0
 * [new tag]         v12.9.1    -> v12.9.1
 * [new tag]         v12.9.2    -> v12.9.2
 * [new tag]         v12.9.3    -> v12.9.3
 * [new tag]         v12.9.4    -> v12.9.4
 * [new tag]         v13.0.0-beta.13 -> v13.0.0-beta.13
 * [new tag]         v13.0.1    -> v13.0.1
 * [new tag]         v11.1.68   -> v11.1.68
 * [new tag]         v11.1.69   -> v11.1.69
 * [new tag]         v11.1.70   -> v11.1.70
 * [new tag]         v11.1.71   -> v11.1.71
 * [new tag]         v11.1.72   -> v11.1.72
 * [new tag]         v11.1.73   -> v11.1.73
 * [new tag]         v11.1.74   -> v11.1.74
 * [new tag]         v11.1.75   -> v11.1.75
 * [new tag]         v11.1.76   -> v11.1.76
 * [new tag]         v13.0.0    -> v13.0.0
 * [new tag]         v13.0.0-beta.1 -> v13.0.0-beta.1
 * [new tag]         v13.0.0-beta.10 -> v13.0.0-beta.10
 * [new tag]         v13.0.0-beta.11 -> v13.0.0-beta.11
 * [new tag]         v13.0.0-beta.12 -> v13.0.0-beta.12
 * [new tag]         v13.0.0-beta.14 -> v13.0.0-beta.14
 * [new tag]         v13.0.0-beta.2 -> v13.0.0-beta.2
 * [new tag]         v13.0.0-beta.3 -> v13.0.0-beta.3
 * [new tag]         v13.0.0-beta.4 -> v13.0.0-beta.4
 * [new tag]         v13.0.0-beta.5 -> v13.0.0-beta.5
 * [new tag]         v13.0.0-beta.6 -> v13.0.0-beta.6
 * [new tag]         v13.0.0-beta.7 -> v13.0.0-beta.7
 * [new tag]         v13.0.0-beta.8 -> v13.0.0-beta.8
 * [new tag]         v13.0.0-beta.9 -> v13.0.0-beta.9
Switching for erpnext
$ git checkout version-13
Branch version-13 set up to track remote branch version-13 from upstream.
Switched to a new branch 'version-13'
SUCCESS: Successfully switched branches for: frappe, erpnext
Please run `bench update --patch` to be safe from any differences in database sc                                                                             hema
Updating Python libraries...
$ ./env/bin/pip install -q -U pip
INFO:bench.app:installing frappe
$ ./env/bin/pip install -q -U -e ./apps/frappe
  ERROR: Command errored out with exit status 1:
   command: /home/frappe/frappe-bench/env/bin/python3.6 -u -c 'import sys, setup                                                                             tools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-94j_8al2/psutil_95c8b4595a5                                                                             e4caa843ec1a5d2369bca/setup.py'"'"'; __file__='"'"'/tmp/pip-install-94j_8al2/psu                                                                             til_95c8b4595a5e4caa843ec1a5d2369bca/setup.py'"'"';f=getattr(tokenize, '"'"'open                                                                             '"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.clo                                                                             se();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-whee                                                                             l-7l5s_t09
       cwd: /tmp/pip-install-94j_8al2/psutil_95c8b4595a5e4caa843ec1a5d2369bca/
  Complete output (43 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/psutil
  copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_psosx.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/__init__.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_compat.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_psposix.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_common.py -> build/lib.linux-x86_64-3.6/psutil
  copying psutil/_psaix.py -> build/lib.linux-x86_64-3.6/psutil
  creating build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.6/psutil/                                                                             tests
  copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_testutils.py -> build/lib.linux-x86_64-3.6/psutil/te                                                                             sts
  copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_memleaks.py -> build/lib.linux-x86_64-3.6/psutil/tes                                                                             ts
  copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.6/psutil/te                                                                             sts
  copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.6/psutil/tests
  copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.6/psutil/test                                                                             s
  copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.6/psutil/test                                                                             s
  copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.6/psutil/test                                                                             s
  running build_ext
  building 'psutil._psutil_linux' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/psutil
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protect                                                                             or-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC                                                                              -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=572 -DPSUTIL_LINUX=1                                                                              -I/usr/include/python3.6m -I/home/frappe/frappe-bench/env/include/python3.6m -c                                                                              psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
  psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for psutil
    ERROR: Command errored out with exit status 1:
     command: /home/frappe/frappe-bench/env/bin/python3.6 -u -c 'import sys, set                                                                             uptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-94j_8al2/psutil_95c8b4595                                                                             a5e4caa843ec1a5d2369bca/setup.py'"'"'; __file__='"'"'/tmp/pip-install-94j_8al2/p                                                                             sutil_95c8b4595a5e4caa843ec1a5d2369bca/setup.py'"'"';f=getattr(tokenize, '"'"'op                                                                             en'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.c                                                                             lose();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-                                                                             record-jk3nim5a/install-record.txt --single-version-externally-managed --compile                                                                              --install-headers /home/frappe/frappe-bench/env/include/site/python3.6/psutil
         cwd: /tmp/pip-install-94j_8al2/psutil_95c8b4595a5e4caa843ec1a5d2369bca/
    Complete output (43 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/psutil
    copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_psosx.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/__init__.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_compat.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_psposix.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_common.py -> build/lib.linux-x86_64-3.6/psutil
    copying psutil/_psaix.py -> build/lib.linux-x86_64-3.6/psutil
    creating build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/runner.py -> build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.6/psuti                                                                             l/tests
    copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/test_testutils.py -> build/lib.linux-x86_64-3.6/psutil/                                                                             tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/test_memleaks.py -> build/lib.linux-x86_64-3.6/psutil/t                                                                             ests
    copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.6/psutil/test                                                                             s
    copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.6/psutil/test                                                                             s
    copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.6/psutil/test                                                                             s
    copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.6/psutil/                                                                             tests
    copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.6/psutil/tes                                                                             ts
    copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-3.6/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.6/psutil/te                                                                             sts
    copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.6/psutil/te                                                                             sts
    copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.6/psutil/te                                                                             sts
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/psutil
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-prote                                                                             ctor-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fP                                                                             IC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=572 -DPSUTIL_LINUX=                                                                             1 -I/usr/include/python3.6m -I/home/frappe/frappe-bench/env/include/python3.6m -                                                                             c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
    psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directo                                                                             ry
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/frappe/frappe-bench/env/bin                                                                             /python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-                                                                             install-94j_8al2/psutil_95c8b4595a5e4caa843ec1a5d2369bca/setup.py'"'"'; __file__                                                                             ='"'"'/tmp/pip-install-94j_8al2/psutil_95c8b4595a5e4caa843ec1a5d2369bca/setup.py                                                                             '"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace(                                                                             '"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"                                                                             '"'))' install --record /tmp/pip-record-jk3nim5a/install-record.txt --single-ver                                                                             sion-externally-managed --compile --install-headers /home/frappe/frappe-bench/en                                                                             v/include/site/python3.6/psutil Check the logs for full command output.
$ sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
INFO:bench.app:installing erpnext
$ ./env/bin/pip install -q -U -e ./apps/erpnext
$ sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
Updating node packages...
$ yarn install
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > bootstrap@4.5.0" has unmet peer dependency "jquery@1.9.1 - 3".
warning " > bootstrap@4.5.0" has unmet peer dependency "popper.js@^1.16.0".
[4/4] Building fresh packages...
$ yarn run snyk-protect
yarn run v1.22.5
$ snyk protect
Successfully applied Snyk patches

Done in 13.77s.
Done in 59.01s.
$ yarn install
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
$ yarn run snyk-protect
yarn run v1.22.5
$ snyk protect
Successfully applied Snyk patches

Done in 2.56s.
Done in 17.06s.
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    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 722, in __ca                                                                             ll__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in inv                                                                             oke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invo                                                                             ke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invo                                                                             ke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 43, in switch_to_bra                                                                             nch
    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

In the bench folder execute

./env/bin/pip install psutil

1 Like