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

Error with dreamhost, lexicon updated API call #11

Closed acmfx closed 1 year ago

acmfx commented 1 year ago

I'm getting an error when using the add-on to try and get a cert for a dreamhost-managed domain. here's the trace that occurs when deploying the challenge:

Traceback (most recent call last):
  File "/usr/local/bin/lexicon", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/lexicon/cli.py", line 124, in main
    results = client.execute()
  File "/usr/local/lib/python3.9/site-packages/lexicon/client.py", line 67, in execute
    self.provider.authenticate()
  File "/usr/local/lib/python3.9/site-packages/lexicon/providers/base.py", line 74, in authenticate
    return self._authenticate()
  File "/usr/local/lib/python3.9/site-packages/lexicon/providers/dreamhost.py", line 104, in _authenticate
    payload = self._get("domain-list_domains")
  File "/usr/local/lib/python3.9/site-packages/lexicon/providers/base.py", line 159, in _get
    return self._request("GET", url, query_params=query_params)
  File "/usr/local/lib/python3.9/site-packages/lexicon/providers/dreamhost.py", line 243, in _request
    raise Exception(f"Dreamhost api error: {result}")
Exception: Dreamhost api error: {'data': 'this_key_cannot_access_this_cmd', 'result': 'error'}
ERROR: deploy_challenge hook returned with non-zero exit code
[cmd] /run.sh exited 1

I dug around a little bit and it looks like the root cause is the from this line: File "/usr/local/lib/python3.9/site-packages/lexicon/providers/dreamhost.py", line 104, in _authenticate payload = self._get("domain-list_domains") Dreamhost's API is no longer 'domain-list_domains', but is now 'dns-list_records'. Fortunately, it looks like Lexicon has updated this: https://github.com/AnalogJ/lexicon/blob/master/lexicon/providers/dreamhost.py#L103

Would it be possible to rebuild and republish the add-on docker image with an updated Lexicon dependency?

Hope you see this, thanks so much for putting this add-on together!

troykelly commented 1 year ago

Will try and recompile to see if there's a fix

troykelly commented 1 year ago

@acmfx this has been rebuild and pushed to https://github.com/troykelly/hassio-addons Docker hub is updating as we speak ( https://hub.docker.com/r/troykelly/amd64-addon-letslexicon ) When you get a chance can you test to see if the update works for you and let me know?

acmfx commented 1 year ago

Hey @troykelly, thanks for doing the rebuild! Just gave it a try and I got this (and only this) log message:

s6-overlay-suexec: fatal: can only run as pid 1

I tried doing a little digging around and found this: https://developers.home-assistant.io/blog/2022/05/12/s6-overlay-base-images/ (add init: false to config.json, maybe some other stuff?)

troykelly commented 1 year ago

It's been so long - I think the containers have to be built differently now. I will try and find some time today.

troykelly commented 1 year ago

@acmfx completely redone... I've just done some testing here and looks like it's working. Let me know how you fare

important

Make sure you are using the new data keys... Use the reference here.

You will be after dreamhost_auth_token I guess.

email: hello@home-assistant.io
domains:
- home-assistant.io
dns:
  provider: dreamhost
  dreamhost_auth_token: 35704b6a-3a62-11ed-a261-0242ac120002
acmfx commented 1 year ago

@troykelly that did the trick! I've got my home assistant instance up and running on internal-only dns with a let's encrypt cert. Thank you thank you for all the effort!