Having to delete tokens.txt every zmes restart

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Having to delete tokens.txt every zmes restart

Post by sphillips »

so im having a weird issue which the solution i could not find online, when first setting up tokens.txt events are sent and logs show no errors however when i restart zmeventnotification.pl events are no longer sent with errors such as
DBG-1:2022-10-24,03:41:12 PARENT: ES invoked manually. Will handle restarts ourselves
DBG-2:2022-10-24,03:41:12 PARENT: Parent<--Child pipe ready
INF:2022-10-24,03:41:12 PARENT: Event Notification daemon v 6.1.28 starting
10/24/2022 03:41:12.617856 zmeventnotification[41341].INF [main:1006] [PARENT: Event Notification daemon v 6.1.28 starting]
DBG-1:2022-10-24,03:41:12 PARENT: Initializing FCM tokens...
Use of uninitialized value $monlist in anonymous hash ({}) at /usr/bin/zmeventnotification.pl line 2867.
Use of uninitialized value $intlist in anonymous hash ({}) at /usr/bin/zmeventnotification.pl line 2867.
Use of uninitialized value $platform in anonymous hash ({}) at /usr/bin/zmeventnotification.pl line 2867.
Use of uninitialized value $pushstate in anonymous hash ({}) at /usr/bin/zmeventnotification.pl line 2867.
Use of uninitialized value $appversion in anonymous hash ({}) at /usr/bin/zmeventnotification.pl line 2867.
Odd number of elements in anonymous hash at /usr/bin/zmeventnotification.pl line 2867.
Odd number of elements in anonymous hash at /usr/bin/zmeventnotification.pl line 2867.
...................
DBG-2:2022-10-24,03:41:17 PARENT: ----------> Tick START (active forks:0, total forks:0, active hooks: 0 running for:1 min)<--------------
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2286.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2286.
Use of uninitialized value in numeric ne (!=) at /usr/bin/zmeventnotification.pl line 2315.
Use of uninitialized value in numeric ne (!=) at /usr/bin/zmeventnotification.pl line 2315.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2318.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2318.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2321.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2321.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2324.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2324.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2327.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2327.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2330.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2330.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2336.
Use of uninitialized value in numeric eq (==) at /usr/bin/zmeventnotification.pl line 2336.
DBG-2:2022-10-24,03:41:17 PARENT: After tick: TOTAL: 2 , ES_CONTROL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
DBG-2:2022-10-24,03:41:17 PARENT: There are 0 active child forks & 0 zm_detect processes running...
DBG-2:2022-10-24,03:41:17 PARENT: checkEvents() new events found=0
DBG-2:2022-10-24,03:41:17 PARENT: There are 0 new Events to process
also
│zmeventnotification[35715]: ERR [|----> FORK:Frente (2), eid:37354 interval not found for mid 2]
│zmeventnotification[35715]: ERR [|----> FORK:Frente (2), eid:37354 FCM push message Error:400 Bad Request]
if i delete tokens.txt and create new entries all works fine till i restart zmeventnotification.pl

ENTIRE LOG
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Re: Having to delete tokens.txt every zmes restart

Post by sphillips »

ok just tested an older version of zmeventnotification.pl and all works fine, might be problems with the lastest changes to the file.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Having to delete tokens.txt every zmes restart

Post by Magic919 »

Development of ZMES stopped last year. I’d you have a workaround, that’s good.
-
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Re: Having to delete tokens.txt every zmes restart

Post by sphillips »

Magic919 wrote: Mon Oct 24, 2022 4:39 pm Development of ZMES stopped last year. I’d you have a workaround, that’s good.
zmes development was not dropped, the original developer gave it up however zoneminder team picked it up.

a heads up the last changes on zmeventnotification seems to break zmeventnotification.pl
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Having to delete tokens.txt every zmes restart

Post by Magic919 »

Version 6.1.28 is the last version Asker did.

I can see Isaac has merged a PR recently and maybe that's broken what you are running.

I'll stick with the old Asker version.
-
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Having to delete tokens.txt every zmes restart

Post by iconnor »

Was it just the last commit? Most of the changes have been white space changes etc. I don't see how the last commit could have any effect.

Mine here isn't complaining but then I'm not using fcm... perhaps I'll turn it back on
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Re: Having to delete tokens.txt every zmes restart

Post by sphillips »

since u asked i tested the last 2 commits and issue still there for me.

i found that at this commit i start to see those "Use of uninitialized value" however fcm is working but with errors
│zmeventnotification[557378]: ERR [Error sending FCM for token:]
│zmeventnotification[557378]: ERR [Error value =InvalidRegistration]
│zmeventnotification[557378]: ERR [|----> FORK:SegundoAndar (3), eid:38415 interval not found for mid 3]
this commit does not show any errors and all works

i dunno if somebody could confirm same would be better, i cant help much beyond telling my experience, im using ubuntu 22.04.
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Having to delete tokens.txt every zmes restart

Post by iconnor »

Since you are willing to try different commits, I might suggest you try git bisect to actually figure which commit broke it.

I am looking into a different issue that I am seeing now that I have turn on FCM.
Post Reply