Upgrade to Ubuntu 17.10

Hello everyone,

today was upgrade day and I just wanted to share the problems I faced in my development environment in case anyone gets the same error :slight_smile:

I was getting the error:

ImportError: cannot import name ‘_remove_dead_weakref’

And the solution was to rebuild the virtualenvironment:

rm -Rf env/
virtualenv -q env -p /usr/bin/python
./env/bin/pip -q install --upgrade pip
./env/bin/pip -q install wheel
./env/bin/pip -q install six
./env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
source env/bin/activate.fish 
pip install -q  -e apps/frappe --no-cache-dir
pip install -q  -e apps/erpnext --no-cache-dir
pip install -r ../.bench/requirements.txt 
bench update --requirements
bench start

Happy coding!


We updated Ubuntu 18.04 server and now we’re facing the same issue on ssl certificate renewal. Before we had faced many issues which we manually solved, like libssl was upgraded too, wkhtml2pdf was also upgraded.

Now only issue let is ssl certificate renewal. when I run
sudo service nginx stop && sudo /opt/certbot-auto renew && sudo service nginx start

I get the following error.

 sudo service nginx stop && sudo /opt/certbot-auto renew && sudo service nginx start
Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt: 
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py", line 6, in <module>
    import logging.handlers
  File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
    import sys, os, time, cStringIO, traceback, warnings, weakref, collections
  File "/usr/lib/python2.7/weakref.py", line 14, in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

Can anyone advice on this?

A LetsEncrypt forum search on the above offers these that may help?

1 Like

Thanks for the reference. I will try this and inform how it goes.

Thank @clarkej
This Solved my issue.
First, I’d tried running sudo mv /opt/eff.org /opt/old-eff and running sudo bench setup lets-encrypt [site-name]again.

That’s good news, thanks for the follow up @fkardame. So deleting that directory uninstalled lets-encrypt and you just reinstalled and problem solved.