Hassbian http error config file, please help

I installed a fresh hassbian today since I couldn’t upgrade from v0.51 due to python issues. Anyways, I set up as usual as per bruh automation https://www.youtube.com/watch?v=BIvQ8x_iTNE for letsencrypt and duckdns.org. Copy over my old files and now HASS won’t boot. I ran the check config script and got the following error:

Failed config
  http:
    - Invalid config for [http]: not a file for dictionary value @ data['http']['ssl_certificate']. Got '/etc/letsencrypt/live/MYDOMAIN.duckdns.org/fullchain.pem'
not a file for dictionary value @ data['http']['ssl_key']. Got '/etc/letsencrypt/live/MYDOMAIN.duckdns.org/privkey.pem'. (See /home/homeassistant/.homeassistant/configuration.yaml, line 37). Please check the docs at https://home-assistant.io/components/http/
    - android_ip_webcam: [source /home/homeassistant/.homeassistant/configuration.yaml:84]
        - host: 192.168.1.118

Can someone please help explain why my keys are not working? I ran letsencrypt and it went well with no issues, the directory is in my pi but still no luck…

1 Like

It could be a permissions thing. Try doing sudo su -s /bin/bash homeassistant and see if you can see those files (e.g., try to cat them.)

Coincidentally, I just updated my certificate for the first time since installing HA. Guess what, I’m seeing the exact same thing as you now! It is indeed a permission issue. I have to make sure the new cert is accessible by user homeassistant.

Forgive me, I’m a bit of a noob in linux, forcing myself to learn by using Hassbian.

When I did sudo su -s /bin/bash homeassistant , it asked for a password. What password do I use? I tried my password for logging into my RP under user pi, i tired my password logging into HA via web GUI.

Ok, so I sudo chmod rwx for both group and operators of the /live folder yet I still can’t cat the file.

pi@hassbian:/etc/letsencrypt $ ls -la
total 36
drwxr-xr-x  9 root root 4096 May 20 06:21 .
drwxr-xr-x 90 root root 4096 May 20 06:16 ..
drwx------  3 root root 4096 May 20 06:18 accounts
drwx------  3 root root 4096 May 20 06:20 archive
drwxr-xr-x  2 root root 4096 May 20 06:20 csr
drwx------  2 root root 4096 May 20 06:20 keys
drwxrwxrwx  3 root root 4096 May 20 06:20 live
drwxr-xr-x  2 root root 4096 May 20 06:20 renewal
drwxr-xr-x  5 root root 4096 May 20 06:16 renewal-hooks
pi@hassbian:/etc/letsencrypt $ cat ./live/MYDOMAIN.duckdns.org/privkey.pem
cat: ./live/MYDOMAIN.duckdns.org/privkey.pem: Permission denied

It’s probably the permissions on the .pem files that need to change. Try sudo chmod 0644 on those files.

Nope, no dice…

pi@hassbian:/etc/letsencrypt $ ls -la
total 36
drwxr-xr-x  9 root root 4096 May 20 06:21 .
drwxr-xr-x 90 root root 4096 May 20 06:16 ..
drwx------  3 root root 4096 May 20 06:18 accounts
drwx------  3 root root 4096 May 20 06:20 archive
drwxr-xr-x  2 root root 4096 May 20 06:20 csr
drwx------  2 root root 4096 May 20 06:20 keys
drwxrwxrwx  3 root root 4096 May 20 06:20 live
drwxr-xr-x  2 root root 4096 May 20 06:20 renewal
drwxr-xr-x  5 root root 4096 May 20 06:16 renewal-hooks
pi@hassbian:/etc/letsencrypt $ cd live
pi@hassbian:/etc/letsencrypt/live $ ls -la
total 12
drwxrwxrwx 3 root root 4096 May 20 06:20 .
drwxr-xr-x 9 root root 4096 May 20 06:21 ..
drwxrwxrwx 2 root root 4096 May 20 06:20 MYDOMAIN.duckdns.org
pi@hassbian:/etc/letsencrypt/live $ cd MYDOMAIN.duckdns.org/
pi@hassbian:/etc/letsencrypt/live/MYDOMAIN.duckdns.org $ ls -la
total 12
drwxrwxrwx 2 root root 4096 May 20 06:20 .
drwxrwxrwx 3 root root 4096 May 20 06:20 ..
lrwxrwxrwx 1 root root   44 May 20 06:20 cert.pem -> ../../archive/MYDOMAIN.duckdns.org/cert1.pem
lrwxrwxrwx 1 root root   45 May 20 06:20 chain.pem -> ../../archive/MYDOMAIN.duckdns.org/chain1.pem
lrwxrwxrwx 1 root root   49 May 20 06:20 fullchain.pem -> ../../archive/MYDOMAIN.duckdns.org/fullchain1.pem
lrwxrwxrwx 1 root root   47 May 20 06:20 privkey.pem -> ../../archive/MYDOMAIN.duckdns.org/privkey1.pem
-rw-r--r-- 1 root root  682 May 20 06:20 README
pi@hassbian:/etc/letsencrypt/live/MYDOMAIN.duckdns.org $ cat fullchain.pem
cat: fullchain.pem: Permission denied

Fixed, I missed a critical step, sudo chmod -R 777 /etc/letsencrypt
That solved the problem however, I still can’t access web GUI. :face_with_symbols_over_mouth::face_with_symbols_over_mouth:

Edit: Rebooted the Pi, GUI loaded up, missing a lot of stuff like phillips hue and switches, sonoff switches but I guess that might be the gap from 0.51 to now 0.69.1

1 Like

So I just did the Hassbian upgrade 8/24/18 and couldn’t log in to my web interface after the upgrade. Come to find out, I had an old entry under http: ‘use_x_forwarded_for: True’ with nothing after. I simply commented that one line out and the web interface allowed me to log in.

Hope this can help somebody…