[GH-ISSUE #1119] Certbot DNS challenge error: unexpected keyword argument 'type' #924

Closed
opened 2026-02-26 06:34:58 +03:00 by kerem · 4 comments
Owner

Originally created by @drx1x2 on GitHub (May 24, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1119

TypeError: create_record() got an unexpected keyword argument 'type'
Please see the logfiles in /var/log/letsencrypt for more details.

[5/24/2021] [9:03:31 AM] [Nginx ] › ℹ info Reloading Nginx
[5/24/2021] [9:03:31 AM] [Express ] › ⚠ warning Command failed: /opt/certbot/bin/certbot certonly --non-interactive --cert-name "npm-10" --agree-tos --email "mymail@gmail.com" --domains "domain" --authenticator dns-luadns --dns-luadns-credentials "/etc/letsencrypt/credentials/credentials-10" --dns-luadns-propagation-seconds 120

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator dns-luadns, Installer None
Performing the following challenges:
dns-01 challenge for domain.com
Cleaning up challenges
Encountered exception during recovery: TypeError: delete_record() got an unexpected keyword argument 'type'
An unexpected error occurred:

need help

Originally created by @drx1x2 on GitHub (May 24, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1119 TypeError: create_record() got an unexpected keyword argument 'type' Please see the logfiles in /var/log/letsencrypt for more details. [5/24/2021] [9:03:31 AM] [Nginx ] › ℹ info Reloading Nginx [5/24/2021] [9:03:31 AM] [Express ] › ⚠ warning Command failed: /opt/certbot/bin/certbot certonly --non-interactive --cert-name "npm-10" --agree-tos --email "mymail@gmail.com" --domains "domain" --authenticator dns-luadns --dns-luadns-credentials "/etc/letsencrypt/credentials/credentials-10" --dns-luadns-propagation-seconds 120 Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator dns-luadns, Installer None Performing the following challenges: dns-01 challenge for domain.com Cleaning up challenges Encountered exception during recovery: TypeError: delete_record() got an unexpected keyword argument 'type' An unexpected error occurred: need help
kerem 2026-02-26 06:34:58 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@chaptergy commented on GitHub (May 24, 2021):

This was an issue with certbot. There is nothing we can do about that. A new version of certbot with a fix is now available, so you will need to update your npm image with docker-compose pull and then start the container back up. Or you can manually update certbot inside the container with pip install certbot --upgrade.

<!-- gh-comment-id:846843724 --> @chaptergy commented on GitHub (May 24, 2021): This was an [issue with certbot](https://github.com/certbot/certbot/pull/8819). There is nothing we can do about that. A new version of certbot with a fix is now available, so you will need to update your npm image with `docker-compose pull` and then start the container back up. Or you can manually update certbot inside the container with `pip install certbot --upgrade`.
Author
Owner

@gitmors commented on GitHub (May 30, 2021):

Fix the file .../certbot/plugins/dns_common_lexicon.py

Change the argument name type with rtype line 48 :

    self.provider.create_record(rtype='TXT', name=record_name, content=record_content)

and line 70 :

    self.provider.delete_record(rtype='TXT', name=record_name, content=record_content)
<!-- gh-comment-id:850954344 --> @gitmors commented on GitHub (May 30, 2021): Fix the file .../certbot/plugins/dns_common_lexicon.py Change the argument name type with rtype line 48 : self.provider.create_record(rtype='TXT', name=record_name, content=record_content) and line 70 : self.provider.delete_record(rtype='TXT', name=record_name, content=record_content)
Author
Owner

@spennell commented on GitHub (Jun 3, 2021):

I can confirm @gitmors solution works. I was facing a similar issue when trying to configure certs for DNSimple.

<!-- gh-comment-id:853550900 --> @spennell commented on GitHub (Jun 3, 2021): I can confirm @gitmors solution works. I was facing a similar issue when trying to configure certs for DNSimple.
Author
Owner

@Trollwut commented on GitHub (Jun 8, 2021):

Hey mates!

Can confirm that this solution also works for me. So yes, we have to wait for certbot having this fixed, but as a workaround, one can do it quite simply.

Just adding this information for newcomers with the same problem.

If you have your NPM dockered, go into your container like this:

docker-compose exec nginx-proxy bash

Then you might need some kind of text editor, install it like:

apt update && apt install vim

Substitute with your editor of choice.

Then locate the certbot library and open that file in your text editor (check the folder twice, it might have another location for you):

vim /opt/certbot/lib/python3.7/site-packages/certbot/plugins/dns_common_lexicon.py

(If it's not there, you can check for its location with command find / -type f -name "dns_common_lexicon.py")

In this file, edit it like @gitmors told us in this comment.

Save and exit.

It should be working by now. But it could be that your certbot has exited due to the error and hasn't deleted it's lockfiles (which will prevent it from running again).

You can see if you have lock files on your system:

find / -type f -name ".certbot.lock" -exec rm {} \;

Please doublecheck if only files are listed that you really don't want!

You can delete them with that:

find / -type f -name ".certbot.lock" -exec rm {} \;

Now, exit your docker shell, go to NPM webpage and try to get your new DNS certificate. :)

<!-- gh-comment-id:856637167 --> @Trollwut commented on GitHub (Jun 8, 2021): Hey mates! Can confirm that this solution also works for me. So yes, we have to wait for `certbot` having this fixed, but as a workaround, one can do it quite simply. Just adding this information for newcomers with the same problem. If you have your NPM dockered, go into your container like this: docker-compose exec nginx-proxy bash Then you might need some kind of text editor, install it like: apt update && apt install vim Substitute with your editor of choice. Then locate the `certbot` library and open that file in your text editor (check the folder twice, it might have another location for you): vim /opt/certbot/lib/python3.7/site-packages/certbot/plugins/dns_common_lexicon.py *(If it's not there, you can check for its location with command `find / -type f -name "dns_common_lexicon.py"`)* In this file, edit it like @gitmors told us in [this comment](https://github.com/jc21/nginx-proxy-manager/issues/1119#issuecomment-850954344). Save and exit. It should be working by now. But it *could* be that your `certbot` has exited due to the error and hasn't deleted it's lockfiles (which will prevent it from running again). You can see if you have lock files on your system: find / -type f -name ".certbot.lock" -exec rm {} \; **Please doublecheck if only files are listed that you really don't want!** You can delete them with that: find / -type f -name ".certbot.lock" -exec rm {} \; Now, exit your docker shell, go to NPM webpage and try to get your new DNS certificate. :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#924
No description provided.