coldfix / certbot-dns-netcup

netcup DNS Authenticator plugin for Certbot
Other
50 stars 6 forks source link

Unexpected Keyword 'type' #11

Closed hikkoiri closed 3 years ago

hikkoiri commented 3 years ago

Hi guys & girls,

I was using your example script to obtain my own certificate using this authenticator. Unfortunately I ran into the following error message:

2021-05-02 20:35:48,901:DEBUG:lexicon.providers.netcup:login({})
2021-05-02 20:35:48,904:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): ccp.netcup.net:443
2021-05-02 20:35:49,056:DEBUG:urllib3.connectionpool:https://ccp.netcup.net:443 "POST /run/webservice/servers/endpoint.php?JSON HTTP/1.1" 200 227
2021-05-02 20:35:49,059:DEBUG:lexicon.providers.netcup:infoDnsZone({'domainname': 'carlo-hildebrandt.de'})
2021-05-02 20:35:49,061:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): ccp.netcup.net:443
2021-05-02 20:35:49,235:DEBUG:urllib3.connectionpool:https://ccp.netcup.net:443 "POST /run/webservice/servers/endpoint.php?JSON HTTP/1.1" 200 246
2021-05-02 20:35:49,239:DEBUG:certbot._internal.error_handler:Encountered exception:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/certbot/_internal/auth_handler.py", line 70, in handle_authorizations
    resps = self.auth.perform(achalls)
  File "/usr/lib/python3.9/site-packages/certbot/plugins/dns_common.py", line 60, in perform
    self._perform(domain, validation_domain_name, validation)
  File "/usr/local/lib/python3.9/site-packages/certbot_dns_netcup.py", line 58, in _perform
    self._get_netcup_client().add_txt_record(
  File "/usr/lib/python3.9/site-packages/certbot/plugins/dns_common_lexicon.py", line 48, in add_txt_record
    self.provider.create_record(type='TXT', name=record_name, content=record_content)
TypeError: create_record() got an unexpected keyword argument 'type'

The program aborted and I did not obtain any certificates. The shown message indicates an internal error in the lexicon library. But I am not sure if that error is caused by a bug in the library implementation or by the way it is integrated into this project. Can you help me identifying the root of all evil?

I am running on a fedora machine with certbot 1.14.0 and certbot-dns-netcup 1.1.0 installed.

Already thanks in advance! Best regards

coldfix commented 3 years ago

HI,

many thanks for reporting!

This results from an incompatibility of certbot with lexicon >= v3.6.0. I have created a bugfix that should resolve this issue, see certbot/certbot#8819.

Until this is integrated in certbot, try downgrading lexicon to 3.5:

pip install dns-lexicon==3.5

This should turn the TypeError into a harmless DeprecationWarning.

hikkoiri commented 3 years ago

Perfect, thank you very much :) Also for creating the PR and giving me an alternative solution.

szenti commented 3 years ago

The workaround should rather be the following:

pip install dns-lexicon==3.5
hikkoiri commented 3 years ago

Yes, also recognized that something is wrong a moment ago, when I got this error message:

ERROR: Could not find a version that satisfies the requirement lexicon==3.5

Thanks @szenti for the quickfix :)

coldfix commented 3 years ago

Oops, sorry! :)

coldfix commented 3 years ago

Just FYI, this is now fixed with certbot v1.16.

dMopp commented 1 year ago

Still an issue with the debian shipped 1.12 but workarround works fine, thanks :)