Zoneminder stops and won't restart
Posted: Fri Aug 10, 2018 3:41 am
Hi all,
I've been having with ZM 1.30.4 stopping after a couple of days, and then refusing to start again. I've turned on all the debugging logs, and the best I can gather is that the zmc processes don't want to restart, or maybe it's an issue with MySQL. I see a lot of MySQL errors, but it's not clear to me if they are due to zmc crashing while trying to start, or MySQL issues internally. Restarting the machine sometimes works to get it running again, but sometimes not.
I'm running within an Ubuntu 16.04 VM in VMWare Fusion on Mac with 4 cores and 4GB of RAM (out of 8GB total) dedicated to the VM. I was going to move to bare metal (4 cores, 4 GB RAM) that just arrived today, but want to solve the current stability issues first. In terms of cameras, I have 4 Foscams on FFMPEG, each with a low-res monitor running Modect (2 zones - normal and exclusive) and linked to a high-res monitor running Nodect.
As far as I can tell from looking at top output, the machine doesn't seem to be running out of RAM, and for the most part runs at under .5 load. Sometimes I see it spike as it seems to be doing some sort of Ubuntu upgrades, but it's generally very low.
Any help would be much appreciated, as I would love to have this be a more stable platform. Everything about it is fantastic other than these stability issues.
MySQL error.log:
syslog
top output:
zma_m3.log
zmc logs contain nothing around this timestamp. the other zma log files show similar outputs to this one.
I've been having with ZM 1.30.4 stopping after a couple of days, and then refusing to start again. I've turned on all the debugging logs, and the best I can gather is that the zmc processes don't want to restart, or maybe it's an issue with MySQL. I see a lot of MySQL errors, but it's not clear to me if they are due to zmc crashing while trying to start, or MySQL issues internally. Restarting the machine sometimes works to get it running again, but sometimes not.
I'm running within an Ubuntu 16.04 VM in VMWare Fusion on Mac with 4 cores and 4GB of RAM (out of 8GB total) dedicated to the VM. I was going to move to bare metal (4 cores, 4 GB RAM) that just arrived today, but want to solve the current stability issues first. In terms of cameras, I have 4 Foscams on FFMPEG, each with a low-res monitor running Modect (2 zones - normal and exclusive) and linked to a high-res monitor running Nodect.
As far as I can tell from looking at top output, the machine doesn't seem to be running out of RAM, and for the most part runs at under .5 load. Sometimes I see it spike as it seems to be doing some sort of Ubuntu upgrades, but it's generally very low.
Any help would be much appreciated, as I would love to have this be a more stable platform. Everything about it is fantastic other than these stability issues.
MySQL error.log:
Code: Select all
2018-08-09T05:33:12.498625Z 1019 [Note] Aborted connection 1019 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:20.988497Z 1023 [Note] Aborted connection 1023 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:20.992000Z 1022 [Note] Aborted connection 1022 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.002385Z 1028 [Note] Aborted connection 1028 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.002394Z 1029 [Note] Aborted connection 1029 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.004409Z 966 [Note] Aborted connection 966 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.004531Z 965 [Note] Aborted connection 965 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.029613Z 986 [Note] Aborted connection 986 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.029767Z 987 [Note] Aborted connection 987 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.040964Z 963 [Note] Aborted connection 963 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.042234Z 997 [Note] Aborted connection 997 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
2018-08-09T05:33:38.045216Z 998 [Note] Aborted connection 998 to db: 'zm' user: 'zmuser' host: 'localhost' (Got an error reading communication packets)
syslog
Code: Select all
Aug 8 22:32:00 zoneminder zmpkg[88918]: INF [Sanity checking States table...]
Aug 8 22:32:00 zoneminder zmpkg[88918]: INF [Command: start]
Aug 8 22:32:04 zoneminder systemd[1]: Created slice User Slice of root.
Aug 8 22:32:05 zoneminder systemd[1]: Starting User Manager for UID 0...
Aug 8 22:32:05 zoneminder systemd[1]: Started Session c1 of user root.
Aug 8 22:32:07 zoneminder systemd[88927]: Reached target Sockets.
Aug 8 22:32:07 zoneminder systemd[88927]: Reached target Timers.
Aug 8 22:32:07 zoneminder systemd[88927]: Reached target Paths.
Aug 8 22:32:07 zoneminder systemd[88927]: Reached target Basic System.
Aug 8 22:32:07 zoneminder systemd[88927]: Reached target Default.
Aug 8 22:32:07 zoneminder systemd[88927]: Startup finished in 832ms.
Aug 8 22:32:07 zoneminder systemd[1]: Started User Manager for UID 0.
Aug 8 22:32:07 zoneminder zmsystemctl[88924]: INF [Redirecting command through systemctl]
Aug 8 22:32:07 zoneminder systemd[1]: Starting ZoneMinder CCTV recording and surveillance system...
Aug 8 22:32:08 zoneminder zmpkg[88940]: INF [Sanity checking States table...]
Aug 8 22:32:08 zoneminder zmpkg[88940]: INF [Command: start]
Aug 8 22:32:12 zoneminder zmdc[88955]: INF [Server starting at 18/08/08 22:32:12]
Aug 8 22:32:14 zoneminder web_php[67895]: FAT [SQL-ERR 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away', statement was 'delete from Filters where Name like '_TempFilter%'']
Aug 8 22:32:14 zoneminder web_php[67895]: FAT [Can't write log entry 'INSERT INTO Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, ? )': SQLSTATE[HY000]: General error: 2006 MySQL server has gone away]
Aug 8 22:32:17 zoneminder zmpkg[88940]: INF [Single server configuration detected. Starting up services.]
Aug 8 22:32:28 zoneminder zmdc[88986]: INF ['zmc -m 2' started at 18/08/08 22:32:28]
Aug 8 22:32:28 zoneminder zmdc[88955]: INF ['zmc -m 2' starting at 18/08/08 22:32:28, pid = 88986]
Aug 8 22:32:31 zoneminder zmdc[88955]: INF ['zma -m 2' starting at 18/08/08 22:32:30, pid = 88990]
Aug 8 22:32:31 zoneminder zmdc[88990]: INF ['zma -m 2' started at 18/08/08 22:32:30]
Aug 8 22:32:32 zoneminder zmdc[88955]: ERR ['zmc -m 2' exited abnormally, exit status 255]
Aug 8 22:32:33 zoneminder zmdc[88955]: INF [Starting pending process, zmc -m 2]
Aug 8 22:32:33 zoneminder zmdc[88997]: INF ['zmc -m 2' started at 18/08/08 22:32:33]
Aug 8 22:32:33 zoneminder zmdc[88955]: INF ['zmc -m 2' starting at 18/08/08 22:32:33, pid = 88997]
Aug 8 22:32:33 zoneminder zma_m2[88990]: ERR [Shared data not initialised by capture daemon for monitor Driveway]
Aug 8 22:32:33 zoneminder zmdc[88955]: ERR ['zma -m 2' exited abnormally, exit status 255]
Aug 8 22:32:33 zoneminder zmdc[88955]: INF ['zmc -m 3' starting at 18/08/08 22:32:33, pid = 88998]
Aug 8 22:32:33 zoneminder zmdc[88998]: INF ['zmc -m 3' started at 18/08/08 22:32:33]
Aug 8 22:32:33 zoneminder zmdc[88955]: INF [Starting pending process, zma -m 2]
Aug 8 22:32:33 zoneminder zmdc[89002]: INF ['zma -m 2' started at 18/08/08 22:32:33]
Aug 8 22:32:33 zoneminder zmdc[88955]: INF ['zma -m 2' starting at 18/08/08 22:32:33, pid = 89002]
Aug 8 22:32:33 zoneminder zmdc[88955]: ERR ['zmc -m 3' exited abnormally, exit status 255]
Aug 8 22:32:34 zoneminder zmdc[88955]: INF [Starting pending process, zmc -m 3]
Aug 8 22:32:37 zoneminder zmdc[89004]: INF ['zmc -m 3' started at 18/08/08 22:32:37]
Aug 8 22:32:37 zoneminder zmdc[88955]: INF ['zmc -m 3' starting at 18/08/08 22:32:37, pid = 89004]
Aug 8 22:32:38 zoneminder zma_m2[89002]: ERR [Shared data not initialised by capture daemon for monitor Driveway]
Aug 8 22:32:38 zoneminder zmdc[88955]: ERR ['zma -m 2' exited abnormally, exit status 255]
Aug 8 22:32:43 zoneminder zmdc[88955]: INF [Starting pending process, zma -m 2]
Aug 8 22:32:44 zoneminder zmdc[88955]: INF ['zma -m 2' starting at 18/08/08 22:32:44, pid = 89008]
Aug 8 22:32:44 zoneminder zmdc[89008]: INF ['zma -m 2' started at 18/08/08 22:32:44]
Aug 8 22:32:46 zoneminder zmdc[88955]: INF ['zma -m 3' starting at 18/08/08 22:32:46, pid = 89009]
Aug 8 22:32:46 zoneminder zmdc[89009]: INF ['zma -m 3' started at 18/08/08 22:32:46]
Aug 8 22:32:47 zoneminder zma_m2[89008]: ERR [Shared data not initialised by capture daemon for monitor Driveway]
Aug 8 22:32:47 zoneminder zmdc[88955]: ERR ['zma -m 2' exited abnormally, exit status 255]
Aug 8 22:32:49 zoneminder zma_m3[89009]: ERR [Shared data not initialised by capture daemon for monitor Front Door]
Aug 8 22:32:49 zoneminder zmdc[88955]: ERR ['zma -m 3' exited abnormally, exit status 255]
Aug 8 22:32:49 zoneminder zmdc[88955]: INF [Starting pending process, zma -m 3]
Aug 8 22:32:50 zoneminder zmdc[89016]: INF ['zma -m 3' started at 18/08/08 22:32:50]
Aug 8 22:32:50 zoneminder zmdc[88955]: INF ['zma -m 3' starting at 18/08/08 22:32:50, pid = 89016]
Aug 8 22:32:57 zoneminder zmdc[88955]: INF [Starting pending process, zma -m 2]
Aug 8 22:32:58 zoneminder zma_m3[89016]: ERR [Shared data not initialised by capture daemon for monitor Front Door]
Aug 8 22:32:58 zoneminder zmdc[89019]: INF ['zma -m 2' started at 18/08/08 22:32:58]
Aug 8 22:32:58 zoneminder zmdc[88955]: INF ['zma -m 2' starting at 18/08/08 22:32:58, pid = 89019]
Aug 8 22:32:58 zoneminder zmdc[88955]: ERR ['zma -m 3' exited abnormally, exit status 255]
Aug 8 22:33:03 zoneminder zmdc[88955]: INF [Starting pending process, zma -m 3]
Aug 8 22:33:05 zoneminder zmdc[89020]: INF ['zma -m 3' started at 18/08/08 22:33:05]
Aug 8 22:33:06 zoneminder zmdc[88955]: INF ['zma -m 3' starting at 18/08/08 22:33:05, pid = 89020]
Aug 8 22:33:06 zoneminder zma_m2[89019]: ERR [Shared data not initialised by capture daemon for monitor Driveway]
Aug 8 22:33:06 zoneminder zmdc[88955]: ERR ['zma -m 2' exited abnormally, exit status 255]
Aug 8 22:33:12 zoneminder zma_m3[89020]: ERR [Shared data not initialised by capture daemon for monitor Front Door]
Aug 8 22:33:12 zoneminder zmdc[88955]: ERR ['zma -m 3' exited abnormally, exit status 255]
Aug 8 22:33:18 zoneminder zmdc[88955]: INF ['zmc -m 4' starting at 18/08/08 22:33:18, pid = 89026]
Aug 8 22:33:18 zoneminder zmdc[89026]: INF ['zmc -m 4' started at 18/08/08 22:33:18]
Aug 8 22:33:20 zoneminder zmdc[88955]: ERR ['zmc -m 4' exited abnormally, exit status 255]
Aug 8 22:33:21 zoneminder zmdc[88955]: INF [Starting pending process, zmc -m 4]
Aug 8 22:33:23 zoneminder zmdc[89029]: INF ['zmc -m 4' started at 18/08/08 22:33:23]
Aug 8 22:33:23 zoneminder zmdc[88955]: INF ['zmc -m 4' starting at 18/08/08 22:33:23, pid = 89029]
Aug 8 22:33:24 zoneminder zmdc[88955]: INF [Starting pending process, zma -m 3]
Aug 8 22:33:27 zoneminder zmdc[89032]: INF ['zma -m 3' started at 18/08/08 22:33:27]
Aug 8 22:33:27 zoneminder zmdc[88955]: INF ['zma -m 3' starting at 18/08/08 22:33:27, pid = 89032]
Aug 8 22:33:28 zoneminder zmdc[88955]: INF [Starting pending process, zma -m 2]
Aug 8 22:33:34 zoneminder zmdc[89033]: INF ['zma -m 2' started at 18/08/08 22:33:33]
Aug 8 22:33:34 zoneminder zmdc[88955]: INF ['zma -m 2' starting at 18/08/08 22:33:33, pid = 89033]
Aug 8 22:33:38 zoneminder systemd[1]: zoneminder.service: Start operation timed out. Terminating.
Aug 8 22:33:38 zoneminder zmdc[88955]: INF ['zmc -m 2' sending stop to pid 88997 at 18/08/08 22:33:37]
Aug 8 22:33:38 zoneminder systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
Aug 8 22:33:38 zoneminder systemd[1]: zoneminder.service: Unit entered failed state.
Aug 8 22:33:38 zoneminder systemd[1]: zoneminder.service: Failed with result 'timeout'.
Aug 8 22:33:38 zoneminder zmdc[88955]: INF ['zmc -m 2' exited, signal 14]
Aug 8 22:33:38 zoneminder zmdc[88955]: INF ['zmc -m 3' exited, signal 14]
Aug 8 22:33:38 zoneminder zmdc[88955]: INF ['zmc -m 4' exited, signal 14]
Aug 8 22:33:38 zoneminder zmdc[88955]: INF ['zma -m 3' exited, signal 14]
Aug 8 22:33:38 zoneminder zmdc[88955]: INF ['zma -m 2' exited, signal 14]
Aug 8 22:33:38 zoneminder systemd[1]: zoneminder.service: Service hold-off time over, scheduling restart.
Aug 8 22:33:38 zoneminder systemd[1]: Stopped ZoneMinder CCTV recording and surveillance system.
Aug 8 22:33:38 zoneminder systemd[1]: Starting ZoneMinder CCTV recording and surveillance system...
Aug 8 22:33:38 zoneminder systemd[1]: Stopping User Manager for UID 0...
Aug 8 22:33:38 zoneminder systemd[88927]: Reached target Shutdown.
Aug 8 22:33:38 zoneminder systemd[88927]: Starting Exit the Session...
Aug 8 22:33:38 zoneminder systemd[88927]: Stopped target Default.
Aug 8 22:33:38 zoneminder systemd[88927]: Stopped target Basic System.
Aug 8 22:33:38 zoneminder systemd[88927]: Stopped target Timers.
Aug 8 22:33:38 zoneminder systemd[88927]: Stopped target Sockets.
Aug 8 22:33:38 zoneminder systemd[88927]: Stopped target Paths.
Aug 8 22:33:38 zoneminder zmpkg[89039]: INF [Sanity checking States table...]
Aug 8 22:33:38 zoneminder systemd[88927]: Received SIGRTMIN+24 from PID 89040 (kill).
Aug 8 22:33:38 zoneminder zmpkg[89039]: INF [Command: start]
Aug 8 22:33:38 zoneminder systemd[1]: Stopped User Manager for UID 0.
Aug 8 22:33:39 zoneminder systemd[1]: Removed slice User Slice of root.
Aug 8 22:33:43 zoneminder systemd[1]: zoneminder.service: Control process exited, code=exited status=1
Aug 8 22:33:48 zoneminder zmdc[88955]: INF [Server shutdown at 18/08/08 22:33:48]
Aug 8 22:33:58 zoneminder zmdc[88955]: INF [Server shutdown at 18/08/08 22:33:58]
Aug 8 22:33:58 zoneminder systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
Aug 8 22:33:58 zoneminder systemd[1]: zoneminder.service: Unit entered failed state.
Aug 8 22:33:58 zoneminder systemd[1]: zoneminder.service: Failed with result 'exit-code'.
Code: Select all
top - 22:36:06 up 2 days, 41 min, 2 users, load average: 0.53, 0.93, 0.44
Tasks: 208 total, 1 running, 207 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.2 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 3825340 total, 2077180 free, 466516 used, 1281644 buff/cache
KiB Swap: 1003516 total, 1001168 free, 2348 used. 2880848 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
786 root 20 0 116248 7232 6044 S 0.3 0.2 3:05.60 vmtoolsd
1266 blueche+ 20 0 143072 7008 5168 S 0.3 0.2 9:33.70 bc-server
70720 mysql 20 0 2622092 335584 17564 S 0.3 8.8 3:32.97 mysqld
89322 user 20 0 41936 3960 3236 R 0.3 0.1 0:00.08 top
1 root 20 0 38108 5636 3524 S 0.0 0.1 0:27.21 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.20 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:02.81 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
7 root 20 0 0 0 0 S 0.0 0.0 0:21.84 rcu_sched
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root rt 0 0 0 0 S 0.0 0.0 0:00.75 migration/0
10 root rt 0 0 0 0 S 0.0 0.0 0:00.78 watchdog/0
11 root rt 0 0 0 0 S 0.0 0.0 0:00.70 watchdog/1
12 root rt 0 0 0 0 S 0.0 0.0 0:00.52 migration/1
13 root 20 0 0 0 0 S 0.0 0.0 0:01.14 ksoftirqd/1
15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H
16 root rt 0 0 0 0 S 0.0 0.0 0:00.70 watchdog/2
17 root rt 0 0 0 0 S 0.0 0.0 0:00.53 migration/2
zma_m3.log
Code: Select all
08/08/18 22:33:12.224710 zma_m3[89020].ERR-zm_monitor.cpp/442 [Shared data not initialised by capture daemon for monitor Front Door]