elad-bar / ha-blueiris

Integration with Blue Iris Video Security Software
184 stars 43 forks source link

cannot save options under integration configuration - connection to BI impossible? - user input malformed #88

Closed ocsele closed 3 years ago

ocsele commented 4 years ago

Dear elad-bar,

I was using your integration for some month quite happily, without any problems. But recently, a couple of days ago the integration started to brake down, random connection losses to BI, cameras seemingly randomly disappearing, etc.

Now I completely lost the ability to view BI cameras in HA, when I try to make some configuration changes to the integration I constantly get "user input malformed, setup username and password to control profiles / excludes system camera", even tought the username and pw is absolutely there since the initial integration setup, and it was working correctly before, and also in HA logs I see the following entries (X stands for partial IP for privacy, and I also removed session ID, if you need it for any reason, let me know):

The server itself is obviously healthy, totally reachable, and the same config was working flawlessly for over a month. I started to fail after two things happened:

arch x86_64
chassis vm
dev false
docker true
docker_version 19.03.11
hassio true
host_os HassOS 4.15
installation_type Home Assistant OS
os_name Linux
os_version 5.4.72
python_version 3.8.6
supervisor 2020.11.0
timezone Europe/Budapest
version 0.117.5
virtualenv false

I already tryied removing intergration, reinstalling repo in HACS, removing and readding repo in HACS, deleting .blueiris auth key under .storage, a few times it did help, but after readding the integration, and trying to save some option changes, I always end up with user input malformed error, and eventually I loose my cameras in HA.

Please tell me how can I help you to analyse and correct this problem so I have my cameras back :)

Many thank in advance! a fan of yours: Zsolt

ocsele commented 4 years ago

I managed to remove and re-add integration again, managed to save IP and credentials, cameras appeared again. After a couple of minutes, image on lovelace started to flash (image(grey bg / image, and so on), and then images disappeared from the picture cards.

Under options, I managed to make changes, tried to change log level to debug, restarted HA, and in HA logs I found:

Logger: custom_components.blueiris Source: custom_components/blueiris/init.py:40 Integration: Blue Iris NVR (documentation) First occurred: 16:35:57 (1 occurrences) Last logged: 16:35:57 Failed to load BlueIris, error: Unable to find service logger/set_level, line: 27

elad-bar commented 4 years ago

Thanks for the detailed explanation, Can you share the spec of the machine runs the BI and the number of camera you have connected to BI.

I'm running 17 camera on the same server, from time to time there are timeouts (running also facial recognition) , but those are related to BI server, the component just log them.

According to the logs you have configured the BI without SSL, right? What about security, can you share more details about the configuration?

Thanks

elad-bar commented 3 years ago

@ocsele is it still relevant?

ocsele commented 3 years ago

Dear @elad-bar ,

I haven't encounter this problem in a while, but to be honest, I moved away from watching the camera streams from inside HA to BI's webserver for smoother real time playback. Yes, HA is non SSL at the moment, but behind strong FW and reverse proxy, running inside KVM on Ubuntu focal fossa on a slightly older i7 with 8 gigs RAM. BI running on same i7 architecture (different machine with Win10) but with 16 gigs ram, with 7 camera stream (dual stream connected for each, low res recorded 24/7, 4K only on AI triggered motion alerts). For some reason I see performance lags even with this setup with the low res secondary stream being streamed to a tablet (older AirPad2) via the webserver, freshly initated playback after a couple of minutes into streaming it will continuously lag with 30 secs or so.. can't really find the root cause, strong 5ghz wifi, good CAT6 lan build with only Mikrotik devices, and BI server is not even sweating, ram only consumed half way.. but it's kinda okay for the moment.

So your feedback much appreaciated elad-bar, of course camera cards are still integrated into HA with gate open button overlayed, and monitoring works fine if needed occasionally on my mobile phone.. but I'm not configuring anymore, so I don't get the above mentioned issue (not saying that it's not there :) )

If I can help you in any way in further investigation, just let me know!

And keep up your great work, it is greatly appreciated!!!! :):):):)

ocsele commented 3 years ago

Dear @elad-bar ,

it's me again unfortunately.

I had to move my blue iris install to a new, stronger workstation for better performance. To redo the integration with HA, first I removed my NVR under Config - Integrations.

After setting up the new BI webserver, and trying to re-add your integration, I encounter an invalid server details error message, no matter how, in what format (plain, with http prefix, etc.) I try: image

Do you have an idea what am I doing wrong?

I noticed the braking changes in the latest updates, so I'm after a full update of core, HACS, and your integration. core: core-2021.8.6 HACS: 1.13.2 BlueIrisNVR: 1.0.6

Any help is much much appreciated, thanks!!!

elad-bar commented 3 years ago

Can you please share logs in debug level?

Thanks

ocsele commented 3 years ago

I hope you mean this:

`This error originated from a custom integration.

Logger: custom_components.blueiris.managers.config_flow_manager Source: custom_components/blueiris/managers/config_flow_manager.py:442 Integration: Blue Iris NVR (documentation) First occurred: 18:09:38 (3 occurrences) Last logged: 20:32:18

Failed to access BlueIris Server (192.168.0.XXX)`

ocsele commented 3 years ago

Also this: `This error originated from a custom integration.

Logger: custom_components.blueiris.config_flow Source: custom_components/blueiris/config_flow.py:51 Integration: Blue Iris NVR (documentation) First occurred: 18:09:38 (3 occurrences) Last logged: 20:32:18

Cannot complete login `

elad-bar commented 3 years ago

According to the error the host is inaccessible, can you please share the debug level log (default is warning, you will need to set it to debug)?

Thanks

ocsele commented 3 years ago

aham, I think I got what you need, hope this is it: 2021-08-13 11:10:13 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 192.168.0.124 for /api/config/config_entries/flow/7da93c2d13d44711bfebb8c7d4695840 using bearer token 2021-08-13 11:10:13 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/flow/7da93c2d13d44711bfebb8c7d4695840 to 192.168.0.124 (auth: True) 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.config_flow] Starting async_step_user of BlueIris 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.managers.config_flow_manager] Update data 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.managers.config_flow_manager] Update options 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.managers.config_flow_manager] Update data 2021-08-13 11:10:13 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Initializing BlueIris 2021-08-13 11:10:13 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Performing login 2021-08-13 11:10:13 INFO (MainThread) [custom_components.blueiris.api.blue_iris_api] Retrieving session ID 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.api.blue_iris_api] Status of http://192.168.0.124:81/json: 200 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.api.blue_iris_api] Full result of {'cmd': 'login'}: {'result': 'fail', 'session': '0a9c049657a1102a5fba48771f8e7a4f', 'data': {'auth-exempt': True, 'reason': 'missing response'}} 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.api.blue_iris_api] Status of http://192.168.0.124:81/json: 200 2021-08-13 11:10:13 DEBUG (MainThread) [custom_components.blueiris.api.blue_iris_api] Full result of {'cmd': 'login', 'session': '0a9c049657a1102a5fba48771f8e7a4f', 'response': '1d57f1323e290fd2fb2021f6110e542d'}: {'result': 'fail', 'session': '0a9c049657a1102a5fba48771f8e7a4f', 'data': {'auth-exempt': True, 'reason': 'no matching user/pw'}} 2021-08-13 11:10:13 WARNING (MainThread) [custom_components.blueiris.managers.config_flow_manager] Failed to access BlueIris Server (192.168.0.124) 2021-08-13 11:10:13 WARNING (MainThread) [custom_components.blueiris.config_flow] Cannot complete login

and based on this I have the assumption that this is is a Blue Iris webserver misconfiguration, right? I do not ask for credentials to access BI webserver LAN-ONLY. Should I change anything?

I have an iPad on my wall on which I view the cameras via the webserver, I'd like to avoid antering credentials there, if possible...

ocsele commented 3 years ago

btw, is it true that yo moved on to Shinobi? is it a better alternative in your oppinion? I rely heavily on deepstack with blue iris with automations in my home (turn on patio lights, get custom alert based on face detection, etc), could this be also solved well with Shinobi + tensorflow? Thanks for your input!

elad-bar commented 3 years ago

Hi

According to the logs - BI returned no matching user/pw, Shinobi is working much better than BI, I also wrote face reco / object detection integration / plugin with Shinobi

ocsele commented 3 years ago

dear @elad-bar

my freakin' bad, I made a typo error during user creation in BI :( everything is fine now, I really really appreciate you helping to debug my problem, and I feel very much ashamed for wasting your time on such a nonsense problem :(

image

if you have any writeup, blog entry, or anything to read on Shinobi and HA, I would much appreciate some links.. maybe I try to follow you on that path..

Thanks again man, and all the best to you!!

elad-bar commented 3 years ago

Great, thanks for the update