New install - unable to login after logging out from initial setup

I am trying Home Assistant for the first time. I have just done several new installs of the latest version of Home Assistant in various ways but with each one I am running into the same problem. The install is successful, and I can login to HA from localhost:8123 and do the initial setup. But after I log out from that initial setup, when I attempt to log in again using the newly set up owner account, I get this response:

 Home Assistant

You're about to give http://localhost:8123/ access to your Home Assistant instance.
Logging in with Home Assistant Local.
Error: Something went wrong

I initially tried installing in a Docker container, and then also as a Python virtual environment, both on my Ubuntu 18.04 system. Then I also tried installing the Hass.io virtual PC image in VirtualBox on my Windows 7 PC. All of them gave me exactly the same problem.

When I look at the homeassistant.log file, I see a Python exception:

KeyError: 'username'

As a newbie on this forum I am unable to post the traceback as it contains what the forum software thinks are URLs and I am only allowed to post one URL. So I have put a copy of the journalctl output for HA (from startup (“systemctl start homeassistant”) until the problem happens) here on my web server:

http://www.jsw.gen.nz/hass/homeassistant.log

This has the full traceback at the end of the file.

I have tried deleting the contents of my Docker install’s config directory, which allowed me to re-initialise everything from the start again, but once again I got the same problem after I set things up again and logged out.

So does anyone have any idea what I am doing wrong that causes this? Or is it a bug?

I have exact same issue - worked ok 2 hours ago but now cant login unto dashboard on laptop (hassio running on raspberry pi). putty working fine, can browse via windows 10 but getting keyerror ‘username’ when I log in to dash board

Not sure why but I can login in using Chrome but not edge?

Today I used Chromium from my Ubuntu 18.04 box to login to http://localhost:8123 and Chrome from my Windows 7 box to login to http://lith.jsw.gen.nz:8123 and both worked. I then tried Firefox 70 on my Ubuntu box, and that worked too. So this problem seems to be related to using Firefox or Firefox based browsers using the older codebase. I normally use Waterfox Classic, which is based on the old version of Firefox, before Firefox’s major upgrades last year (Firefox 56?):

https://www.waterfox.net/blog/waterfox-2019.10-release-download/

So it looks to me as though there is a bug in HA here, but it is only triggered by using obscure browsers, as most Firefox installs will have been updated to the new codebase by now.

Welp, I’m also getting this error on an old iPad Mini running ios 9. So…yeah. Older browsers.

I have this same issue with recent versions of the Edge browser. Using python 3.7 for hass

Same issue here. In a docker container accessing with Edge. Didn’t think to try with a different browser.

Is there any resolution? Installed HA on my old Nexus 9 and I’m not able to login. No user prompts. Still logging in fine with my other phones and computer.

For future people finding this thread through Google I have a possible culprit, your password manager!

When logging into your Home Assistant instance, don’t use your password manager’s auto fill and instead use copy and paste. I believe Home Assistant has several hidden forms on the page and my password manager, Enpass, fell right into those landmines.

After using copy and paste, I was able to log in.

2 Likes

This was it! I was using a password manager. Hours lost investigating this. That’s unbelievably rubbish, thanks for the heads up.