Bench Update failing on Yarn install

Every time I try running bench update I get this:


I’ve tried running sudo bench update as most people suggest when this error occurs, but I still get the same result. This is ERPNext v7.1.23 and Frappe v7.1.24 running on a VM. Can the installation of Yarn just be bypassed?

try this How to update from v10 to V11 - #42 by abidomar

For bench update you don’t need “sudo” - and often, adding in sudo will shift your environment incorrectly. just run

cd ~/frappe-bench
bench update

If this doesn’t work, often ‘bench update --reset’ will work

Got past the yarn install issue, and I’m now faced with this:

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (3.4.2)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull upstream master
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.app:pulling erpnext_demo
    INFO:bench.utils:git pull upstream master
    From GitHub - frappe/erpnext_demo: Deprecated with Version 7 (will work till v6)
  • branch master → FETCH_HEAD
    Already up-to-date.
    INFO:bench.utils:find . -name “*.pyc” -delete
    INFO:bench.utils:./env/bin/pip install --upgrade pip
    DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
    From cffi callback <function _verify_callback at 0xb626f56c>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pip/
    From cffi callback <function _verify_callback at 0xb626f4c4>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pip/
    From cffi callback <function _verify_callback at 0xb626f924>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pip/
    From cffi callback <function _verify_callback at 0xb62a0614>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pip/
    From cffi callback <function _verify_callback at 0xb626f844>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pip/
    From cffi callback <function _verify_callback at 0xb626f79c>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host=‘pypi.org’, port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)) - skipping
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages (19.0.2)
    INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/bench-repo/requirements.txt
    DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
    INFO:bench.app:installing frappe
    INFO:bench.utils:./env/bin/pip install -q -e ./apps/frappe
    DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
    erpnext 11.1.6 requires gocardless_pro, which is not installed.
    erpnext 11.1.6 requires pandas, which is not installed.
    erpnext 11.1.6 requires pygithub, which is not installed.
    erpnext 11.1.6 requires python-stdnum, which is not installed.
    erpnext 11.1.6 requires woocommerce, which is not installed.
    INFO:bench.app:installing erpnext
    INFO:bench.utils:./env/bin/pip install -q -e ./apps/erpnext
    DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
    From cffi callback <function _verify_callback at 0xb61ecd14>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pygithub/
    From cffi callback <function _verify_callback at 0xb61ec8b4>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pygithub/
    From cffi callback <function _verify_callback at 0xb61ec33c>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pygithub/
    From cffi callback <function _verify_callback at 0xb61ec294>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pygithub/
    From cffi callback <function _verify_callback at 0xb61ec2cc>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLError(“bad handshake: Error([(‘SSL routines’, ‘SSL3_GET_SERVER_CERTIFICATE’, ‘certificate verify failed’)],)”,),)’: /simple/pygithub/
    From cffi callback <function _verify_callback at 0xb61ecaac>:
    Traceback (most recent call last):
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/OpenSSL/SSL.py”, line 309, in wrapper
    _lib.X509_up_ref(x509)
    AttributeError: ‘module’ object has no attribute ‘X509_up_ref’
    Could not find a version that satisfies the requirement pygithub (from erpnext==11.1.6) (from versions: )
    No matching distribution found for pygithub (from erpnext==11.1.6)
    Updating Python libraries…
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 11, in
    load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
    bench_command()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/bench-repo/bench/commands/update.py”, line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
    File “/home/frappe/bench-repo/bench/commands/update.py”, line 76, in _update
    update_requirements(bench_path=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 435, in update_requirements
    install_app(app, bench_path=bench_path)
    File “/home/frappe/bench-repo/bench/app.py”, line 171, in install_app
    find_links=find_links))
    File “/home/frappe/bench-repo/bench/utils.py”, line 159, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: ./env/bin/pip install -q -e ./apps/erpnext

Any help is appreciated.

A lot of SSL errors there - seems like your OS and certificate stores are not up to date.

sudo apt update -y && sudo apt upgrade -y

and then a bench update might help

Just tried your suggestion and after running bench update I get the same error output. If you need any other information to help, let me know.

I can’t say for sure if this will help, but maybe… from this link

npm config set strict-ssl false

I had actually tried that exact command before posting back. It didn’t make a difference for some reason. Any idea what the “AttributeError: ‘module’ object has no attribute ‘X509_up_ref’” errors are referring to?

AttributeError: ‘module’ object has no attribute ‘X509_up_ref’

My take is failed authentication from say a stale cryptography lib version?

Consequently a chicken and egg case - pygithub can’t update libs because of this?

edit: this reference may help Incorrect version of cryptography used during pip install · Issue #5 · erjosito/ansible-azure-lab · GitHub

1 Like

can you share your frappe and erpnext version ?

Before the update, I was at Frappe: 7.1.24 and ERPNext: 7.1.23. But now it’s at Frappe: 11.1.7 and ERPNext 11.1.7.

Can you explain in which command you are stuck ? what is the issue?

The bench update command yields the above result. I’ve made a clone of the VM before the update, so I can start fresh at version 7 again if needed. Also, should I upgrade Ubuntu before upgrading to Frappe v11? I’ve done it with and without upgrading Ubuntu, but had errors both ways.