Failed to renew certificate camping-de-kluis.nl with error: type object 'ClientV2' has no attribute 'get_directory'

My domain is: camping-de-kluis.nl

I ran this command: certbot renew
It produced this output: Failed to renew certificate camping-de-kluis.nl with error: type object 'ClientV2' has no attribute 'get_directory'

My web server is (include version): apache 2.4.54-5

The operating system my web server runs on is (include version): Debian testing

My hosting provider, if applicable, is: NA

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): None

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 2.1.0

2022-12-29 11:41:25,625:DEBUG:certbot._internal.renewal:Traceback was:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/certbot/_internal/renewal.py", line 524, in handle_renewal_request
main.renew_cert(lineage_config, plugins, renewal_candidate)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 1538, in renew_cert
le_client = _init_le_client(config, auth, installer)
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 832, in _init_le_client
return client.Client(config, acc, authenticator, installer, acme=acme)
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 297, in init
acme = acme_from_config_key(config, self.account.key, self.account.regr)
File "/usr/lib/python3/dist-packages/certbot/_internal/client.py", line 72, in acme_from_config_key
directory = acme_client.ClientV2.get_directory(config.server, net)
AttributeError: type object 'ClientV2' has no attribute 'get_directory'

Hi @GieltjE-FYN, and welcome to the LE community forum :slight_smile:

How did you install certbot?

Also, there seems to be an unrelated problem with IPv6 access to your site:

curl -Ii6 camping-de-kluis.nl
curl: (56) Recv failure: Connection reset by peer
4 Likes

apt-get install curl, has been functioning fine for the past few years.

The ipv6 issue is strange, when I perform it from a different data center it is fine:

curl -Ii6 https://camping-de-kluis.nl
HTTP/2 200
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
link: https://camping-de-kluis.nl/wp-json/; rel="https://api.w.org/", https://camping-de-kluis.nl/wp-json/wp/v2/pages/16; rel="alternate"; type="application/json", https://camping-de-kluis.nl/; rel=shortlink
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
expect-ct: max-age=300, report-uri="https://expectct.fyn.nl"
strict-transport-security: max-age=31536000; includeSubDomains; preload
set-cookie: campingdekluis=k59v34t0341vp84rpqpot3c1ns; path=/;HttpOnly;HttpOnly;Secure
referrer-policy: strict-origin-when-cross-origin
x-frame-options:
content-type: text/html; charset=UTF-8
date: Thu, 29 Dec 2022 11:13:02 GMT
server: Apache

apt-get install certbot ???

That may be at this end...

4 Likes

apt-get install certbot indeed, my bad, being a bit overrun with work.

1 Like

Try these instructions instead:
Certbot Instructions | Certbot (eff.org)

5 Likes

ClientV2.get_directory was added in certbot 2.0.0 and acme 2.0.0. There seems to be a version conflict between the two packages: somehow your Certbot is version 2.0.0 or newer, but your acme package is older than 2.0.0.

6 Likes

Sorry, it was a problem at my end.
It now looks fine:

curl -Ii6 camping-de-kluis.nl
HTTP/1.1 301 Moved Permanently
Date: Thu, 29 Dec 2022 12:48:35 GMT
Server: Apache
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Location: https://camping-de-kluis.nl/
Content-Type: text/html; charset=iso-8859-1
6 Likes

pip3 somehow had acme installed, removed it, reinstalled the debian one and all is fine now.

Thanks for the support :slight_smile:

4 Likes

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