Sudden bench update fail

I do regular updates on the about week basis.
Today attempt to update suddenly failed:
frappe@erpnext:~/frappe-bench$ bench update
Backing up sites…
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version
of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
INFO:bench.app:pulling frappe
$ git pull upstream version-11
From https://github.com/frappe/frappe

  • branch version-11 -> FETCH_HEAD
    Already up-to-date.
    $ find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    $ git pull upstream version-11
    From https://github.com/frappe/erpnext
  • branch version-11 -> FETCH_HEAD
    Already up-to-date.
    $ find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext_demo
    $ git pull upstream master
    From https://github.com/frappe/erpnext_demo
  • branch master -> FETCH_HEAD
    Already up-to-date.
    $ find . -name “*.pyc” -delete
    Updating Python libraries…
    $ /home/frappe/frappe-bench/env/bin/pip install -q -U pip
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version
    of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
    utils.DeprecatedIn23,
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details
    about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    INFO:bench.app:installing frappe
    $ /home/frappe/frappe-bench/env/bin/pip install -q -U -e /home/frappe/frappe-bench/apps/frappe
    /home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version
    of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
    utils.DeprecatedIn23,
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details
    about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    ERROR: Exception:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py”, line 188, in _main
    status = self.run(options, args)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/cli/req_command.py”, line 185, in wrapper
    return func(self, options, args)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/commands/install.py”, line 333, in run
    reqs, check_supported_wheels=not options.target_dir
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 179, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 362, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 314, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py”, line 431, in prepare_linked_requirement
    req, self.req_tracker, self.finder, self.build_isolation,
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py”, line 85, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py”, line 38, in prepare_distribution_metadata
    self._setup_isolation(finder)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py”, line 96, in _setup_isolation
    reqs = backend.get_requires_for_build_wheel()
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py”, line 161, in get_requires_for_build_wheel
    ‘config_settings’: config_settings
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py”, line 265, in _call_hook
    raise BackendUnavailable(data.get(‘traceback’, ‘’))
    BackendUnavailable

=======================================================

Any help will be highly appreciated…:slight_smile:
Also an old outstanding question - how the “deprecated” warning may be solved.
Again - many thanks ahead!

The support for python2.7 is over… you should consider migrating to python3
bench migrate-env python3. Do take backups before hand.

Thanks, mujeerhashmi, for your reply. But:

frappe@erpnext:~/frappe-bench$ bench migrate-env python3
DEBUG:bench.utils:Clearing Redis Cache…
$ /usr/bin/redis-cli -p 13000 FLUSHALL
Could not connect to Redis at 127.0.0.1:13000: Connection refused
DEBUG:bench.utils:Clearing Redis DataBase…
$ /usr/bin/redis-cli -p 13000 FLUSHDB
Could not connect to Redis at 127.0.0.1:13000: Connection refused
DEBUG:bench.utils:Backing up Virtual Environment
DEBUG:bench.utils:Setting up a New Virtual /usr/bin/python3 Environment
$ /usr/local/bin/virtualenv --python /usr/bin/python3 /home/frappe/frappe-bench/env
Running virtualenv with interpreter /usr/bin/python3
Using base prefix ‘/usr’
New python executable in /home/frappe/frappe-bench/env/bin/python3
Also creating executable in /home/frappe/frappe-bench/env/bin/python
Installing setuptools, pip, wheel…
done.
$ /home/frappe/frappe-bench/env/bin/pip install -q -U -e apps/frappe -e apps/erpnext -e apps/erpnext_demo
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won’t be maintained after March 2019 (cf PEP 429).
ERROR: Could not find a version that satisfies the requirement Jinja2==2.11.1 (from frappe==11.1.67) (from versions: 2.0rc1, 2.0, 2.1, 2.1.1, 2.2, 2.2.1, 2.3, 2.3.1, 2.4, 2.4.1, 2.5, 2.5.1, 2.5.2, 2.5.3, 2.5.4
, 2.5.5, 2.6, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.8, 2.8.1, 2.9, 2.9.1, 2.9.2, 2.9.3, 2.9.4, 2.9.5, 2.9.6, 2.10, 2.10.1, 2.10.2, 2.10.3)
ERROR: No matching distribution found for Jinja2==2.11.1 (from frappe==11.1.67)
DEBUG:bench.utils:Migration Successful to /usr/bin/python3

And manual update of Jinja2 to 2.11… did not help too. :frowning:

And still, the main question remains: why does the bench update fails?

If this is a development environment then you need to run bench start in a terminal and in the other terminal run bench update.

This is the virtual machine I run for 2 years already and doing “bench update” always worked smoothly.

bench setup requirements should install all the dependencies.

No luck :frowning:

frappe@erpnext:~/frappe-bench$ bench setup requirements
Updating Python libraries…
$ ./env/bin/pip install -q -U pip
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
INFO:bench.app:installing frappe
$ ./env/bin/pip install -q -U -e ./apps/frappe
/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Exception:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py”, line 188, in _main
status = self.run(options, args)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/cli/req_command.py”, line 185, in wrapper
return func(self, options, args)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/commands/install.py”, line 333, in run
reqs, check_supported_wheels=not options.target_dir
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 179, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 362, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py”, line 314, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py”, line 431, in prepare_linked_requirement
req, self.req_tracker, self.finder, self.build_isolation,
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/operations/prepare.py”, line 85, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py”, line 38, in prepare_distribution_metadata
self._setup_isolation(finder)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_internal/distributions/sdist.py”, line 96, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py”, line 161, in get_requires_for_build_wheel
‘config_settings’: config_settings
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/pep517/wrappers.py”, line 265, in _call_hook
raise BackendUnavailable(data.get(‘traceback’, ‘’))
BackendUnavailable