Lets-encrypt-no-longer-works-from-bench-setup from centos 7

lets encrypt no longer works from bench setup from Centos 7 stack on creating the environment and then stop.

Can you share the traceback?

Update: ok I retried on Ubuntu 18.04, worked a breeze.


I too just experienced this.

[bench@system erpnext]$ sudo bench setup lets-encrypt subdomain.mydomain.org
Running this will stop the nginx service temporarily causing your sites to go offline
Do you want to continue? [y/N]: y
INFO:bench.utils:sudo systemctl stop nginx
INFO:bench.utils:/opt/certbot-auto  --config /etc/letsencrypt/configs/subdomain.mydomain.org.cfg certonly
Bootstrapping dependencies for RedHat-based OSes... (you can skip this with --no-bootstrap)
yum is /bin/yum
yum is hashed (/bin/yum)
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * epel: epel.mirror.wearetriple.com
Package gcc-4.8.5-28.el7_5.1.x86_64 already installed and latest version
Package augeas-libs-1.4.0-5.el7_5.1.x86_64 already installed and latest version
Package 1:openssl-1.0.2k-12.el7.x86_64 already installed and latest version
Package 1:openssl-devel-1.0.2k-12.el7.x86_64 already installed and latest version
Package libffi-devel-3.0.13-18.el7.x86_64 already installed and latest version
Package redhat-rpm-config-9.1.0-80.el7.centos.noarch already installed and latest version
Package ca-certificates-2018.2.22-70.0.el7_5.noarch already installed and latest version
Package python-devel-2.7.5-68.el7.x86_64 already installed and latest version
Package python-virtualenv-15.1.0-2.el7.noarch already installed and latest version
Package python-tools-2.7.5-68.el7.x86_64 already installed and latest version
Package python2-pip-8.1.2-6.el7.noarch already installed and latest version
Nothing to do
Creating virtual environment...
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 2327, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 944, in create_environment
    download=download,
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 900, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 - setuptools pip wheel failed with error code 1
INFO:bench.utils:sudo systemctl start nginx
There was a problem trying to setup SSL for your site

This is on CentOS 7.5, and I’ve followed this guide: https://www.vultr.com/docs/how-to-install-erpnext-open-source-erp-on-centos-7

Mee too having the same problem. Any workarounds?

This was let’s encrypt issue Certbot has problem setting up the virtual environment - Help - Let's Encrypt Community Support

It has been fixed now.

1 Like

My workaround is this:

bench config dns_multitenant on
sudo certbot certonly --nginx
bench setup add-domain {YOUR DOMAIN NAME} \
	--ssl-certificate /etc/letsencrypt/live/{YOUR DOMAIN NAME}/fullchain.pem \
	--ssl-certificate-key /etc/letsencrypt/live/{YOUR DOMAIN NAME}/privkey.pem
sudo bench setup nginx
sudo service nginx reload

(Make sure that the frappe user has read access to /etc/letsencrypt/live/.)

1 Like