Skip to content
This repository was archived by the owner on Jun 14, 2026. It is now read-only.
This repository was archived by the owner on Jun 14, 2026. It is now read-only.

zmNinja issue when connected via Mobile data #850

@eaglesvr

Description

@eaglesvr

Platform & OS Version

 Android 8.0.0

The version of zmNinja you are reporting:

1.3.078 

The version and OS of ZoneMinder you are using:

 1.32.3, Ubuntu 18.04 

Device details:

Huawei Mate SE

What is the nature of your issue

? Bug | Question

Details
ZmNinja works via wifi but fails to connect via mobile data. The connection either fails on start with "API Access Error" message or it goes further and retrieves monitors list, then shows blank images.
When connection is switched to wifi everything work. Mobile data connection test shows normal speed for LTE/4G. ZM via Web/chrome works on mobile network. ZM API test via 2 tabs in chrome works on mobile network as well.
The app worked until the issue with the recent ZM 1.33 update after which API got broken and I decided to roll ZM back. I downgraded ZM to 1.32. API looks working- Home Assistant cameras are workable. Reinstalling ZmNinja did not help.
I tried to play with ZM settings with no avail.
Looking at the Nginx log I found that api call getVersion.json intermittently returns 401 whereas other api calls are 200 Ok
Any ideas about what to try more?

zmNinja Debug Logs

2019-09-21T00:25:29.612Z INFO ******* app .run device ready
Sep 20, 2019 07:25:29 PM INFO Device is ready
Sep 20, 2019 07:25:29 PM INFO You are running on android
Sep 20, 2019 07:25:29 PM DEBUG Inside configureStorageDB
Sep 20, 2019 07:25:29 PM DEBUG configureStorageDB: trying order:["asyncStorage","localStorageWrapper"]
Sep 20, 2019 07:25:29 PM INFO configureStorageDB:localforage driver for storage:asyncStorage
Sep 20, 2019 07:25:29 PM DEBUG configureStorageDB:Making sure this storage driver works...
Sep 20, 2019 07:25:29 PM DEBUG configureStorageDB:test get/set worked, this driver is ok...
Sep 20, 2019 07:25:29 PM INFO localforage driver:asyncStorage
Sep 20, 2019 07:25:29 PM INFO CloudSync: Syncing with cloud if enabled...
Sep 20, 2019 07:25:29 PM INFO user profile encrypted, decoding...
Sep 20, 2019 07:25:29 PM INFO Cloud sync is disabled, exiting...
Sep 20, 2019 07:25:29 PM INFO Cloudsync operation complete, continuing...
Sep 20, 2019 07:25:29 PM INFO >>>>No data to import....
Sep 20, 2019 07:25:29 PM INFO Updating statusbar
Sep 20, 2019 07:25:29 PM INFO Retrieving language before init is called...
Sep 20, 2019 07:25:29 PM INFO App Version: 1.3.078
Sep 20, 2019 07:25:29 PM INFO No language set, switching to en
Sep 20, 2019 07:25:29 PM INFO Device Language is:en
Sep 20, 2019 07:25:29 PM INFO >>>>Language to be used:en
Sep 20, 2019 07:25:29 PM DEBUG isFirstUse returned: false
Sep 20, 2019 07:25:29 PM DEBUG last state=app.montage param=[object Object]
Sep 20, 2019 07:25:29 PM INFO Language file loaded, continuing with rest
Sep 20, 2019 07:25:29 PM INFO ZMData init: checking for stored variables & setting up log file
Sep 20, 2019 07:25:29 PM INFO Checking for new version updates...
Sep 20, 2019 07:25:29 PM INFO Checking for news updates
Sep 20, 2019 07:25:30 PM INFO Setting up pause and resume handler AFTER language is loaded...
Sep 20, 2019 07:25:30 PM DEBUG Android detected, using cordova-multiwindow plugin for onStop/onStart instead
Sep 20, 2019 07:25:30 PM INFO user profile encrypted, decoding...
Sep 20, 2019 07:25:30 PM INFO Setting NVR init bandwidth to: lowbw
Sep 20, 2019 07:25:30 PM INFO NVR init retrieved store loginData
Sep 20, 2019 07:25:30 PM INFO >>>> Disabling strict SSL checking (turn off  in Dev Options if you can't connect)
Sep 20, 2019 07:25:30 PM INFO >>> Android: enabling inline image view for self signed certs
Sep 20, 2019 07:25:30 PM INFO Inside init-complete in app.js: All init over, going to portal login
Sep 20, 2019 07:25:30 PM DEBUG --> SSL is permissive, will allow any certs. Use at your own risk.
Sep 20, 2019 07:25:30 PM INFO Entering Portal Main
Sep 20, 2019 07:25:30 PM DEBUG Inside Portal login Enter handler
Sep 20, 2019 07:25:30 PM INFO User credentials are provided
Sep 20, 2019 07:25:30 PM INFO not checking for touchID
Sep 20, 2019 07:25:30 PM DEBUG unlock called with check PIN=true
Sep 20, 2019 07:25:30 PM DEBUG PIN code entered is correct, or there is no PIN set
Sep 20, 2019 07:25:30 PM INFO Cancelling zmAutologin timer
Sep 20, 2019 07:25:30 PM DEBUG We will relogin every 1800 seconds, token supported=false
Sep 20, 2019 07:25:30 PM DEBUG _doLogoutAndLogin: Clearing cookies
Sep 20, 2019 07:25:30 PM INFO Adding to chain stack: Home>https://eaglesvr.ddns.net/zm
Sep 20, 2019 07:25:30 PM INFO Fallback of Home is 
Sep 20, 2019 07:25:30 PM INFO reached end of chain loop
Sep 20, 2019 07:25:30 PM INFO No need to do a reachability test, as there are no fallbacks
Sep 20, 2019 07:25:30 PM INFO https://eaglesvr.ddns.net/zm=>Logging out of any existing ZM sessions...
Sep 20, 2019 07:25:30 PM DEBUG Logging out using API method
Sep 20, 2019 07:25:31 PM DEBUG ***  Inside native HTTP error for url:https://medium.com/zmninja/latest?format=json
Sep 20, 2019 07:25:31 PM DEBUG current version: 1.3.078 & available version 1.3.078
Sep 20, 2019 07:25:31 PM DEBUG Logout returned... 
Sep 20, 2019 07:25:31 PM DEBUG Inside _doLogin()
Sep 20, 2019 07:25:31 PM INFO Checking if reCaptcha is enabled in ZM...
Sep 20, 2019 07:25:31 PM DEBUG Resetting zmCookie...
Sep 20, 2019 07:25:31 PM INFO Token login not being used
Sep 20, 2019 07:25:31 PM INFO Doing fresh login to ZM
Sep 20, 2019 07:25:32 PM INFO --------->Setting up network state handlers....
Sep 20, 2019 07:25:32 PM INFO --------->Setting up global key handler...
Sep 20, 2019 07:25:33 PM DEBUG API based login returned. 
Sep 20, 2019 07:25:33 PM DEBUG Setting server version to:1.32.3
Sep 20, 2019 07:25:33 PM INFO Could not recover token details, trying old auth credentials
Sep 20, 2019 07:25:33 PM INFO Stream authentication construction: &auth=<removed>
Sep 20, 2019 07:25:33 PM INFO Successfully logged into Zoneminder via API
Sep 20, 2019 07:25:33 PM DEBUG auth-success broadcast:Successful
Sep 20, 2019 07:25:33 PM DEBUG PortalLogin: auth success
Sep 20, 2019 07:25:33 PM DEBUG getAPIversion called with https://eaglesvr.ddns.net/zm/api/host/getVersion.json?&auth=<removed>
Sep 20, 2019 07:25:33 PM INFO ZM has recaptcha disabled - good
Sep 20, 2019 07:25:35 PM DEBUG ***  Inside native HTTP error for url:https://eaglesvr.ddns.net/zm/api/host/getVersion.json?&auth=<removed>
Sep 20, 2019 07:25:35 PM DEBUG ** Native intercept: Got 401, going to try logging in
Sep 20, 2019 07:25:35 PM INFO Token login not being used
Sep 20, 2019 07:25:35 PM INFO Doing fresh login to ZM
Sep 20, 2019 07:25:35 PM DEBUG ***  Inside native HTTP error for url:https://eaglesvr.ddns.net/zm/api/configs/viewByName/ZM_AUTH_HASH_LOGINS.json?&auth=<removed>
Sep 20, 2019 07:25:35 PM DEBUG ** Native intercept: Got 401, going to try logging in
Sep 20, 2019 07:25:35 PM INFO Token login not being used
Sep 20, 2019 07:25:35 PM INFO Doing fresh login to ZM
Sep 20, 2019 07:25:37 PM DEBUG API based login returned. 
Sep 20, 2019 07:25:37 PM DEBUG Setting server version to:1.32.3
Sep 20, 2019 07:25:37 PM INFO Could not recover token details, trying old auth credentials
Sep 20, 2019 07:25:37 PM INFO Stream authentication construction: &auth=<removed>
Sep 20, 2019 07:25:37 PM INFO Successfully logged into Zoneminder via API
Sep 20, 2019 07:25:37 PM DEBUG ** Native, tokens generated, retrying old request with skipIntercept = true
Sep 20, 2019 07:25:37 PM DEBUG API based login returned. 
Sep 20, 2019 07:25:37 PM DEBUG Setting server version to:1.32.3
Sep 20, 2019 07:25:37 PM INFO Could not recover token details, trying old auth credentials
Sep 20, 2019 07:25:37 PM INFO Stream authentication construction: &auth=<removed>
Sep 20, 2019 07:25:37 PM INFO Successfully logged into Zoneminder via API
Sep 20, 2019 07:25:37 PM DEBUG ** Native, tokens generated, retrying old request with skipIntercept = true
Sep 20, 2019 07:25:39 PM DEBUG getAPIversion error handler {"status":401,"url":"https://eaglesvr.ddns.net/zm/api/host/getVersion.json?&auth=<removed>&amp;auth=64e05943b5eb8225eddc9f5e02dca074\",\n        \"exception\": {\n            \"class\": \"UnauthorizedException\",\n            \"code\": 401,\n            \"message\": \"Invalid Auth Key\",\n            \"trace\": [\n                \"#0 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Event\\/CakeEventManager.php(243): AppController->beforeFilter(Object(CakeEvent))\",\n                \"#1 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Controller\\/Controller.php(677): CakeEventManager->dispatch(Object(CakeEvent))\",\n                \"#2 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Routing\\/Dispatcher.php(189): Controller->startupProcess()\",\n                \"#3 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Routing\\/Dispatcher.php(167): Dispatcher->_invoke(Object(HostController), Object(CakeRequest))\",\n                \"#4 \\/usr\\/share\\/zoneminder\\/www\\/api\\/app\\/webroot\\/index.php(107): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))\",\n                \"#5 {main}\"\n            ]\n        },\n        \"queryLog\": []\n    }\n}"}
Sep 20, 2019 07:25:39 PM DEBUG Setting server version to:
Sep 20, 2019 07:25:39 PM DEBUG **EXCEPTION**ReferenceError: conf is not defined caused by undefined
Sep 20, 2019 07:25:39 PM INFO API Error handler: going to login getAPI returned error: "-1.-1.-1"
Sep 20, 2019 07:25:39 PM DEBUG Doing the Aaron Hack after 1 sec....
Sep 20, 2019 07:25:40 PM DEBUG _doLogoutAndLogin: Clearing cookies
Sep 20, 2019 07:25:40 PM INFO Adding to chain stack: Home>https://eaglesvr.ddns.net/zm
Sep 20, 2019 07:25:40 PM INFO Fallback of Home is 
Sep 20, 2019 07:25:40 PM INFO reached end of chain loop
Sep 20, 2019 07:25:40 PM INFO No need to do a reachability test, as there are no fallbacks
Sep 20, 2019 07:25:40 PM INFO https://eaglesvr.ddns.net/zm=>Logging out of any existing ZM sessions...
Sep 20, 2019 07:25:40 PM DEBUG Logging out using Web method
Sep 20, 2019 07:25:41 PM DEBUG Inside _doLogin()
Sep 20, 2019 07:25:41 PM INFO Checking if reCaptcha is enabled in ZM...
Sep 20, 2019 07:25:41 PM DEBUG Resetting zmCookie...
Sep 20, 2019 07:25:41 PM INFO Token login not being used
Sep 20, 2019 07:25:41 PM INFO Doing fresh login to ZM
Sep 20, 2019 07:25:43 PM DEBUG API based login returned. 
Sep 20, 2019 07:25:43 PM DEBUG Setting server version to:1.32.3
Sep 20, 2019 07:25:43 PM INFO Could not recover token details, trying old auth credentials
Sep 20, 2019 07:25:43 PM INFO Stream authentication construction: &auth=<removed>
Sep 20, 2019 07:25:43 PM INFO Successfully logged into Zoneminder via API
Sep 20, 2019 07:25:43 PM DEBUG auth-success broadcast:Successful
Sep 20, 2019 07:25:43 PM DEBUG 2nd auth login worked
Sep 20, 2019 07:25:43 PM DEBUG getAPIversion called with https://eaglesvr.ddns.net/zm/api/host/getVersion.json?&auth=<removed>
Sep 20, 2019 07:25:43 PM INFO ZM has recaptcha disabled - good
Sep 20, 2019 07:25:44 PM DEBUG ***  Inside native HTTP error for url:https://eaglesvr.ddns.net/zm/api/host/getVersion.json?&auth=<removed>
Sep 20, 2019 07:25:44 PM DEBUG getAPIversion error handler {"status":401,"url":"https://eaglesvr.ddns.net/zm/api/host/getVersion.json?&auth=<removed>&amp;auth=<removed>\",\n        \"exception\": {\n            \"class\": \"UnauthorizedException\",\n            \"code\": 401,\n            \"message\": \"Invalid Auth Key\",\n            \"trace\": [\n                \"#0 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Event\\/CakeEventManager.php(243): AppController->beforeFilter(Object(CakeEvent))\",\n                \"#1 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Controller\\/Controller.php(677): CakeEventManager->dispatch(Object(CakeEvent))\",\n                \"#2 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Routing\\/Dispatcher.php(189): Controller->startupProcess()\",\n                \"#3 \\/usr\\/share\\/zoneminder\\/www\\/api\\/lib\\/Cake\\/Routing\\/Dispatcher.php(167): Dispatcher->_invoke(Object(HostController), Object(CakeRequest))\",\n                \"#4 \\/usr\\/share\\/zoneminder\\/www\\/api\\/app\\/webroot\\/index.php(107): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))\",\n                \"#5 {main}\"\n            ]\n        },\n        \"queryLog\": []\n    }\n}"}
Sep 20, 2019 07:25:44 PM DEBUG Setting server version to:
Sep 20, 2019 07:25:44 PM DEBUG 2nd auth API failed, going to login
Sep 20, 2019 07:25:44 PM INFO Portal login:invalid api
Sep 20, 2019 07:25:44 PM INFO In Auth State trans: Not logged in, requested to go to {"data":{"requireLogin":false},"cache":false,"url":"/invalidapi","templateUrl":"templates/invalidapi.html","controller":"zmApp.InvalidApiCtrl","name":"app.invalidapi"}
Sep 20, 2019 07:25:53 PM INFO file location:file:///data/user/0/com.pliablepixels.zmninja_pro/files/zmNinjaLog.txt

Zoneminder Logs (if applicable)

Zoneminder syslogs at the time the error occurs. Please add context to the logs (don't just add 1-2 lines)
<insert debug logs here, please make sure they are within the ``` quotes so they are formatted properly>

Web Server Error Logs (if applicable, especially for streaming errors or API error)

173.209.207.203 - - [20/Sep/2019:22:30:04 -0500] "GET /zm/api/host/logout.json HTTP/2.0" 200 22 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.200 - - [20/Sep/2019:22:30:05 -0500] "GET /zm HTTP/2.0" 301 178 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.202 - - [20/Sep/2019:22:30:06 -0500] "POST /zm/api/host/login.json HTTP/2.0" 200 138 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.200 - - [20/Sep/2019:22:30:06 -0500] "GET /zm/ HTTP/2.0" 200 49604 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.202 - - [20/Sep/2019:22:30:08 -0500] "GET /zm/api/configs/viewByName/ZM_AUTH_HASH_LOGINS.json?&auth=e9029d8920547b36519993ff8753b473 HTTP/2.0" 200 46 "-" "Dalvik/2$
173.209.207.201 - - [20/Sep/2019:22:30:08 -0500] "GET /zm/api/host/getVersion.json?&auth=e9029d8920547b36519993ff8753b473 HTTP/2.0" 401 1219 "-" "Dalvik/2.1.0 (Linux; U; Andro$
173.209.207.200 - - [20/Sep/2019:22:30:10 -0500] "POST /zm/api/host/login.json HTTP/2.0" 200 138 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.202 - - [20/Sep/2019:22:30:12 -0500] "GET /zm/api/host/getVersion.json?&auth=e9029d8920547b36519993ff8753b473 HTTP/2.0" 200 52 "-" "Dalvik/2.1.0 (Linux; U; Android$
173.209.207.200 - - [20/Sep/2019:22:32:13 -0500] "GET /zm/api/host/logout.json HTTP/2.0" 200 22 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.201 - - [20/Sep/2019:22:32:14 -0500] "GET /zm HTTP/2.0" 301 178 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.200 - - [20/Sep/2019:22:32:14 -0500] "POST /zm/api/host/login.json HTTP/2.0" 200 138 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.201 - - [20/Sep/2019:22:32:15 -0500] "GET /zm/ HTTP/2.0" 200 49601 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.203 - - [20/Sep/2019:22:32:16 -0500] "GET /zm/api/configs/viewByName/ZM_AUTH_HASH_LOGINS.json?&auth=8da48e495e59cbd8e8b929f991f5be65 HTTP/2.0" 401 1271 "-" "Dalvik$
173.209.207.202 - - [20/Sep/2019:22:32:17 -0500] "GET /zm/api/host/getVersion.json?&auth=8da48e495e59cbd8e8b929f991f5be65 HTTP/2.0" 401 1219 "-" "Dalvik/2.1.0 (Linux; U; Andro$
173.209.207.200 - - [20/Sep/2019:22:32:17 -0500] "POST /zm/api/host/login.json HTTP/2.0" 200 138 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.202 - - [20/Sep/2019:22:32:17 -0500] "POST /zm/api/host/login.json HTTP/2.0" 200 138 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.200 - - [20/Sep/2019:22:32:17 -0500] "GET /zm/api/configs/viewByName/ZM_AUTH_HASH_LOGINS.json?&auth=8da48e495e59cbd8e8b929f991f5be65 HTTP/2.0" 200 46 "-" "Dalvik/2$
173.209.207.203 - - [20/Sep/2019:22:32:18 -0500] "GET /zm/api/host/getVersion.json?&auth=8da48e495e59cbd8e8b929f991f5be65 HTTP/2.0" 401 1219 "-" "Dalvik/2.1.0 (Linux; U; Andro$
173.209.207.201 - - [20/Sep/2019:22:32:20 -0500] "POST /zm/index.php?view=console HTTP/2.0" 200 5633 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.202 - - [20/Sep/2019:22:32:21 -0500] "GET /zm HTTP/2.0" 301 178 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.200 - - [20/Sep/2019:22:32:21 -0500] "POST /zm/api/host/login.json HTTP/2.0" 200 138 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"
173.209.207.202 - - [20/Sep/2019:22:32:21 -0500] "GET /zm/ HTTP/2.0" 200 49603 "-" "Dalvik/2.1.0 (Linux; U; Android 8.0.0; BND-L34 Build/HUAWEIBND-L34)"

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions