hassio-addons / addon-unifi

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

Unable to access WebUI #205

Closed TinTin1969 closed 3 years ago

TinTin1969 commented 3 years ago

Problem/Motivation

Since version 0.21 I have been unable to access the WebUI. I know from other forums that other people have the same issue.

Expected behavior

With or without SSL I have always been able to access the WebUI, both locally and remotely, until version 0.21.

Actual behavior

The page returns aConnection Refused error message. I can uninstall the plugin and after a few attempts I can access WebUI, but as soon as I restore an auto-save, no matter which one, the error returns. No solutions on other forums so far.

TinTin1969 commented 3 years ago

ok after a few further tests and a hint this procedure does seem to work:

uninstall the current version, re-install the latest version - DONT start it - disable SSL - start the addon. Next connect via http://a.b.c.d:8080 - you will see the controller interface allowing you to import your previous configuration. Once this completes the controller is working and using the default unifi ssl certificate.

as soon as you try to use your own SSL certificates it will break again and can be recovered as explained above.

I can confirm this works, even on 32-bit OS. I've always thought it had something to do with SSL because the add-on was always running, only you couldn't access the UI. This should be really easy to fix...

sermayoral commented 3 years ago

ok after a few further tests and a hint this procedure does seem to work:

uninstall the current version, re-install the latest version - DONT start it - disable SSL - start the addon. Next connect via http://a.b.c.d:8080 - you will see the controller interface allowing you to import your previous configuration. Once this completes the controller is working and using the default unifi ssl certificate.

as soon as you try to use your own SSL certificates it will break again and can be recovered as explained above.

I can also confirm this works on my Raspberry Pi OS 32 bit :-)

@frenck i think is not necessary to deprecate this addon for 32 bit system. The only problem is the SSL certificate

glyph-se commented 3 years ago

ok after a few further tests and a hint this procedure does seem to work: uninstall the current version, re-install the latest version - DONT start it - disable SSL - start the addon. Next connect via http://a.b.c.d:8080 - you will see the controller interface allowing you to import your previous configuration. Once this completes the controller is working and using the default unifi ssl certificate. as soon as you try to use your own SSL certificates it will break again and can be recovered as explained above.

I can also confirm this works on my Raspberry Pi OS 32 bit :-)

@frenck i think is not necessary to deprecate this addon for 32 bit system. The only problem is the SSL certificate

The SSL certificate is not the only problem on 32-bit. I had problems accessing version 0.21 of this addon and had never enabled SSL. My problem was caused by a crashing mongod, from which the logs are above.

Though the mongod crash might have been fixed by now since it was introduced by something changed in the unifi controller itself it might be (temporarily?) gone now that is has been updated again. Did you check the mongod.log in your system in the different versions?

sermayoral commented 3 years ago

@glyph-se yes, I was having mongod crashing with the addon version > 0.20.3, but now MongoDB starts:

2021-07-21T15:12:44.997+0200 [initandlisten] MongoDB starting : pid=564 port=27117 dbpath=/usr/lib/unifi/data/db 32-bit host=a0d7b954-unifi
2021-07-21T15:12:44.997+0200 [initandlisten] 
2021-07-21T15:12:44.997+0200 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2021-07-21T15:12:44.997+0200 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
2021-07-21T15:12:44.997+0200 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
2021-07-21T15:12:44.997+0200 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
2021-07-21T15:12:44.997+0200 [initandlisten] 
2021-07-21T15:12:44.997+0200 [initandlisten] db version v2.6.10
2021-07-21T15:12:44.998+0200 [initandlisten] git version: nogitversion
2021-07-21T15:12:44.998+0200 [initandlisten] OpenSSL version: OpenSSL 1.0.2n  7 Dec 2017
2021-07-21T15:12:44.998+0200 [initandlisten] build info: Linux kishi10 3.2.0-84-highbank #121-Ubuntu SMP PREEMPT Tue May 5 19:44:15 UTC 2015 armv7l BOOST_LIB_VERSION=1_58
2021-07-21T15:12:44.998+0200 [initandlisten] allocator: tcmalloc
2021-07-21T15:12:44.998+0200 [initandlisten] options: { net: { bindIp: "127.0.0.1", port: 27117, unixDomainSocket: { pathPrefix: "/usr/lib/unifi/run" } }, processManagement: { pidFilePath: "/usr/lib/unifi/run/mongod.pid" }, storage: { dbPath: "/usr/lib/unifi/data/db", smallFiles: true }, systemLog: { destination: "file", logAppend: true, path: "/usr/lib/unifi/logs/mongod.log" } }
2021-07-21T15:12:44.998+0200 [initandlisten] 
2021-07-21T15:12:44.998+0200 [initandlisten] ** WARNING: Readahead for /usr/lib/unifi/data/db is set to 65532KB
2021-07-21T15:12:44.998+0200 [initandlisten] **          We suggest setting it to 256KB (512 sectors) or less
2021-07-21T15:12:44.998+0200 [initandlisten] **          http://dochub.mongodb.org/core/readahead
2021-07-21T15:12:45.007+0200 [initandlisten] waiting for connections on port 27117
2021-07-21T15:12:45.213+0200 [initandlisten] connection accepted from 127.0.0.1:51114 #1 (1 connection now open)
2021-07-21T15:12:45.224+0200 [initandlisten] connection accepted from 127.0.0.1:51116 #2 (2 connections now open)
2021-07-21T15:12:47.077+0200 [initandlisten] connection accepted from 127.0.0.1:51162 #3 (3 connections now open)
2021-07-21T15:12:47.089+0200 [initandlisten] connection accepted from 127.0.0.1:51164 #4 (4 connections now open)
2021-07-21T15:12:47.194+0200 [conn4] allocating new ns file /usr/lib/unifi/data/db/ace_stat.ns, filling with zeroes...
2021-07-21T15:12:47.348+0200 [FileAllocator] allocating new datafile /usr/lib/unifi/data/db/ace_stat.0, filling with zeroes...
2021-07-21T15:12:47.349+0200 [FileAllocator] creating directory /usr/lib/unifi/data/db/_tmp
2021-07-21T15:12:47.352+0200 [FileAllocator] done allocating datafile /usr/lib/unifi/data/db/ace_stat.0, size: 16MB,  took 0.001 secs
2021-07-21T15:12:47.381+0200 [conn4] build index on: ace_stat.stat_minute properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "ace_stat.stat_minute" }
2021-07-21T15:12:47.381+0200 [conn4]     added index to empty collection
2021-07-21T15:12:47.381+0200 [conn4] build index on: ace_stat.stat_minute properties: { v: 1, key: { site_id: 1, datetime: 1 }, name: "site_id_1_datetime_1", ns: "ace_stat.stat_minute" }
2021-07-21T15:12:47.381+0200 [conn4]     added index to empty collection
2021-07-21T15:12:47.381+0200 [conn4] command ace_stat.$cmd command: createIndexes { createIndexes: "stat_minute", indexes: [ { key: { site_id: 1, datetime: 1 }, name: "site_id_1_datetime_1", ns: "ace_stat.stat_minute" } ] } keyUpdates:0 numYields:0 locks(micros) r:15 w:187387 reslen:113 187ms
2021-07-21T15:12:47.385+0200 [conn4] build index on: ace_stat.stat_minute properties: { v: 1, key: { datetime: 1, o: 1, site_id: 1, oid: 1 }, name: "datetime_1_o_1_site_id_1_oid_1", ns: "ace_stat.stat_minute" }
2021-07-21T15:12:47.385+0200 [conn4]     added index to empty collection
2021-07-21T15:12:47.391+0200 [conn4] build index on: ace_stat.stat_5minutes properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "ace_stat.stat_5minutes" }
2021-07-21T15:12:47.391+0200 [conn4]     added index to empty collection
2021-07-21T15:12:47.392+0200 [conn4] build index on: ace_stat.stat_5minutes properties: { v: 1, key: { site_id: 1, datetime: 1 }, name: "site_id_1_datetime_1", ns: "ace_stat.stat_5minutes" }
2021-07-21T15:12:47.392+0200 [conn4]     added index to empty collection
2021-07-21T15:12:47.394+0200 [conn4] build index on: ace_stat.stat_5minutes properties: { v: 1, key: { datetime: 1, o: 1, site_id: 1, oid: 1 }, name: "datetime_1_o_1_site_id_1_oid_1", ns: "ace_stat.stat_5minutes" }
2021-07-21T15:12:47.394+0200 [conn4]     added index to empty collection

And the addon seem to work propertly. We will see its behaviour in the following days

sermayoral commented 3 years ago

Not working. Sorry. After reboot the host, the addon doesn't start 😭

mirek-z commented 3 years ago

hello Rpi 4 Home Assistant OS 6.1 64 bit after installing the add-on it is impossible to enter the panel. logs: [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms ... exited 0. [fix-attrs.d] applying ownership & permissions fixes ... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts ... [cont-init.d] 00-banner.sh: executing ...


Add-on: UniFi Controller Manage your UniFi network using a web browser


Add-on version: 0.23.2 You are running the latest version of this add-on. System: Home Assistant OS 6.1 (aarch64 / raspberrypi4-64) Home Assistant Core: 2021.7.4 Home Assistant Supervisor: 2021.06.8


Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.


[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing ... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] unifi.sh: executing ... [cont-init.d] unifi.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. [17:21:01] INFO: Starting the UniFi Controller ...

anyone has an idea what went wrong?

garyak commented 3 years ago

On a NUC, HAOS 6.2, HA Core 2021.7.4 and cannont open the web UI either. Error is ERR_SSL_VERSION_OR_CIPHER_MISMATCH.

Host Operating System | Home Assistant OS 6.2
-- | --
Update Channel | stable
Supervisor Version | supervisor-2021.06.8
Docker Version | 20.10.6
Disk Total | 457.7 GB
Disk Used | 8.0 GB
Healthy | true
Supported | true
Board | generic-x86-64
Supervisor API | ok
Version API | ok
Installed Add-ons | Samba share (9.5.1), Check Home Assistant configuration (3.8.0), FTP (4.2.0), SSH & Web Terminal (9.0.0), Network UPS Tools (0.8.0), Duck DNS (1.13.0), NGINX Home Assistant SSL proxy (3.0.2), phpMyAdmin (0.4.3), Portainer (1.5.1), ZeroTier One (0.11.1), MariaDB (2.4.0), UniFi Controller (0.23.2), chrony (2.2.0)