AttributeError: module 'brotli' has no attribute 'error'

I ran this command: certbot --nginx

It produced this output:

Traceback (most recent call last):
  File "/snap/certbot/4325/bin/certbot", line 5, in <module>
    from certbot.main import main
  File "/snap/certbot/4325/lib/python3.12/site-packages/certbot/main.py", line 6, in <module>
    from certbot._internal import main as internal_main
  File "/snap/certbot/4325/lib/python3.12/site-packages/certbot/_internal/main.py", line 23, in <module>
    from acme import client as acme_client
  File "/snap/certbot/4325/lib/python3.12/site-packages/acme/client.py", line 22, in <module>
    import requests
  File "/snap/certbot/4325/lib/python3.12/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/snap/certbot/4325/lib/python3.12/site-packages/urllib3/__init__.py", line 13, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "/snap/certbot/4325/lib/python3.12/site-packages/urllib3/connectionpool.py", line 41, in <module>
    from .response import HTTPResponse
  File "/snap/certbot/4325/lib/python3.12/site-packages/urllib3/response.py", line 163, in <module>
    class HTTPResponse(io.IOBase):
  File "/snap/certbot/4325/lib/python3.12/site-packages/urllib3/response.py", line 396, in HTTPResponse
    DECODER_ERROR_CLASSES += (brotli.error,)

Im using: Debian 12, certboot installed via snap

Even when I try to find out the version via certbot --version I get the same error. I already tried uninstalling and reinstalling certbot via snap, but that didn't help. Apt update && apt upgrade performed.

Everything was working without problems for a while, but today I decided to add a sub.domain to my site and encountered this problem.

Please help.

Sorry no one replied for 2 days.

It is very unusual that sudo certbot --version would fail. And, you said you tried both the apt version of Certbot package and the snap version. Do I understand that correctly? Because something must be very unusual with your system for both to fail the same way.

That traceback from the log is not very helpful unless that is the only info shown. Would you show console output of these two commands?

sudo whereis certbot
sudo certbot --version
3 Likes

7 posts were split to a new topic: Certbot snap brotli error

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