Getting unittest 2 1.1.0 requires argparse Error


#1

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:
dcps.net

I ran this command:
sudo ./certbot-auto certonly --manual --manual-public-ip-logging-ok --manual-auth-hook “/etc/letsencrypt/lexicon-provider_godaddy.sh create” --manual-cleanup-hook “/etc/letsencrypt/lexicon-provider_godaddy.sh delete” --preferred-challenges dns -d “*.dcps.net” --dry-run

It produced this output:
Error output from lexicon-provider_godaddy.sh:
unittest2 1.1.0 requires argparse, which is not installed.
dns-lexicon 2.2.1 does not provide the extra ‘godaddy’
unittest2 1.1.0 requires argparse, which is not installed


#2

I’ve tried installing argparse but it’s already installed.


#3

@bmw, could you please take a look at this?


#4

Here’s a more complete view of what happens when I do a dry run of the command. I’m trying to run a script from lexicon to update the DNS TXT challenge on GoDaddy.


sudo ./certbot-auto certonly --manual --agree-tos --manual-public-ip-logging-ok --manual-auth-hook “/etc/letsencrypt/lexicon-provider_godaddy.sh create” --manual-cleanup-hook “/etc/letsencrypt/lexicon-provider_godaddy.sh d
delete” --preferred-challenges dns -d ".dcps.net" --dry-run
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Cert not due for renewal, but simulating renewal for dry run
Renewing an existing certificate
Performing the following challenges:
dns-01 challenge for dcps.net
Output from lexicon-provider_godaddy.sh:
Requirement already satisfied: dns-lexicon in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (2.2.1)
Requirement already satisfied: tldextract in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon) (2.2.0)
Requirement already satisfied: future in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon) (0.16.0)
Requirement already satisfied: requests in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon) (2.12.1)
Requirement already satisfied: setuptools in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon) (39.0.1)
Requirement already satisfied: idna in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon) (2.5)
Requirement already satisfied: requests-file>=1.4 in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon) (1.4.3)
Requirement already satisfied: six in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from requests-file>=1.4->tldextract->dns-lexicon) (1.10.0)
Requirement already satisfied: dns-lexicon[godaddy] in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (2.2.1)
Requirement already satisfied: tldextract in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon[godaddy]) (2.2.0)
Requirement already satisfied: future in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon[godaddy]) (0.16.0)
Requirement already satisfied: requests in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon[godaddy]) (2.12.1)
Requirement already satisfied: setuptools in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon[godaddy]) (39.0.1)
Requirement already satisfied: idna in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon[godaddy]) (2.5)
Requirement already satisfied: requests-file>=1.4 in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon[godaddy]) (1.4.3)
Requirement already satisfied: six in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from requests-file>=1.4->tldextract->dns-lexicon[godaddy]) (1.10.0)
Arguments: Namespace(action=‘create’, auth_key=’
**’, auth_secret=’***’, content=’***’, delegated=None, domain=‘dcps.net’, identifier=None, log_level=‘DEBUG’, name=’_acme-challenge.dcps.net’, priority=None, provider_name=‘godaddy’, ttl=None, type=‘TXT’)
Starting new HTTPS connection (1): api.godaddy.com
https://api.godaddy.com:443 “GET /v1/domains/dcps.net HTTP/1.1” 200 560
Starting new HTTPS connection (1): api.godaddy.com
https://api.godaddy.com:443 “PUT /v1/domains/dcps.net/records/TXT/_acme-challenge HTTP/1.1” 200 2
create_record: TXT _acme-challenge.dcps.net ***

Error output from lexicon-provider_godaddy.sh:
unittest2 1.1.0 requires argparse, which is not installed.
dns-lexicon 2.2.1 does not provide the extra ‘godaddy’
unittest2 1.1.0 requires argparse, which is not installed.

Waiting for verification…
Cleaning up challenges
Output from lexicon-provider_godaddy.sh:
Requirement already satisfied: dns-lexicon in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (2.2.1)
Requirement already satisfied: tldextract in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon) (2.2.0)
Requirement already satisfied: future in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon) (0.16.0)
Requirement already satisfied: requests in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon) (2.12.1)
Requirement already satisfied: setuptools in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon) (39.0.1)
Requirement already satisfied: idna in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon) (2.5)
Requirement already satisfied: requests-file>=1.4 in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon) (1.4.3)
Requirement already satisfied: six in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from requests-file>=1.4->tldextract->dns-lexicon) (1.10.0)
Requirement already satisfied: dns-lexicon[godaddy] in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (2.2.1)
Requirement already satisfied: tldextract in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon[godaddy]) (2.2.0)
Requirement already satisfied: future in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon[godaddy]) (0.16.0)
Requirement already satisfied: requests in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from dns-lexicon[godaddy]) (2.12.1)
Requirement already satisfied: setuptools in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon[godaddy]) (39.0.1)
Requirement already satisfied: idna in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon[godaddy]) (2.5)
Requirement already satisfied: requests-file>=1.4 in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from tldextract->dns-lexicon[godaddy]) (1.4.3)
Requirement already satisfied: six in /opt/eff.org/certbot/venv/lib/python2.7/site-packages (from requests-file>=1.4->tldextract->dns-lexicon[godaddy]) (1.10.0)
Arguments: Namespace(action=‘delete’, auth_key=’***’, auth_secret=’***’, content=’***’, delegated=None, domain=‘dcps.net’, identifier=None, log_level=‘DEBUG’, name=’_acme-challenge.dcps.net’, priority=None, provider_name=‘godaddy’, ttl=None, type=‘TXT’)
Starting new HTTPS connection (1): api.godaddy.com
https://api.godaddy.com:443 “GET /v1/domains/dcps.net HTTP/1.1” 200 560
Starting new HTTPS connection (1): api.godaddy.com
https://api.godaddy.com:443 “GET /v1/domains/dcps.net/records HTTP/1.1” 200 469
Starting new HTTPS connection (1): api.godaddy.com
https://api.godaddy.com:443 “PUT /v1/domains/dcps.net/records HTTP/1.1” 422 275

Hook command “/etc/letsencrypt/lexicon-provider_godaddy.sh delete” returned error code 255e[0m
Error output from lexicon-provider_godaddy.sh:
unittest2 1.1.0 requires argparse, which is not installed.
dns-lexicon 2.2.1 does not provide the extra ‘godaddy’
unittest2 1.1.0 requires argparse, which is not installed.
Traceback (most recent call last):
File “/opt/eff.org/certbot/venv/bin/lexicon”, line 11, in
sys.exit(main())
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/lexicon/main.py”, line 72, in main
client.execute()
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/lexicon/client.py”, line 50, in execute
return self.provider.delete_record(self.options.get(‘identifier’), self.options.get(‘type’), self.options.get(‘name’), self.options.get(‘content’))
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/lexicon/providers/godaddy.py”, line 106, in delete_record
self._put(’/domains/{0}/records’.format(domain), to_insert)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/lexicon/providers/base.py”, line 79, in _put
return self._request(‘PUT’, url, data=data, query_params=query_params)
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/lexicon/providers/godaddy.py”, line 130, in _request
result.raise_for_status()
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/requests/models.py”, line 884, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.godaddy.com/v1/domains/dcps.net/records

IMPORTANT NOTES:

  • The dry run was successful.

#5

I found another way to do this. Instead of the lexicon method, I’m using scripts from here: https://github.com/alambrec/validation-hooks-certbot-godaddy

The dry run completes with no errors.


#6

These errors are coming from your manual hooks and not Certbot itself. Assuming you’re following @_az’s instructions from https://id-rsa.pub/post/certbot-auto-dns-validation-with-lexicon/, perhaps they can help you out.


#7

Weird, can’t reproduce it. Happy you got it working with a different solution @wjohnson .

Edit 1: Unfortunately I don’t have a GoDaddy-hosted domain/service so I don’t fully understand why the HTTP 422 came back from its delete API via Lexicon. Maybe there is a bug, will try to follow it up with Lexicon.

Edit 2: I signed up to GoDaddy and reproduced it, submitted an issue to Lexicon. :frowning:


#8

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