Certbot fails with a codec error

Please fill out the fields below so we can help you better.

My domain is: www.cloudstormllc.com

I ran this command: sudo certbot certonly --manual

It produced this output:
Traceback (most recent call last):
File “/usr/local/bin/certbot”, line 11, in
load_entry_point(‘certbot==0.8.1’, ‘console_scripts’, ‘certbot’)()
File “/usr/local/Cellar/certbot/0.8.1/libexec/lib/python2.7/site-packages/certbot/main.py”, line 717, in main
setup_logging(config, _cli_log_handler, logfile=‘letsencrypt.log’)
File “/usr/local/Cellar/certbot/0.8.1/libexec/lib/python2.7/site-packages/certbot/main.py”, line 631, in setup_logging
cli_handler = cli_handler_factory(config, level, fmt)
File “/usr/local/Cellar/certbot/0.8.1/libexec/lib/python2.7/site-packages/certbot/main.py”, line 618, in _cli_log_handler
handler = log.DialogHandler()
File “/usr/local/Cellar/certbot/0.8.1/libexec/lib/python2.7/site-packages/certbot/log.py”, line 29, in init
self.d = dialog.Dialog() if d is None else d
File “/usr/local/Cellar/certbot/0.8.1/libexec/lib/python2.7/site-packages/dialog.py”, line 1015, in init
self._dialog_prg = _path_to_executable(dialog)
File “/usr/local/Cellar/certbot/0.8.1/libexec/lib/python2.7/site-packages/dialog.py”, line 476, in _path_to_executable
res = _find_in_path(f)
File “/usr/local/Cellar/certbot/0.8.1/libexec/lib/python2.7/site-packages/dialog.py”, line 441, in _find_in_path
for d in PATH.split(":"):

My operating system is (include version): OsX Sierra v. 10.12.3

My web server is (include version): Nginx (provided by Heroku)

My hosting provider, if applicable, is: Heroku

I can login to a root shell on my machine (yes or no, or I don’t know): Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): No

I thought some additional background would be helpful.

I installed certbot using HomeBrew (brew install certbot). Certbot 0.8.1 was successfully installed. However, when I ran the command sudo certbot certonly --manual the certbot client failed during execution. I then tried a different macbook and everything worked fine.

The fact I was able to install certbot on one macbook and not the other (both running Sierra) leads me to believe I have an issue with my python environments and/or openssl. Thus, I created a virtual environment using python 2.7 with the same result. I then tried a python 3.5 virtual environment…same result. My next step was to clone the certbot github repo and run install.py (from within a venv). Still the same result.

Normally such an issue has to do with a unicode character that can’t be properly translated. However, in this case I’m not doing anything unique; simply running the certbot command to generate a cert only with no domain specified.

Any help, thoughts, suggestions, etc. will be greatly appreciated. I was able to successfully generate a certificate and add it to my Heroku application so that’s a good thing, but I prefer to use my personal macbook for these types of things (personal website).

Okay…I managed to resolve the issue on my own. I’ll post the steps so others may benefit from the lessons learned.

  1. Create a virtual environmnet: virtualenv --no-site-packages -p /usr/bin/python venv2
  2. Clone Certbot: git clone https://github.com/certbot/certbot
  3. Change to the certbot repo: cd certbot
  4. Activate the virtual environment: …/venv2/bin/activate
  5. Install docs(?): pip install -e .[docs]
  6. Install dependencies: pip install --no-cache-dir -e acme -e . -e certbot-apache -e certbot-nginx
  7. Not sure if this is required: pip install hashin
  8. Run setup.py: python setup.py install
  9. Run the certbot client: sudo certbot certonly --manual
  10. Client launches; follow the prompts/commands and your certs will be generated.

I hope this helps someone one.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.