hassio-addons / addon-unifi

UniFi Network Application - Home Assistant Community Add-ons
https://addons.community
MIT License
272 stars 135 forks source link

Controller not reachable after update 1.0.0 #249

Closed Bounties1337 closed 2 years ago

Bounties1337 commented 3 years ago

Add-on updated to 1.0.0. http nor https onto controller possible.

However, Log looks good saying controller is starting... .

image

Hassio Log says the following: image

Any Idea?

stevehop commented 3 years ago

Thought this was going to be a good way forward for myself as well. Except that I've got SSL all configured with HSTS on my HA setup and doing this completely breaks.

Anybody got a code snippet for adding an extra server handler to the Nginx proxy Add-On to make it deal with this thing?

This was exactly my use case and from what I've seen and tested:

Initially I setup a new nginx proxy host using this config:

matteskonto commented 3 years ago

I had some free time today.

what i have done:

1. made a backup in the unifi controller

2. removed 0.23.2

3. installed 1.0.0

4. restored backup.

All OK now.

this is maybe the easiest step for the 24 users

This worked for me too

mpoli commented 3 years ago

Any solution for those of us that were locked out of the interface (and the ability to perform a unifi-backup) because of the 0.23.2 certificate issue #235, but have a Snapshot of the Add On and would like to be able to import controller config into the new 1.0.0 would be greatly appreciated.

pro2call-nl commented 3 years ago

Any solution for those of us that were locked out of the interface (and the ability to perform a unifi-backup) because of the 0.23.2 certificate issue #235, but have a Snapshot of the Add On and would like to be able to import controller config into the new 1.0.0 would be greatly appreciated.

Maybe in the folder backup on your hassio instance there is an folder unifi. That's where I got my unf file.

marcomsousa commented 3 years ago

@frenck what storageEngine you use with the in 3.4 version, MMAPv1 or WiredTiger?

frenck commented 3 years ago

@marcomsousa That is controlled by UniFi, it loads and configures MongoDB (its not a separate process)

camui-alexandru commented 3 years ago

I am getting the same error and logs after the upgrade also.

I reverted back to v0.23.2 version successfully, https://github.com/hassio-addons/addon-unifi/releases/tag/v0.23.2 Which states it's the last 32bit version for armhf, armv7 & i386. There is a duplicate issue logged earlier also

How can I revert back ? When I updated the unifi addon I checked the backup option. But I don't know how can I restore it.

JannesV commented 3 years ago

I am getting the same error and logs after the upgrade also. I reverted back to v0.23.2 version successfully, https://github.com/hassio-addons/addon-unifi/releases/tag/v0.23.2 Which states it's the last 32bit version for armhf, armv7 & i386. There is a duplicate issue logged earlier also

How can I revert back ? When I updated the unifi addon I checked the backup option. But I don't know how can I restore it.

Go to snapshots and select the unifi snapshot to revert to.

image

marcomsousa commented 3 years ago

@marcomsousa That is controlled by UniFi, it loads and configures MongoDB (its not a separate process)

When I use the Unifi addon 1.0.0 from scratch, the storageEngine used are the wireTiger.

2021-08-16T15:15:10.442+0200 I - [initandlisten] Detected data files in /usr/lib/unifi/data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.

I think the mongodb 3.4.24 ARM64-bit from Mongo repo doesn't have included the mmapv1 storageEngine.

@frenck if true, and if you want to reproduce our issues, you can do this:

  1. Install pi with 32-bit version of home assistant
  2. Install Addon Unifi 0.23.2 using 32-bit. ('wiredTiger' isn't support in 32-bit mongodb version, so will use the mmapv1 storageEngine).
  3. Backup home-assistant and download snapshot
  4. Install pi with 64-bit version of home assistant
  5. Restore backup of home-assistant (everything will work)
  6. Update Addon Unifi from 0.23.2 to 1.0.0

This will reproduce our error because mongodb ARM64-bit, don't have include by default the mmapv1 storageEngine. If true, the fix is to build/compile mongodb 3.4.24 ARM 64-bit from sources with mmapv1 storageEngine enable.

marcomsousa commented 3 years ago

Who is using HA 64-bit restored from an old HA 32-bit version? I think this will 100% the users that are complaining.

bitcrumb commented 3 years ago

@marcomsousa Now that you mention it. I indeed restored a Home Assisant setup from a 32-bit Home Assistant OS onto a fresh 64 bit HA OS version. Since I wanted to be able to upgrade to Unifi Add-on 1.0.0.

bcutter commented 3 years ago

Who is using HA 64-bit restored from an old HA 32-bit version? I think this will 100% the users that are complaining.

It depends, tending to say "no that's not the case":

My whole HA instance was running on 32 bit (Pi 3B+ hardware) in the beginning before I updated to HASS OS 64 bit on Pi 4 (migrated restoring a full snapshot). BUT I didn't use Unifi addon before that migration.

piouoso commented 3 years ago

Who is using HA 64-bit restored from an old HA 32-bit version? I think this will 100% the users that are complaining.

My HA is native 64 bit (PI4). Anyway, I was able to do a clean install and restore the backup. Now version 1 is working!

Alexthestampede commented 3 years ago

I'm also having this problem but I'd disagree on the idea of the 32 bit to 64 being the issue, I bought and setup from zero a Pi 4 specifically for the UniFi controller, so there wasn't a previous HA to restore :)

tykeal commented 3 years ago

I never ran an HA32, I've always been doing HA64 ever since I setup my Pi4 8GB which is the first time I installed this addon.

After futzing around with getting NGinx Proxy Manager working so I could deal with a new subdomain along with my HSTS configuration, I too got this working by doing an uninstall, re-install + backup restore. I also had to rest my integration since everything changed with having to setup a new subdomain :-/

garyak commented 3 years ago

At the risk of being "off topic", I followed the procedure above and was able to restart the controller v1.0.0. However, I did catch the following in the HA log:

[14:48:54] INFO: Starting the UniFi Controller...
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called
Exception in thread "Thread-15" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
    at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:177)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1123)
    at com.ubnt.service.ooOO.return(Unknown Source)
    at com.ubnt.ace.Launcher$2.run(Unknown Source)
[14:49:59] INFO: Starting the UniFi Controller...

After update to v2021.8.7, the error did not reappear in the HA log.

frenck commented 3 years ago

I've locked down the issue, as people keep posting unrelated stuff here. This is not about an issue with other error messages, this issue is also not a support forum on how Home Assistant snapshots/backups work. If you have this exact issue, please upvote the issue instead of writing "Me too" response as well. This is not unique to this project or issue, this is how generally GitHub works.

It is super distracting to find solutions and focus on the problem at hand with all that noise. I've asked a couple of times nows, unfortunately, it is ignored leaving me no other choice than to stop this madness.

Before you downvote this comment: You don't have to agree and I don't care if you don't.

../Frenck

frenck commented 2 years ago

This issue is way overdue, and closing it as won't fix at this point.