invalid date and negative event duration times

Forum for questions and support relating to the 1.24.x releases only.
Locked
ehb
Posts: 9
Joined: Mon Sep 12, 2011 2:22 pm

invalid date and negative event duration times

Post by ehb »

Hi

I see these strange record values scattered when in live views window (two different machines, same problem). Some times they also show in filter window, say, events for the last 24h.
  • 10521 Event-10521 1969-12-31 21:00:00 -13769113.96 12/2 16/17 X
    10508 Event-10508 1969-12-31 21:00:00 -13769714.28 79/48 13/29 X
These are from one monitor (modect) and happened about one hour ago.

Note the date is 1969 (zero seconds epoc ? since my time zone is UTC-3 ?). About the event duration I have no clue about this negative number (maybe some other zero representation).

Any clues on what to do? Is this harmful?
i've been seen MySQL eating 100% of CPU for about 30 seconds over and over aganin leading ZM to death for a few minutes. Any relation??

These are sorted by CPU utilization:

Code: Select all

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
4374 mysql     20   0  249m  36m 4408 S 96.2  7.5 261:45.40 mysqld
10892 www-data  20   0  189m  17m  11m S  0.7  3.5   0:21.52 nph-zms
 9877 www-data  20   0  186m  13m  11m S  0.3  2.8   0:16.80 zmc
 9879 www-data  20   0  185m  13m  11m S  0.3  2.8   0:36.27 zma
 9883 www-data  20   0  185m  13m  11m S  0.3  2.8   0:37.34 zma
 9885 www-data  20   0  186m  14m  11m S  0.3  2.8   0:19.45 zmc
10428 www-data  20   0  140m  11m 3136 S  0.3  2.3   0:00.83 apache2
10474 www-data  20   0  185m  13m  11m S  0.3  2.8   0:30.77 zma
10746 www-data  20   0  190m  13m  11m S  0.3  2.8   0:10.34 zmc
11477 www-data  20   0  186m  13m  11m S  0.3  2.8   0:03.15 zmc
11662 root      20   0 19224 1396 1028 R  0.3  0.3   0:00.71 top



Environment: Ubuntu 10.04 LTS, ZM 1.24.2
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: invalid date and negative event duration times

Post by bb99 »

Symptoms point to a corrupt database: http://www.zoneminder.com/wiki/index.ph ... atabase.3F
ehb
Posts: 9
Joined: Mon Sep 12, 2011 2:22 pm

Re: invalid date and negative event duration times

Post by ehb »

Nope!! Already did the phpmyadmin procedure before my first post.
Database was OK.Same behavior persists.

ZM is jamming so bad I can not even open Options to increase DEBUG. I got a blank page and Firefox keeps that doted ring spinning "ad infinitum".

Have to mention that this jam occurs every time I click to watch one of those "invalid time/negative duration" events.Not only those events. there are some I could not relate that causes ZM to stall. (one may say: DON'T Click those events!! :lol: )

I also installed mytop and I can see an UPDATE and a SELECT running (100% CPU) for a dozen or so seconds, then mysql drops to 0.3% CPU but ZM is still dead. In fact ZM kicks me out and I have to login again after a few minutes later.

mytop (URL not admited here by phpBB, "too spamy" it said!) reports no SLOW QUERIES. Ever.

Nothing (relevant) at the apache's error log either.

Any other hints? Any test I can run?

Meanwhile I am digging a lots of holes hunting the (imaginary?) bug.
Maybe I am lucky!
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: invalid date and negative event duration times

Post by bb99 »

For the "update" part of the cpu at 100% untick Options::system CHECK_FOR_UPDATES (had an issue with this myself in 1.23.3). A cheap UPS fixed the corrupted events for me several years ago with no repeats. I had to delete all those events by ticking them, selecting delete and letting ZMAudit do it's thing.
ehb
Posts: 9
Joined: Mon Sep 12, 2011 2:22 pm

Re: invalid date and negative event duration times

Post by ehb »

Oopps! the UPDATE I am refering to is the MySQL update due to events. But just to not let you without an answer, CHECK_FOR_UPDATES is unchecked since installation.

About the UPS, I don't think it will help. As you can see in my first post the "record corruption" is too stable (the "corruption" is the same in every record) to be caused by a power glitch.

Every record has its Time field set to zero (seconds since 1970-01-01 00:00:00 UTC) and Duration set to some always increasing very big negative numbers. All the other record fields make sense.

I am not a PHP expert but I think that something happened to some sql query that is leading my PHP session jammed (this is the next hole I'm gonna dig). When logged in again after ZM has kicked me out makes everything works ok until the next time.
ehb
Posts: 9
Joined: Mon Sep 12, 2011 2:22 pm

Re: invalid date and negative event duration times

Post by ehb »

Ok. I can confirm that ZM engine is not dead. My PHP session is dead. I can login and see things working from another machine while mine (session) just give me blank windows.
To close and reopen the FireFox tab does not restore the session. I have to shutdown FF.

As I said before I am not a PHP expert.
So, how can this kind of "error" be debugged?
ehb
Posts: 9
Joined: Mon Sep 12, 2011 2:22 pm

Re: invalid date and negative event duration times

Post by ehb »

Here we go again. Let me ask you guys a favor.
Please run a filter like this: in main window click "Filter" -> choose "Duration" -> "less than" -> "0" (zero) -> submit. (you may limit to the first N results if you like)
Please tell me if you see a list of record(s) like this:

Code: Select all

Id 	Name         Monitor  Cause 	Time(^)    Duration  ....
9782 Event-9782  blablabla Motion 12/31 21:00:00 -13852313.62  ....
7837 Event-7837  blablabla Motion 12/31 21:00:00 -14145614.41 ....
...
(please note the Time and Duration unusual values)

If you click on any of these events, does they show all of the frames till the last one or freezes at some frame?

Thanx.
Locked