Hi All,
I think the issue was because bench uses virtualenv v16.x while Certbot script needs virtualenv v15.x to work in case it was run using Python 2. So I fixed the issue in two ways:
Uninstalled virtualenv V16 and ran the certbot-script from the original path
sudo /opt/certbot-auto --renew
In this case, I had to configure the nginx.conf file and set the auto renewal in cron job.
The other way is to force the certbot to be run using Python3 as per the following steps:
cd /opt/
sudo wget https://dl.eff.org/certbot-auto
USE_PYTHON_3=1 /opt/certbot-auto --version //this command will create the venv using python 3
Then using the sudo user while in bench directory
sudo -H bench setup lets-encrypt erp.domain.com
P.S. If you already run the certbot script using python2, you will need to delete the eff.org before doing this fix.
I don’t know if my explanation is totally true. At least the issue is fixed at my end.
Thank you anyway.