HELP! HA webpage not reachable... My home is offline!

Hi all,

Today my https certificate expired
(I check automatically the status of the certificate with crontab command:
“0 1 * * * /home/homeassistant/dehydrated/dehydrated -c | tee /home/homeassistant/dehydrated/update.log”)

This is the log:

# INFO: Using main config file /home/homeassistant/dehydrated/config
Unknown hook this_hookscript_is_broken__dehydrated_is_working_fine__please_ignore_unknown_hooks_in_your_script
Processing MYDNS.duckdns.org
Unknown hook this_hookscript_is_broken__dehydrated_is_working_fine__please_ignore_unknown_hooks_in_your_script
 + Checking domain name(s) of existing cert... unchanged.
 + Checking expire date of existing cert...
 + Valid till Mar 28 12:21:26 2021 GMT (Less than 30 days). Renewing!
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting new certificate order from CA...
 + Received 1 authorizations URLs from the CA
 + Handling authorization for MYDNS.duckdns.org
 + 1 pending challenge(s)
 + Deploying challenge tokens...
OK
 + Responding to challenge for MYDNS.duckdns.org authorization...
Unknown hook invalid_challenge
 + Cleaning challenge tokens...
OK
 + Challenge validation has failed :(

So I tried to renew the certificate writing:
/home/homeassistant/dehydrated/dehydrated -c

Now I see:

Unknown hook this_hookscript_is_broken__dehydrated_is_working_fine__please_ignore_unknown_hooks_in_your_script
 + Checking domain name(s) of existing cert... unchanged.
 + Checking expire date of existing cert...
 + Valid till Jun 26 12:24:21 2021 GMT (Longer than 30 days). Skipping renew!

So I suppose that the certificate is ok… I rebooted raspebrry but now I can’t reach the webpage of HA…
I tried:
https://mydomain.duckdns.org:8123 and https://mylocalip:8123
but nothing…

On the duckdns webpage I see the correct IP upadated and if I try:
sudo systemctl status home-assistant@homeassistant

I see:

[email protected] - Home Assistant
   Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2021-03-28 15:56:04 CEST; 16min ago
 Main PID: 1300 (hass)
    Tasks: 11 (limit: 2063)
   CGroup: /system.slice/system-home\x2dassistant.slice/[email protected]
           └─1300 /srv/homeassistant/bin/python3.8 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant

mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of person. Setup failed for dependencies: image
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Setup failed for person: Could not set up all dependencies.
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of cloud. Setup failed for dependencies: http, webhook, alexa
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Setup failed for cloud: Could not set up all dependencies.
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: auth, http, person
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api, auth, config, http, onboa
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of safe_mode. Setup failed for dependencies: frontend, cloud
mar 28 15:56:24 raspberrypiHA hass[1300]: 2021-03-28 15:56:24 ERROR (MainThread) [homeassistant.setup] Setup failed for safe_mode: Could not set up all dependencies.

Could anyone helpme… I have the home completely offline…

little update:
If I remove these lines from conf.yaml:

http: 
  ssl_certificate: /home/homeassistant/dehydrated/certs/MYDOMAIN.duckdns.org/fullchain.pem 
  ssl_key: /home/homeassistant/dehydrated/certs/MYDOMAIN.duckdns.org/privkey.pem 

I reach HA by http (not https) IP…

So… Is the errore caused by the certificated? How could I solve?

The odds are your log file has a warning about not a file for those certificates.

Check that:

  • They exist
  • The HA user can see the contents

Many thanks!
I solved… I generated the certs with pi account…
Now I performed the login with homeassistant user and it works:


pi@raspberrypiHA:/home/homeassistant/dehydrated/certs/mydomain $ ls -l
totale 20
-rw------- 1 homeassistant homeassistant  542 mar 28 18:30 cert-1616949029.csr
-rw------- 1 homeassistant homeassistant 1639 mar 28 18:30 cert-1616949029.pem
lrwxrwxrwx 1 homeassistant homeassistant   19 mar 28 18:30 cert.csr -> cert-1616949029.csr
lrwxrwxrwx 1 homeassistant homeassistant   19 mar 28 18:30 cert.pem -> cert-1616949029.pem
-rw------- 1 homeassistant homeassistant 1587 mar 28 18:30 chain-1616949029.pem
lrwxrwxrwx 1 homeassistant homeassistant   20 mar 28 18:30 chain.pem -> chain-1616949029.pem
-rw------- 1 homeassistant homeassistant 3226 mar 28 18:30 fullchain-1616949029.pem
lrwxrwxrwx 1 homeassistant homeassistant   24 mar 28 18:30 fullchain.pem -> fullchain-1616949029.pem
-rw------- 1 homeassistant homeassistant  359 mar 28 18:30 privkey-1616949029.pem
lrwxrwxrwx 1 homeassistant homeassistant   22 mar 28 18:30 privkey.pem -> privkey-1616949029.pem

Now all the files are created by HA user…

But now I’d like understand why the certs didn’t update automatically with the script in crontab…
I’d like avoid this problem in 3 months…

Maybe months ago I ran the “dehydrated -c” command with pi user… after that the script running with the crontab couldn’t update the certs?

The answer would probably be in the logs for dehydrated.