Error updating 13.22

Running Ubuntu 18.04.6 LTS

frappe@ubuntu:~/frappe-bench$ bench version
erpnext 13.21.0
frappe 13.21.0

ERROR

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch version-13 → FETCH_HEAD
    WARN: shallow_clone is set in your bench config.
    However without passing the --reset flag, your repositories will be unshallowed.
    To avoid this, cancel this operation and run bench update --reset.

Consider the consequences of git reset --hard on your apps before you run that.
To avoid seeing this warning, set shallow_clone to false in your common_site_config.json

Backing up sites…
Backup Summary for site1.local at 2022-02-22 22:25:51.144685
Config : ./site1.local/private/backups/20220222_222541-site1_local-site_config_backup.json 339.0B
Database: ./site1.local/private/backups/20220222_222541-site1_local-database.sql.gz 2.2MiB
Backup for Site site1.local has been successfully completed
Updating apps source…
$ git pull upstream version-13
From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)

  • branch version-13 → FETCH_HEAD
    Already up to date.
    $ find . -name “*.pyc” -delete
    Unshallowing frappe to safely pull remote changes.
    $ git fetch upstream --unshallow
    remote: Enumerating objects: 131, done.
    remote: Counting objects: 100% (101/101), done.
    remote: Compressing objects: 100% (24/24), done.
    remote: Total 31 (delta 19), reused 18 (delta 7), pack-reused 0
    Unpacking objects: 100% (31/31), done.
    From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
    bedf60280f…f4518e2cf9 develop → upstream/develop
    5e8f48f0ae…dbd7e0a1cc version-13-hotfix → upstream/version-13-hotfix
    $ git pull upstream version-13
    From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
  • branch version-13 → FETCH_HEAD
    Already up to date.
    $ find . -name “*.pyc” -delete
    Setting up requirements…
    $ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
    Installing 2 applications…
    Installing frappe
    $ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/frappe
    ERROR: Could not find a version that satisfies the requirement ipython~=7.31.1 (from frappe) (from versions: 0.10, 0.10.1, 0.10.2, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 0.13.2, 1.0.0, 1.1.0, 1.2.0, 1.2.1, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.3.1, 2.4.0, 2.4.1, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 4.0.0b1, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.1.0rc1, 4.1.0rc2, 4.1.0, 4.1.1, 4.1.2, 4.2.0, 4.2.1, 5.0.0b1, 5.0.0b2, 5.0.0b3, 5.0.0b4, 5.0.0rc1, 5.0.0, 5.1.0, 5.2.0, 5.2.1, 5.2.2, 5.3.0, 5.4.0, 5.4.1, 5.5.0, 5.6.0, 5.7.0, 5.8.0, 5.9.0, 5.10.0, 6.0.0rc1, 6.0.0, 6.1.0, 6.2.0, 6.2.1, 6.3.0, 6.3.1, 6.4.0, 6.5.0, 7.0.0b1, 7.0.0rc1, 7.0.0, 7.0.1, 7.1.0, 7.1.1, 7.2.0, 7.3.0, 7.4.0, 7.5.0, 7.6.0, 7.6.1, 7.7.0, 7.8.0, 7.9.0, 7.10.0, 7.10.1, 7.10.2, 7.11.0, 7.11.1, 7.12.0, 7.13.0, 7.14.0, 7.15.0, 7.16.0, 7.16.1, 7.16.2, 7.16.3)
    ERROR: No matching distribution found for ipython~=7.31.1
    ERROR:
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 8, in
    sys.exit(cli())
    File “/usr/local/lib/python3.6/dist-packages/bench/cli.py”, line 121, in cli
    raise e
    File “/usr/local/lib/python3.6/dist-packages/bench/cli.py”, line 111, in cli
    bench_command()
    File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 764, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 717, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 555, in invoke
    return callback(*args, **kwargs)
    File “/usr/local/lib/python3.6/dist-packages/bench/commands/update.py”, line 23, in update
    update(pull=pull, apps=apps, patch=patch, build=build, requirements=requirements, restart_supervisor=restart_supervisor, restart_systemd=restart_systemd, backup=not no_backup, compile=not no_compile, force=force, reset=reset)
    File “/usr/local/lib/python3.6/dist-packages/bench/utils/bench.py”, line 394, in update
    bench.setup.requirements()
    File “/usr/local/lib/python3.6/dist-packages/bench/utils/render.py”, line 95, in wrapper_fn
    return fn(*args, **kwargs)
    File “/usr/local/lib/python3.6/dist-packages/bench/bench.py”, line 341, in requirements
    App(app, bench=self.bench, to_clone=False).install()
    File “/usr/local/lib/python3.6/dist-packages/bench/utils/render.py”, line 110, in wrapper_fn
    return fn(*args, **kwargs)
    File “/usr/local/lib/python3.6/dist-packages/bench/app.py”, line 193, in install
    app=app_name, bench_path=self.bench.name, verbose=verbose, skip_assets=skip_assets,
    File “/usr/local/lib/python3.6/dist-packages/bench/app.py”, line 412, in install_app
    bench.run(f"{bench.python} -m pip install {quiet_flag} --upgrade -e {app_path} {cache_flag}")
    File “/usr/local/lib/python3.6/dist-packages/bench/bench.py”, line 43, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd)
    File “/usr/local/lib/python3.6/dist-packages/bench/utils/init.py”, line 126, in exec_cmd
    raise CommandFailedError
    bench.exceptions.CommandFailedError

Try updating your Python version to 3.8 or above

The python upgrade broke the bench.

What would be the fix ?

Hi ,

Do any bench commands work? For example: bench version or bench migrate-env python3.8 ?

Nop. No bench commands work.
Thanks

Try pip3 check frappe-bench and apt-cache policy python3.8-dev

frappe@ubuntu:~/frappe-bench$ pip3 check frappe-bench and apt-cache policy python3.8-dev
bench 5.0.0 has requirement Jinja2==2.10.3, but you have jinja2 2.11.3.
frappe@ubuntu:~/frappe-bench$

What would be best steps for upgrading python 3.6 to 3.8 and migrating the ERPNext to the new python ?

I have snapshots of my ERPNext so I can try it all over again.

Thanks

Generally one would remove python3.6 and python3.6-dev and install the python3.8 equivalents , then bench migrate-env and update. Since your bench appears broken you could try sudo -H pip3 install frappe-bench and proceed from there after upgrading python3. Once you have a working bench you can concentrate on getting ERPNext working again.

Hi @giga

You can follow this …similar to the error you had received…which was posted yesterday in Github

Though in the last step… instead of installing frappe and erpnext… in your case it could be just

bench update --reset

Didn’t work I got this

frappe@ubuntu:~/frappe-bench$ sudo -H pip install frappe-bench
Requirement already satisfied: frappe-bench in /usr/local/lib/python3.6/dist-packages (5.7.5)
Requirement already satisfied: semantic-version~=2.8.2 in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (2.8.2)
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (2.22.0)
Requirement already satisfied: python-crontab~=2.4.0 in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (2.4.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (40.8.0)
Requirement already satisfied: honcho in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (1.0.1)
Requirement already satisfied: virtualenv in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (16.6.0)
Requirement already satisfied: Jinja2~=2.11.3 in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (2.11.3)
Requirement already satisfied: Click in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (7.0)
Requirement already satisfied: GitPython~=2.1.15 in /usr/local/lib/python3.6/dist-packages (from frappe-bench) (2.1.15)
Requirement already satisfied: gitdb2<3,>=2 in /usr/local/lib/python3.6/dist-packages (from GitPython~=2.1.15->frappe-bench) (2.0.6)
Requirement already satisfied: smmap2>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from gitdb2<3,>=2->GitPython~=2.1.15->frappe-bench) (3.0.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from Jinja2~=2.11.3->frappe-bench) (1.1.1)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.6/dist-packages (from python-crontab~=2.4.0->frappe-bench) (2.8.1)
Requirement already satisfied: smmap>=3.0.1 in /usr/local/lib/python3.6/dist-packages (from smmap2>=2.0.0->gitdb2<3,>=2->GitPython~=2.1.15->frappe-bench) (3.0.4)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/dist-packages (from python-dateutil->python-crontab~=2.4.0->frappe-bench) (1.12.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/lib/python3/dist-packages (from requests->frappe-bench) (1.22)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3/dist-packages (from requests->frappe-bench) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/lib/python3/dist-packages (from requests->frappe-bench) (2.6)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->frappe-bench) (2018.1.18)
WARNING: You are using pip version 20.3.3; however, version 21.3.1 is available.
You should consider upgrading via the ‘/usr/bin/python3 -m pip install --upgrade pip’ command.

This solution didn’t work for me. I got more complicated Erros. It seems like now it wants me to install new version of pip

It doesn’t migrate bench to the new python 3.8

in a terminal what does: python3 -V return?

Python 3.6.9

Try: sudo apt remove python3.6 python3.6-dev
sudo apt install python3.8 python3.8-dev
then
sudo pip3 install pip --upgrade
sudo -H pip3 install frappe-bench

Hi Smino,
Here is the outcomes: (remove/install went good)

frappe@ubuntu:~$ sudo pip3 install pip --upgrade
Traceback (most recent call last):
File “/usr/local/bin/pip3”, line 7, in
from pip._internal.cli.main import main

frappe@ubuntu:~/frappe-bench$ sudo -H pip3 install frappe-bench
Traceback (most recent call last):
File “/usr/local/bin/pip3”, line 7, in
from pip._internal.cli.main import main
ModuleNotFoundError: No module named ‘pip’

I am also facing this issue, Now how to restore my backup and how to fix this issue.
Thanks