My AWS EC2 Ubuntu 22.04 box is generating the following errors when trying to renew the certificate for the mail hosting domain: office.sucofa.com All other certificates e.g. autoconfig.sucofa.com are renewing without problem. The following message is generated:
Traceback (most recent call last):
File “/root/mailinabox/management/ssl_certificates.py”, line 683, in
provision_certificates_cmdline()
File “/root/mailinabox/management/ssl_certificates.py”, line 395, in provision_certificates_cmdline
status = provision_certificates(env, limit_domains=domains)
File “/root/mailinabox/management/ssl_certificates.py”, line 371, in provision_certificates
ret.extend(post_install_func(env))
File “/root/mailinabox/management/ssl_certificates.py”, line 481, in post_install_func
if cert and os.readlink(system_ssl_certificate) != cert[‘certificate’]:
OSError: [Errno 22] Invalid argument: ‘/home/user-data/ssl/ssl_certificate.pem’
Before restoring the server when I moved to v60, I deleted /home/user-data/ssl/.
DNS hosting is with Cloudflare. The website for this domain (sucofa.com and www.sucofa.com) are on another machine.
Thanks again for you help!
I tried these and have the same result. As root user, I even tried chown -R root:root /home/user-data/ssl/ which made all the contents of the directory root:root (some files were ubuntu:ubuntu).
Something seems wrong with Letsencrypt. The directory /etc/letsencrypt/live is empty. Perhaps Letsencrypt is setup differently in MIAB compared to an Apache website? I would normally expect to see the domain and sub-domains that have issued certificates there.
If I run ‘sudo certbot certificates’ the response is “No certificates found”. Strange?
Rerun sudo mailinabox which should reinstall LE. But first, delete the contents of the /home/user-data/ssl/ directory … at the point you are at the directory should be empty, so I am not sure what contents you are referring to when you mention that the ownership of the files is root:root.
Saving debug log to /var/log/letsencrypt/letsencrypt.log You should register before running non-interactively, or provide --agree-tos and --email <email_address> flags. Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.Processing: letsencrypt_log.txt…
Is there a convenient way for me to upload the letsencrypt log file for you to see?
I think I have it sorted out now. My instance of Ubuntu had Certbot installed. I have purged that and deleted the ssl directory and re-ran Mailinbox. The certificates have provisioned correctly now.