One of my cloud server is an amazon linux instance with certbot installed for letsencrypt certificates. Unfortunately, certbot is not fully supported in amazon linux and the suggestion is to run certbot in --debug mode
I was quite successful for around an year to renew certifiates without much problems. But, not today
I started the ritual by running the following command. sudo is needed as certbot needs to have more control to modify, edit files, start & stop servers
Bam! Greeted with this cryptic (for me) error
Ok, I don't understand what I can do about certbot not able to get currently installed version. But the last line gave the clue. After some googling I found that cryptography package is missing! But how did it work the last time (3 months before)? I still do not know
Amazon linux instance comes installed with python 2.7 and based on the error, I went ahead and installed the cryptography package. But, it did not fix the issue. This is where it got super confusing
After breaking my head with google for a very long time, I realized that certbot will not use the default python installation but downloads its own copy to this location
After installing the cryptography package for this python, things started to look bright.
It did not work, but it atleast showed a different error message :)
This time it is zope.interface package. Again, I have no clue how it is gone
After this, I was able to get the certificate renewed from letsencrypt.
Was one hell of a ride. But, with a happy ending! :)