Let's Encrypt/DuckDNS/Hass.io error

Tried…

Simplicity itself to follow bar the fact the front end doesn’t come back when restarting!

Only error from log…

 2017-09-28 12:25:30 ERROR (MainThread) [aiohttp.server] Error handling request   
 Traceback (most recent call last):
      File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 422, in start
        resp = yield from self._request_handler(request)
      File "/usr/lib/python3.6/site-packages/aiohttp/web.py", line 304, in _handle
        handler = yield from factory(app, handler)
      File "/usr/lib/python3.6/asyncio/coroutines.py", line 210, in coro
        res = func(*args, **kw)
      File "/usr/lib/python3.6/site-packages/homeassistant/components/http/auth.py", line 19, in auth_middleware
        if app['hass'].http.api_password is None:
    AttributeError: 'HomeAssistant' object has no attribute 'http'

It says api_password is None but there is one, any ideas?

If I remove…

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

from config, she comes back to life.

1 Like

Hey @Bobby_Nobble I noticed that someone above you in the original post had issues. After forwarding port 443 > Hassio’s 8123 it worked. Have you tried that? Where are you trying to reach your front end?

This may be a stupid question but are you removing http: from your config file or just the ssl lines?

My RPi3 comes in tomorrow so I’ve been doing some research on getting this setup. I’m hoping it will be as straight forward as that blog entry makes it sound,

Tried every combo going of port forwarding, not port forwarding and adding port to config etc etc and it fails with the error above so the front end is not going to appear regardless.

duckdns is fine, I was using it previously but updating via my server, but the add-on is doing the job. It’s literally the let’s encrypt bit in the config yaml that does it…

http:
  # Uncomment this to add a password (recommended!)
  api_password: xxxxxxxx
  # Uncomment this if you are using SSL or running in Docker etc
  # base_url: xxxxxx.duckdns.org:8123
  # ssl_certificate: /ssl/fullchain.pem
  # ssl_key: /ssl/privkey.pem

Every combo going, if you read the comments with the post you’ll see some rather important detail about the ports got left out but I still can’t get mine to work which is doubly annoying because everything else people have a lot of trouble with just seems to work for me!

So I got my RPi3 with Hass.io up and running. I tried setting up DuckDNS and Let’s Encrypt using that same blog post, following the instructions exactly. The only thing I did that wasn’t mentioned was adding my DuckDNS token and address. I’m having a different issue than you though - Hass.io loads up fine even with the ssl entires in my config file but when I try to go to http://myaddress.duckdns.org:8123, it doesn’t work (looks like it’s loading for a while then basically gives me a page not found). The weird part is I think Let’s Encrypt is working fine because the only way I can access my Hass.io is using https://hassio.local:8123.

I did not forward any ports because my understanding is you shouldn’t have to based on what that blog post says…

Hmm…thanks for sharing, think I’ll delete it and have another go.

You don’t have the s on https on your external link that doesn’t work, guess that’s just a typo though?

Just to check, your config yaml looks like this…

http:
  api_password: xxxxxxxx
  base_url: xxxxxx.duckdns.org:8123
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem

and DuckDNS config like this…

{
  "lets_encrypt": {
    "accept_terms": true,
    "certfile": "fullchain.pem",
    "keyfile": "privkey.pem"
  },
  "token": "xxxxxxxxxxxxxxxxxxxxx",
  "domains": [
    "xxxxxx.duckdns.org"
  ],
  "seconds": 300
}

@Bobby_Nobble I’m having the same issues - did you find a fix for this?

You managed?

Did you put
base_url: xxx duckdns.org

I got to where @shred now is by changing my config around so it’s now…

http:
  ssl_certificate: /ssl/fullchain.pem
  ssl_key: /ssl/privkey.pem
  api_password: xxxxxxxx
  base_url: xxxxxx.duckdns.org:8123

No more errors, I can see it is doing the certificates properly, and I now have to use https to get into the front end locally BUT Chrome doesn’t like the certificate and bleats about the site being insecure if you force it to let you in.

Externally, still nothing whatever I try, no forwarding, forwarding to different ports etc etc, same as @shred

I didn’t put 8123

You found it then :slight_smile:

But not the solution

@Bobby_Nobble Thanks for sharing your config.
My config was about the same - I’ve been playing with variants of the base_url, and nothing seemed to change. I’m wondering if that’s even required? I would assume that line would be included in the instructions on the HA official docs if it was?
I’ve still got the same problem as you, as far as my-subdomain.duckdns.org port forwarding doesn’t work as expected. I think that’s probably a router config problem. You don’t happen to be using a Linksys Smart Wi-Fi system?

I thought no port forwarding was needed, isn’t so?

@RyanRayNeff @Bobby_Nobble
Does your letsencypt START inside hassio?

Mine does not

Asus 55u "here

Where would you put the 8123 that Paulus mentioned was missing from the instructions to avoid port forwarding if not there? When I add tried adding it to the DuckDNS config it got upset.

Mine’s a tp-link c9.

Don’t think it works like that, letsencrypt is just an external service that the DuckDNS add-on is talking to isn’t it?

Well all the ADD-ON I have will start after I push START. The only one not starting is the letencrypt add-on …

Not sure…