Closed lucasnz closed 3 years ago
I've finally managed to capture multiple notifications with debug logs running. It appears to me that active_connections has the event in it twice. See snippet of debug log below. I have a copy of the complete log that I'm happy to email to you. Do we need to check if an eid is already in active_connections before adding it (again)?
Active connections actually is a list of 'connections' (Web, tokens, mqtt) events need to be sent to and not related to eids. What might be happening here is that token is first loaded from tokens.txt. Then the same device owning that token connects to the ES. What should be happening is the old connection is updated with the new details. It is possible there is something wrong going on there under a specific condition that we need to track down. I don't see it happening here, but it is possible a combination of events is causing that. If you are able to nail down a set of conditions that triggers this, it would be super useful.
Any suggestions on how to go about this? Delete the tokens file then restart ES? A couple of points:
{"tokens":{"removed":{"pushstate":"enabled","appversion":"1.6.007","intlist":"0,0,0","invocations":{"count":"135","at":"2"},"platform":"android","monlist":"1,2,3"}}}
Yes, maybe try this:
If you get only one, then switch to the next device if you are using multiple
Basically, trying to see when does it put two of the same tokens in the list
I'm only using a single device. I'll delete the token file and restart ES. It seems to take a few hours before multiple notifications start appearing though...
I'm not really sure what to report. I left the service running for about a week and got up to about 24 notifications per event today. I've just restarted (after upgrading ES and websockets). Is there an event I can grep for that is likely triggering when this occurs, or can I add some logging (where would you put it)? Cheers, Luke
That is completely nuts. I have 0 events recurring. Let me look at the logs I print to see what we can pinpoint on.
So, it been two days since the last comment (when I upgraded ES and websockets) and I haven't touched anything else - I've not had a single duplicate notification. Could it have been an issue with the version of websockets I had installed?? Or did you change something in ES that may have fixed it? So weird. I'll keep monitoring, but given it's working I'm afraid to touch it much now...
You may want to try https://github.com/pliablepixels/zmeventnotification/tree/duplicate_tokens -> I've added logs to print out when tokens are duplicated in active_connections. The correct situation should be that once in a while you may duplicate tokens (especially in zmNinja connects) but it should then clear them up. If you see this building up, then lets look at what triggers led to this situation looking at previous logs. https://github.com/pliablepixels/zmeventnotification/commit/3c23336fed7b6371cb29c5f7897210ef14f1d2ad
If there are no duplicate tokens, you will not see a log. This is set to debug level 4.
I updated to the latest master on 21 Mar (which seems to include the above commit). I've now been running for 11 days without duplicate (9 days with the 21 March commit) without a single duplicate. Perhaps it's time to close out this issue. No idea what has resolved it.
That may be because I added duplicate token check (which shouldn't happen in the first place). If you are seeing occurs: <X> times
in your logs, then duplicates are still occurring and I am removing them. I'd love to see history logs if this happens.
I have debug logs (/var/log/zm/zmeventnotification.log*) going back until the 24th. The word "occurs" does not appear in the logs. I'll keep looking. It seemed to resolve on the 18th - when I installed the ES update that warned I had an old version of websockets, before the duplicate tokens commit.
Hmm, interesting. Anyway, I'll leave it to you to decide when to close it.
Issue has not reoccurred. Closing...
Event Server version 6.1.14
Hooks version (if you are using Object Detection) app:6.1.14, pyzm:0.3.36
The version of ZoneMinder you are using: 1.34.23
What is the nature of your issue Multiple notifications received occasionally.
Details I've finally managed to capture multiple notifications with debug logs running. It appears to me that active_connections has the event in it twice. See snippet of debug log below. I have a copy of the complete log that I'm happy to email to you. Do we need to check if an eid is already in active_connections before adding it (again)?
Debug Logs