ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.01k stars 268 forks source link

Stuck on loading monitors #1025

Closed goruck closed 3 years ago

goruck commented 3 years ago

Before you create an issue, please make sure you have read the FAQ. Common questions on API, no image etc are covered there. Please also read HOWTO REPORT ISSUES

The version of zmNinja you are reporting:

1.6.004 

The version and OS of ZoneMinder you are using:

1.30.4, Ubuntu 18.04.5 LTS

Platform zmNinja is running on

Pixel 3XL, Android 11

Did you build the package from source code yourself? N

Describe the bug Monitors will not load. Stuck on the screen that says "If this screen doesn't...."

Debug logs

Dec 16, 2020 08:05:42:039 PM INFO ******* app .run device ready
Dec 16, 2020 08:05:42:041 PM INFO Device is ready
Dec 16, 2020 08:05:42:042 PM INFO setting size
Dec 16, 2020 08:05:42:042 PM DEBUG UA is mozilla/5.0 (linux; android 11; pixel 3 xl build/rp1a.201105.002; wv) applewebkit/537.36 (khtml, like gecko) version/4.0 chrome/87.0.4280.101 mobile safari/537.36
Dec 16, 2020 08:05:42:043 PM INFO You are running on android
Dec 16, 2020 08:05:42:043 PM DEBUG Inside configureStorageDB
Dec 16, 2020 08:05:42:044 PM DEBUG configureStorageDB: trying order:["asyncStorage","localStorageWrapper"]
Dec 16, 2020 08:05:42:088 PM INFO configureStorageDB:localforage driver for storage:asyncStorage
Dec 16, 2020 08:05:42:088 PM DEBUG configureStorageDB:Making sure this storage driver works...
Dec 16, 2020 08:05:42:096 PM DEBUG resize/orient: 412(w) * 749(h)
Dec 16, 2020 08:05:42:113 PM DEBUG configureStorageDB:test get/set worked, this driver is ok...
Dec 16, 2020 08:05:42:115 PM INFO localforage driver:asyncStorage
Dec 16, 2020 08:05:42:115 PM INFO CloudSync: Syncing with cloud if enabled...
Dec 16, 2020 08:05:42:116 PM INFO user profile encrypted, decoding...
Dec 16, 2020 08:05:42:125 PM DEBUG deobfuscate: before:1470 after:5445 scheme:lzs
Dec 16, 2020 08:05:42:126 PM INFO Found valid local configuration, overwriting cloud settings...
Dec 16, 2020 08:05:42:140 PM INFO local data synced with cloud...
Dec 16, 2020 08:05:42:142 PM INFO Cloudsync operation complete, continuing...
Dec 16, 2020 08:05:42:144 PM INFO >>>>No data to import....
Dec 16, 2020 08:05:42:144 PM INFO Updating statusbar
Dec 16, 2020 08:05:42:149 PM INFO Retrieving language before init is called...
Dec 16, 2020 08:05:42:151 PM INFO App Version: 1.6.004
Dec 16, 2020 08:05:42:152 PM INFO No language set, switching to en
Dec 16, 2020 08:05:42:154 PM INFO Device Language is:en
Dec 16, 2020 08:05:42:155 PM INFO >>>>Language to be used:en
Dec 16, 2020 08:05:42:156 PM DEBUG isFirstUse returned: false
Dec 16, 2020 08:05:42:157 PM DEBUG last state=app.montage param=[object Object]
Dec 16, 2020 08:05:42:157 PM INFO Language file loaded, continuing with rest
Dec 16, 2020 08:05:42:158 PM INFO ZMData init: checking for stored variables & setting up log file
Dec 16, 2020 08:05:42:161 PM INFO Checking for new version updates...
Dec 16, 2020 08:05:42:228 PM INFO Setting up pause and resume handler AFTER language is loaded...
Dec 16, 2020 08:05:42:228 PM DEBUG Android detected, using cordova-multiwindow plugin for onStop/onStart instead
Dec 16, 2020 08:05:42:234 PM INFO user profile encrypted, decoding...
Dec 16, 2020 08:05:42:243 PM DEBUG deobfuscate: before:1470 after:5445 scheme:lzs
Dec 16, 2020 08:05:42:253 PM INFO Setting NVR init bandwidth to: lowbw
Dec 16, 2020 08:05:42:253 PM INFO NVR init retrieved store loginData, marking init as complete
Dec 16, 2020 08:05:42:254 PM DEBUG Setting cordova header X-ZmNinja to zmNinja_1.6.004
Dec 16, 2020 08:05:42:254 PM INFO >>>> Disabling strict SSL checking (turn off  in Dev Options if you can't connect)
Dec 16, 2020 08:05:42:255 PM INFO >>> Android: enabling inline image view for self signed certs
Dec 16, 2020 08:05:42:256 PM INFO Inside init-complete in app.js: All init over, going to portal login
Dec 16, 2020 08:05:42:259 PM DEBUG --> SSL is permissive, will allow any certs. Use at your own risk.
Dec 16, 2020 08:05:42:294 PM INFO Entering Portal Main
Dec 16, 2020 08:05:42:380 PM DEBUG Inside Portal login Enter handler
Dec 16, 2020 08:05:42:381 PM INFO User credentials are provided
Dec 16, 2020 08:05:42:381 PM INFO not checking for touchID
Dec 16, 2020 08:05:42:382 PM DEBUG unlock called with check PIN=true
Dec 16, 2020 08:05:42:382 PM DEBUG PIN code entered is correct, or there is no PIN set
Dec 16, 2020 08:05:42:382 PM INFO Cancelling zmAutologin timer
Dec 16, 2020 08:05:42:383 PM DEBUG We will relogin every 1800 seconds, token supported=false
Dec 16, 2020 08:05:42:384 PM DEBUG _doLogoutAndLogin: Clearing cookies
Dec 16, 2020 08:05:42:384 PM INFO Adding to chain stack: Home>https://I_HID_THIS_HOST/zm
Dec 16, 2020 08:05:42:385 PM INFO Fallback of Home is 
Dec 16, 2020 08:05:42:385 PM INFO reached end of chain loop
Dec 16, 2020 08:05:42:385 PM INFO No need to do a reachability test, as there are no fallbacks
Dec 16, 2020 08:05:42:390 PM INFO https://I_HID_THIS_HOST/zm=>Logging out of any existing ZM sessions...
Dec 16, 2020 08:05:42:391 PM DEBUG Logging out using Web method
Dec 16, 2020 08:05:42:460 PM DEBUG Inside _doLogin()
Dec 16, 2020 08:05:42:461 PM INFO Checking if reCaptcha is enabled in ZM...
Dec 16, 2020 08:05:42:465 PM DEBUG Resetting zmCookie...
Dec 16, 2020 08:05:42:466 PM INFO Token login not being used
Dec 16, 2020 08:05:42:467 PM INFO Doing fresh login to ZM
Dec 16, 2020 08:05:42:489 PM INFO ZM has recaptcha disabled - good
Dec 16, 2020 08:05:42:502 PM DEBUG ***  Inside native HTTP error for url:{"status":401,"url":"https://I_HID_THIS_HOST/zm/api/host/login.json","headers":{"date":"Thu, 17 Dec 2020 04:05:43 GMT","content-length":"198","server":"Apache/2.4.29 (Ubuntu)","keep-alive":"timeout=5, max=100","x-android-selected-protocol":"http/1.1","x-android-response-source":"NETWORK 401","x-android-received-millis":"1608177942501","x-android-sent-millis":"1608177942482","connection":"Keep-Alive","content-type":"application/json; charset=UTF-8"},"error":"\n{\"success\":false,\"data\":{\"name\":\"User not found\",\"message\":\"User not found\",\"url\":\"\\/zm\\/api\\/host\\/login.json\",\"exception\":{\"class\":\"UnauthorizedException\",\"code\":401,\"message\":\"User not found\"}}}"}
Dec 16, 2020 08:05:42:503 PM DEBUG Not intercepting as skipIntercept is true
Dec 16, 2020 08:05:42:505 PM INFO API based login not supported, need to use web scraping...
Dec 16, 2020 08:05:42:517 PM DEBUG obfuscate: original:5445 obfuscated:1470 scheme:lzs
Dec 16, 2020 08:05:42:518 PM DEBUG Logging in using old web-scrape method
Dec 16, 2020 08:05:42:790 PM DEBUG current version: 1.6.004 & available version 1.6.004
Dec 16, 2020 08:05:43:012 PM INFO zmAutologin successfully logged into Zoneminder
Dec 16, 2020 08:05:43:013 PM INFO Deferring auth key, as monitorId unknown
Dec 16, 2020 08:05:43:014 PM INFO Stream authentication construction: 
Dec 16, 2020 08:05:43:023 PM DEBUG auth-success broadcast:Successful
Dec 16, 2020 08:05:43:043 PM DEBUG PortalLogin: auth success
Dec 16, 2020 08:05:43:043 PM DEBUG getAPIversion called with https://I_HID_THIS_HOST/zm/api/host/getVersion.json?
Dec 16, 2020 08:05:43:069 PM DEBUG CACHE: found for key: cached_api_version with expiry of:86400s
Dec 16, 2020 08:05:43:072 PM DEBUG CACHE: cached value for key:cached_api_version is good as 25 <86400
Dec 16, 2020 08:05:43:073 PM DEBUG snapshot NOT supported in image.php
Dec 16, 2020 08:05:43:086 PM DEBUG obfuscate: original:5445 obfuscated:1470 scheme:lzs
Dec 16, 2020 08:05:43:087 PM DEBUG Setting server version to:1.30.4
Dec 16, 2020 08:05:43:087 PM DEBUG getAPI version succeeded with 1.30.4
Dec 16, 2020 08:05:43:089 PM INFO Got API version: 1.30.4
Dec 16, 2020 08:05:43:090 PM INFO First invocation of TimeZone, asking server
Dec 16, 2020 08:05:43:091 PM INFO EventSever: No Event Server present. Not initializing
Dec 16, 2020 08:05:43:095 PM DEBUG Transitioning state to: app.montage with param {"minimal":false,"isRefresh":false}
Dec 16, 2020 08:05:43:096 PM DEBUG NVR: Regenerating connkeys for all monitors at 1608177943096
Dec 16, 2020 08:05:43:097 PM INFO getMonitors:Loading all monitors
Dec 16, 2020 08:05:43:097 PM INFO Checking value of ZM_MIN_STREAMING_PORT for the first time
Dec 16, 2020 08:05:43:109 PM DEBUG ***  Inside native HTTP error for url:{"status":404,"url":"https://I_HID_THIS_HOST/zm/api/configs/viewByName/ZM_SHOW_PRIVACY.json","headers":{"date":"Thu, 17 Dec 2020 04:05:44 GMT","content-length":"218","server":"Apache/2.4.29 (Ubuntu)","keep-alive":"timeout=5, max=95","x-android-selected-protocol":"http/1.1","x-android-response-source":"NETWORK 404","x-android-received-millis":"1608177943104","x-android-sent-millis":"1608177943095","connection":"Keep-Alive","content-type":"application/json; charset=UTF-8"},"error":"{\"success\":false,\"data\":{\"name\":\"Invalid config\",\"message\":\"Invalid config\",\"url\":\"\\/zm\\/api\\/configs\\/viewByName\\/ZM_SHOW_PRIVACY.json\",\"exception\":{\"class\":\"NotFoundException\",\"code\":404,\"message\":\"Invalid config\"}}}"}
Dec 16, 2020 08:05:43:110 PM DEBUG ZM_SHOW_PRIVACY returned an error, it likely doesn't exist
Dec 16, 2020 08:05:43:133 PM DEBUG CACHE: found for key: cached_timezone with expiry of:86400s
Dec 16, 2020 08:05:43:134 PM DEBUG CACHE: cached value for key:cached_timezone is good as 25 <86400
Dec 16, 2020 08:05:43:134 PM DEBUG Timezone API response is:America/Los_Angeles
Dec 16, 2020 08:05:43:137 PM DEBUG CACHE: NOT found for:cached_multi_port reverting to HTTP
Dec 16, 2020 08:05:43:160 PM DEBUG ***  Inside native HTTP error for url:{"status":404,"url":"https://I_HID_THIS_HOST/zm/api/configs/viewByName/ZM_MIN_STREAMING_PORT.json","headers":{"date":"Thu, 17 Dec 2020 04:05:44 GMT","content-length":"224","server":"Apache/2.4.29 (Ubuntu)","keep-alive":"timeout=5, max=94","x-android-selected-protocol":"http/1.1","x-android-response-source":"NETWORK 404","x-android-received-millis":"1608177943151","x-android-sent-millis":"1608177943141","connection":"Keep-Alive","content-type":"application/json; charset=UTF-8"},"error":"{\"success\":false,\"data\":{\"name\":\"Invalid config\",\"message\":\"Invalid config\",\"url\":\"\\/zm\\/api\\/configs\\/viewByName\\/ZM_MIN_STREAMING_PORT.json\",\"exception\":{\"class\":\"NotFoundException\",\"code\":404,\"message\":\"Invalid config\"}}}"}
Dec 16, 2020 08:05:43:161 PM INFO CACHE: error with http get {"status":404,"url":"https://I_HID_THIS_HOST/zm/api/configs/viewByName/ZM_MIN_STREAMING_PORT.json","headers":{"date":"Thu, 17 Dec 2020 04:05:44 GMT","content-length":"224","server":"Apache/2.4.29 (Ubuntu)","keep-alive":"timeout=5, max=94","x-android-selected-protocol":"http/1.1","x-android-response-source":"NETWORK 404","x-android-received-millis":"1608177943151","x-android-sent-millis":"1608177943141","connection":"Keep-Alive","content-type":"application/json; charset=UTF-8"},"error":"{\"success\":false,\"data\":{\"name\":\"Invalid config\",\"message\":\"Invalid config\",\"url\":\"\\/zm\\/api\\/configs\\/viewByName\\/ZM_MIN_STREAMING_PORT.json\",\"exception\":{\"class\":\"NotFoundException\",\"code\":404,\"message\":\"Invalid config\"}}}"}
Dec 16, 2020 08:05:45:046 PM INFO --------->Setting up network state handlers....
Dec 16, 2020 08:05:45:047 PM INFO --------->Setting up global key handler...
Dec 16, 2020 08:05:59:689 PM DEBUG NVR: Regenerating connkeys for all monitors at 1608177959689
Dec 16, 2020 08:05:59:691 PM INFO getMonitors:Loading all monitors
Dec 16, 2020 08:05:59:691 PM INFO Checking value of ZM_MIN_STREAMING_PORT for the first time
Dec 16, 2020 08:05:59:705 PM DEBUG CACHE: NOT found for:cached_multi_port reverting to HTTP
Dec 16, 2020 08:05:59:791 PM DEBUG ***  Inside native HTTP error for url:{"status":404,"url":"https://I_HID_THIS_HOST/zm/api/configs/viewByName/ZM_MIN_STREAMING_PORT.json","headers":{"date":"Thu, 17 Dec 2020 04:06:00 GMT","content-length":"224","server":"Apache/2.4.29 (Ubuntu)","keep-alive":"timeout=5, max=100","x-android-selected-protocol":"http/1.1","x-android-response-source":"NETWORK 404","x-android-received-millis":"1608177959790","x-android-sent-millis":"1608177959776","connection":"Keep-Alive","content-type":"application/json; charset=UTF-8"},"error":"{\"success\":false,\"data\":{\"name\":\"Invalid config\",\"message\":\"Invalid config\",\"url\":\"\\/zm\\/api\\/configs\\/viewByName\\/ZM_MIN_STREAMING_PORT.json\",\"exception\":{\"class\":\"NotFoundException\",\"code\":404,\"message\":\"Invalid config\"}}}"}
Dec 16, 2020 08:05:59:794 PM INFO CACHE: error with http get {"status":404,"url":"https://I_HID_THIS_HOST/zm/api/configs/viewByName/ZM_MIN_STREAMING_PORT.json","headers":{"date":"Thu, 17 Dec 2020 04:06:00 GMT","content-length":"224","server":"Apache/2.4.29 (Ubuntu)","keep-alive":"timeout=5, max=100","x-android-selected-protocol":"http/1.1","x-android-response-source":"NETWORK 404","x-android-received-millis":"1608177959790","x-android-sent-millis":"1608177959776","connection":"Keep-Alive","content-type":"application/json; charset=UTF-8"},"error":"{\"success\":false,\"data\":{\"name\":\"Invalid config\",\"message\":\"Invalid config\",\"url\":\"\\/zm\\/api\\/configs\\/viewByName\\/ZM_MIN_STREAMING_PORT.json\",\"exception\":{\"class\":\"NotFoundException\",\"code\":404,\"message\":\"Invalid config\"}}}"}
Dec 16, 2020 08:06:31:383 PM INFO file location:file:///data/user/0/com.pliablepixels.zmninja_pro/files/zmNinjaLog.txt

Screenshots See attached screen shot. Screenshot_20201217-183311

Additional context The app has worked flawlessly for a long time before this problem. The only recent change was renewal of the certs (I use Lets Encrypt) and other services that use those certs work fine. The app authenicates Ok and I verified the APIs are configured correctly. The desktop version of the app on the Ubuntu machine running Zoneminder works Ok with the same configuration as the mobile app. Accessing ZoneMinder via my mobile's browser works Ok. I also tried clearing the API cache with no success. No difference if I try on WAN (LTE) vs WiFi on my local network.

welcome[bot] commented 3 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you follow the issue template or I may not respond.

pliablepixels commented 3 years ago

1.30 is not supported. Chances are your APIs don’t work. https://zmninja.readthedocs.io/en/latest/guides/FAQ.html#what-is-the-minimum-supported-version-of-zoneminder-android-and-ios

viveksjain commented 3 years ago

Took me an embarassingly long time to figure this out :). Would be really cool if zmNinja could check server version and display appropriate error if it's too old.

pliablepixels commented 3 years ago

Here is the weird part. I actually test with 1.30.4 and it works (except for thumbnails). I just don't support it. Which version are you using? I'd love to get a test acct with your ZM instance for a few days to figure out why it doesn't work and which version.

viveksjain commented 3 years ago

I actually upgraded to latest version, but I believe I was previously using 1.29 with this docker image https://github.com/aptalca/docker-zoneminder/blob/v1.29/README.md