Unable to access UI after upgrade to .77

So, I’m considering moving forward again, and want to set myself up for success, not get locked out of my UI again. I’m still not 100% sure what I should do for my configuration.yaml

So what should it look like. I noticed I had two areas relating to auth

#  auth_providers:
#   - type: homeassistant
#   - type: legacy_api_password

#auth:

http:
  api_password: !secret http_password

So If I want to be able to use the new Auth, but also want to have the legacy auth enabled for stuff like IFTTT, what do I need to have enabled/disabled??

Thanks

Did you ever have the new auth_providers: enabled in your previous install?

If you didn’t then you shouldn’t have to do anything at all.

I think either way you shouldn’t have to do anything.

I have two instances of HA running on my network. They were both on v76. On one I had the auth_providers: and on the other I didn’t (just the api_password:). I upgraded both to 77.3 and it went fairly smoothly.

Maybe it’s messing up because you had the new auth enabled at one point and then commented it out?

If that’s the case then maybe try to re-enable the auth_providers and complete the log in for that version then upgrade.

Either way MAKE A BACKUP! :wink:

BTW, I don’t think I ever saw what install method you are using.

And lastly, while a downgrade might not be officially supported I’ve had to do it a couple of times due to breaking changes or bugs until those got fixed and I’ve never had an issue. Maybe since this is such a big upgrade it caused other problems. But I know a lot of other people have mentioned having to downgrade in the forum for similar reasons prior to this version and have been successful.

Oh and EDIT: this is situation is a definite vote for installing in docker. If you screw it up you just delete the container and re-create it. It literally takes seconds.

You know what. I did have the new auth enabled for a bit, was getting logon errors enough to be annoying and i turned it off (commented out), maybe that was the cause as you’ve suggested.

I am just using out of the box ubuntu 16.04 with HA running in a VENV. When I started, I felt like i had “backed up”, but I realize that really I just had most of my YAML files backed up. So when I reverted, and even using the old yaml files like entity registry, etc, it was not enough.

So what would have been a better way to “back up” making a copy of the entire /home/homeassistant/.homeassistant folder and all subfolders?

Honestly, I never did figure out a good way of getting a really complete backup of the venv after I migrated away from the RPi and went to a venv on the NUC. That’s why I eventually went the docker route. With that you just need a good backup of your config directory. If something goes wonky on an upgrade you literally just have to delete the container from docker and re-create it. It takes just a few seconds to do. And you can re-create it from any version you want as long as the image is available at the docker hub.

As far as backing up the venv, I guess since it’s supposed to be completely self-contained then maybe just completely backing up the venv directory (where ever you happened to install it - usually in the /srv/homeassistant/ folder) would be sufficient. But I’ve never tried it so take that for what it’s worth.

And for another thing that might be helpful, this just popped into my head…

When I first switched from the Pi to the NUC in a venv I remember that I screwed something up the first time I tried to install HA. At that point all I did was delete the venv that HA was installed in by completely deleting the files in the venv install location. For me I deleted the homeassistant directory directly under the /srv/ directory. Then I just mkdir a new /srv/homeassistant/ directory (or wherever you installed your venv) and re-installed the HA venv:

$ sudo mkdir /srv/homeassistant
$ sudo chown homeassistant:homeassistant /srv/homeassistant
$ virtualenv -p python3 /srv/homeassistant

That should completely re-install everything from scratch and you’ll end up with the latest HA version on a squeaky clean HA. As long as you haven’t touched your config directory files then those shouldn’t be messed with and the new HA service should find them.

That might be an option if all else fails.

You should only backup config folder. Migration venv folder is a bad idea, especially from Pi to UNC, they are on different CPU architecture.

I’ve had the same problem after upgrade to 0.77.3.

try the following steps and it works in my case:

$ sudo su -s /bin/bash homeassistant
$ source /srv/homeassistant/bin/activate
$ pip3 uninstall voluptuous-serialize
$ pip3 install voluptuous-serialize==2.0.0

after re-install voluptuous-serialize package, reboot system and start homeassistant service again.

I wasn’t suggesting using a backup of the venv as a way to migrate from one platform to another. Just as a way to save a backup of an install on a NUC before upgrading in case the backup went wrong. I also gave no suggestion it would actually work.

Why is it that the voluptuous-serialize version could even possibly be wrong in the first place? I thought that the files in the venv were automatically installed/updated to the correct version required for the venv when you download and install HA.

We didn’t enforce the version in login form, but in other place.

This issue has been fixed in dev branch now.

What does that mean? Sorry, does that mean I should hold off on upgrading until the dev version bceomes the current version? Does that mean I should do this?

is the dev version .78?

Thanks!

No, my steps is nothing to do with dev version which awarecan mentioned above.

My steps simply uninstall voluptuous-serialize package and re-install it with specific version(2.0.0) again.

Sorry my question was not directed at you but at @awarecan

Yours is an edge case which triggered an issue in our code, and it has been fixed in dev branch, and now in 0.78 beta.

But you don’t need to wait, the script provided by @Austin-Liang should able to resolve your issue.

1 Like

This is what I get when I try to run the 4 lines above

Collecting voluptuous-serialize==2.0.0
  Cache entry deserialization failed, entry ignored
Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/basecommand.py", line 141, in main
    status = self.run(options, args)
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 299, in run
    resolver.resolve(requirement_set)
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/resolve.py", line 102, in resolve
    self._resolve_one(requirement_set, req)
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/resolve.py", line 256, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
    self.require_hashes
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 283, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/download.py", line 823, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/download.py", line 728, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/utils/misc.py", line 578, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/srv/homeassistant/lib/python3.6/site-packages/pip/_internal/utils/misc.py", line 463, in unzip_file
    zip = zipfile.ZipFile(zipfp, allowZip64=True)
  File "/usr/lib/python3.6/zipfile.py", line 1108, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.6/zipfile.py", line 1175, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Add --no-cache-dir to your pip command, it seems you are even not that edge case I thought. You just have a bad file in your cache.

That was it. ugg, so much work for something so simple. Thanks for continuing to help.

I’m fully working on the new version now.

Thanks.

Now just to figure out how to clear all of my cache. I had an issue with holidays due to corrupt cache that this fixed as well

Thanks again!

2 Likes