troykelly / hassio-addons-letsencrypt-lexicon

Home Assistant Addon that provides Let's Encrypt with Lexicon
Apache License 2.0
5 stars 2 forks source link

Fails to Copy Keys #6

Closed tduffy83 closed 3 years ago

tduffy83 commented 3 years ago

Here is my configuration:

email: ted4q@virginia.edu
domains:
  - duffhome.dufflan.com
certfile: fullchain.pem
keyfile: privkey.pem
dns:
  provider: godaddy
  godaddy_key: XXXXXXXX
  godaddy_secret: XXXXXXXXX

And here is the resulting log:

[22:34:31] INFO: [duffhome_dufflan_com]:    duffhome.dufflan.com
[22:34:31] INFO: Requesting domains from LetsEncrypt
# Home Assistant Domains
duffhome.dufflan.com > duffhome_dufflan_com
# END Home Assistant Domains
# INFO: Using main config file /etc/dehydrated/config
Processing duffhome.dufflan.com
 + Creating new directory /ssl/duffhome_dufflan_com ...
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting new certificate order from CA...
 + Received 1 authorizations URLs from the CA
 + Handling authorization for duffhome.dufflan.com
 + 1 pending challenge(s)
 + Deploying challenge tokens...
deploy_challenge called: duffhome.dufflan.com, 42Xew9ybrf81cmx1YMI1HlNDK9tEf_2bCCba9rdsPgY, 2IKQp080XnMr-_zTvuueN-g6MJ0A8wsqnlL6Hu8ImhI
Traceback (most recent call last):
  File "/usr/local/bin/lexicon", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/lexicon/cli.py", line 117, in main
    results = client.execute()
  File "/usr/local/lib/python3.8/site-packages/lexicon/client.py", line 84, in execute
    return self.provider.create_record(record_type, name, content)
  File "/usr/local/lib/python3.8/site-packages/lexicon/providers/base.py", line 80, in create_record
    return self._create_record(rtype, name, content)
  File "/usr/local/lib/python3.8/site-packages/lexicon/providers/godaddy.py", line 116, in _create_record
    self._put('/domains/{0}/records'.format(domain), records)
  File "/usr/local/lib/python3.8/site-packages/lexicon/providers/base.py", line 148, in _put
    return self._request('PUT', url, data=data, query_params=query_params)
  File "/usr/local/lib/python3.8/site-packages/lexicon/providers/godaddy.py", line 270, in _request
    result.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 940, 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/dufflan.com/records
[22:34:37] INFO: Copying domains and keys
[22:34:37] ERROR: Failed to get privkey.pem from duffhome_dufflan_com
[22:34:37] ERROR: Failed to get fullchain.pem from duffhome_dufflan_com
[22:34:37] INFO: Cleaning Up
# INFO: Using main config file /etc/dehydrated/config
[22:34:37] INFO: Finished

Checking my domain settings there is no challenge txt entry. Something's failing somewhere, any idea?

troykelly commented 3 years ago

@tduffy83 I will have to have a crack at this on the weekend. Thanks for the detailed logs, I don't have a godaddy account to test with - but the error seems strange, it's like dehydrated is creating an invalid payload for Godaddy.

It could be as simple as a version upgrade of dehydrated. Apologies I can't get to this now, should have time in the next few days.

tduffy83 commented 3 years ago

Troy, no worries, no hurry. I have certificates I generated with the duckdns addon that don't expire until March 2021 so we've got some time to figure this out. I'd much rather use your addon as I already have dynamic dns set up with pfsense and godaddy and the duckdns addon has a bug that prevents the dynamic dns and alias use at the same time that they don't seem too keen on fixing.

tduffy83 commented 3 years ago

Troy, also, if you want to test, I can add a key and secret for testing purposes and send to you in an e-mail, that I can delete after it's sorted.

troykelly commented 3 years ago

@tduffy83 I've just bumped the lexicon versions and sending up version 1.0.4 It should be available shortly, would you mind updating and let me know if you still see the error?

tduffy83 commented 3 years ago

Just checked and 1.0.4 is not available in my instance of Home Assistant add on store yet. Perhaps just have to wait a bit for things to propagate.

tduffy83 commented 3 years ago

1.0.4 fixes the issue. Thanks for the prompt service Troy.