[solved] Errors starting on fresh Debian 10 install

Forum for questions and support relating to the 1.34.x releases only.
superweasel
Posts: 4
Joined: Fri Apr 09, 2021 12:19 am

[solved] Errors starting on fresh Debian 10 install

Post by superweasel »

I started with a fresh install of Debian 10, then followed these instructions: https://wiki.zoneminder.com/Debian_10_B ... om_ZM_Repo

I get an error when starting zoneminder:

Code: Select all

root@zoneminder-be:~# systemctl start zoneminder
Job for zoneminder.service failed because the control process exited with error code.
See "systemctl status zoneminder.service" and "journalctl -xe" for details.
root@zoneminder-be:~# systemctl status zoneminder.service
● zoneminder.service - ZoneMinder CCTV recording and surveillance system
   Loaded: loaded (/lib/systemd/system/zoneminder.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2021-04-08 17:26:16 PDT; 4s ago
  Process: 4675 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=1/FAILURE)
root@zoneminder-be:~#
There are no useful errors in /var/log/zm/. However, the jobs do seem to be running:

Code: Select all

root@zoneminder-be:~# ps axuw | grep zm
www-data  3170  0.0  0.2  33936 16520 ?        S    17:11   0:00 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
www-data  3200  0.0  0.4  49092 35508 ?        S    17:11   0:00 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=1 --daemon
www-data  3207  0.0  0.4  49096 35488 ?        S    17:11   0:00 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=2 --daemon
www-data  3215  0.0  0.2  33412 19676 ?        S    17:11   0:00 /usr/bin/perl -wT /usr/bin/zmwatch.pl
www-data  3222  0.0  0.4  54080 40256 ?        S    17:11   0:00 /usr/bin/perl -wT /usr/bin/zmupdate.pl -c
www-data  3228  0.0  0.2  33192 19536 ?        S    17:11   0:00 /usr/bin/perl -wT /usr/bin/zmstats.pl
root      4944  0.0  0.0   6076   884 pts/0    R+   17:29   0:00 grep zm
root@zoneminder-be:~#
I actually started with a Debian 10 system with Zoneminder-1.34.23 installed where it was mostly working but had these same symptoms. I reinstalled the OS in hopes of clearing this up, but it's still broken for me. Any pointers of how to debug this would be most appreciated.
Last edited by superweasel on Wed Apr 14, 2021 9:53 pm, edited 1 time in total.
superweasel
Posts: 4
Joined: Fri Apr 09, 2021 12:19 am

Re: Errors starting on fresh Debian 10 install

Post by superweasel »

Is there a good way to increase verbosity so that I can see what's causing the errors?
techman93098
Posts: 1
Joined: Tue Apr 13, 2021 7:11 pm

Re: Errors starting on fresh Debian 10 install

Post by techman93098 »

I'm having the same issue as well, hope there is a fix soon we desperately need our security cameras to work!
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Errors starting on fresh Debian 10 install

Post by Magic919 »

Try the logging settings in the web interface. See if you can turn them up a bit.
-
gruiarew
Posts: 30
Joined: Tue May 05, 2020 7:10 am

Re: Errors starting on fresh Debian 10 install

Post by gruiarew »

superweasel
Posts: 4
Joined: Fri Apr 09, 2021 12:19 am

Re: Errors starting on fresh Debian 10 install

Post by superweasel »

gruiarew wrote: Wed Apr 14, 2021 8:30 am See this: viewtopic.php?f=40&t=29382&p=115152#p115152
I looked at that. I tried uncommenting the '#User=www-data', but that didn't help. The last post in that thread suggests that things should work with a clean install, but that was not the case for me.
Magic919 wrote: Wed Apr 14, 2021 6:03 am Try the logging settings in the web interface. See if you can turn them up a bit.
I'll give this a try next, thanks.
superweasel
Posts: 4
Joined: Fri Apr 09, 2021 12:19 am

Re: Errors starting on fresh Debian 10 install

Post by superweasel »

I found two issues in the logs. First:

Code: Select all

WAR	Cannot write to event folder /var/cache/zoneminder/events. Check that it exists and is owned by the web account user.
I fixed that with

Code: Select all

# mkdir /var/cache/zoneminder/events
# chown www-data.www-data /var/cache/zoneminder/events
That one may have been my fault because I had configured a separate partition to be mounted on /var/cache/zoneminder. I'm still surprised that it's not able to create this directory itself (it has write permissions to /var/cache/zoneminder).

The other problem was

Code: Select all

ERR ZoneMinder is not configured properly: php's date.timezone is not set to a valid timezone. Please check Options->System->Timezone	
which I fixed by setting the tomezone under Optios as suggested.

Overall I find it slightly confusing to encounter an error at the OS level (the zoneminder service won't start) and have the relevant error messages only within the application. I expected to find them in system logs.

Now to reconfigure my cameras. Thanks for the help.
BobLaske
Posts: 84
Joined: Fri Oct 13, 2017 3:55 am

Re: [solved] Errors starting on fresh Debian 10 install

Post by BobLaske »

In my case of a brand new install of 1.34.26 on a freshly installed Ubuntu 20.02 LTS server, I still get the error every minute or so.

I already set the time zone in the Options and know my permissions are set too.

chown -R www-data:www-data /etc/zm
chown -R www-data:www-data /var/cache/zoneminder
chown -R www-data:www-data /var/log/zm/

Since that didn't fix it, I went ahead and edited the php.ini file to include the timezone as well.
Since editing /etc/php/7.4/apache2/php.ini didn't work, I went ahead and also edited /etc/php/7.4/cli/php.ini.

ie: date.timezone = America/Chicago

I restarted the web and zm services and still no change.

Why am I still seeing this error? Someone who is not very familiar with working on the OS would be lost.

10/04/21 10:38:02.121227 web_php[3750].ERR [192.168.1.205] [ZoneMinder is not configured properly: php's date.timezone -0700 does not match the system timezone +0000! Please check Options->System->Timezone.] at /usr/share/zoneminder/www/includes/functions.php line 2423
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: [solved] Errors starting on fresh Debian 10 install

Post by kitkat »

BobLaske wrote: Mon Oct 04, 2021 5:42 pm 10/04/21 10:38:02.121227 web_php[3750].ERR [192.168.1.205] [ZoneMinder is not configured properly: php's date.timezone -0700 does not match the system timezone +0000! Please check Options->System->Timezone.] at /usr/share/zoneminder/www/includes/functions.php line 2423
What does ls /etc/localtime show?

If it's a symlink, which is how CentOS does it, then make sure it points to (something like) /usr/share/zoneinfo/America/Chicago or if it's a file then replace it with the relevant file from /usr/share/zoneinfo/...

That might fix it.
BobLaske
Posts: 84
Joined: Fri Oct 13, 2017 3:55 am

Re: [solved] Errors starting on fresh Debian 10 install

Post by BobLaske »

Hi,

Yes, it's already linked.

lrwxrwxrwx. 1 root root 37 Dec 2 2020 localtime -> ../usr/share/zoneinfo/America/Phoenix

Code: Select all

# cat /etc/localtime
TZif2
     ▒▒▒:▒▒▒▒▒▒▒▒▒▒ˉ
▒▒▒Ϗ▒Ё▒▒u▒▒X▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
LMTMDTMSTMWTTZif2
▒▒▒▒▒^
▒▒▒▒▒▒▒:▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ˉ
▒▒▒▒▒▒▒▒▒▒▒Ϗ▒▒▒▒▒Ё▒▒▒▒▒▒u▒▒▒▒▒▒X▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
LMTMDTMSTMWT
MST7

Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: [solved] Errors starting on fresh Debian 10 install

Post by Magic919 »

Run timedatectl and see what it says. You should be able to set it via that and get rid of the errors.
-
BobLaske
Posts: 84
Joined: Fri Oct 13, 2017 3:55 am

Re: [solved] Errors starting on fresh Debian 10 install

Post by BobLaske »

Oddly, this shows UTC time and not the MST one I have set.

# timedatectl
Local time: Wed 2021-10-06 16:31:03 UTC
Universal time: Wed 2021-10-06 16:31:03 UTC
RTC time: Wed 2021-10-06 16:31:04
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

So, I know I can set it from the OS to fix this but mainly, my question is what about those that aren't so familiar with the terminal?
Why this is happening is what needs to be addressed so that zoneminder itself isn't throwing these errors out.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: [solved] Errors starting on fresh Debian 10 install

Post by Magic919 »

Server timezone is not correctly set. It doesn’t match what’s set in the ZM UI. ZM logs this as an error with a clear explanation. Doesn’t sound like a ZM problem.
-
BobLaske
Posts: 84
Joined: Fri Oct 13, 2017 3:55 am

Re: [solved] Errors starting on fresh Debian 10 install

Post by BobLaske »

Wait, you're right.
Mine was a ubuntu embedded build so it comes pre-installed and yes, that and some other things need to be set at the OS level.

However...

# sudo timedatectl set-ntp true
# timedatectl set-timezone "America/Chicago"
# timedatectl status
Local time: Wed 2021-10-06 13:00:10 CDT
Universal time: Wed 2021-10-06 18:00:10 UTC
RTC time: Wed 2021-10-06 18:00:11
Time zone: America/Chicago (CDT, -0500)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

# sudo systemctl restart systemd-timesyncd.service

# tail -f /var/log/zm/web_php.log
10/06/21 10:52:13.442603 web_php[106475].ERR [192.168.1.205] [ZoneMinder is not configured properly: mysql's timezone does not match the system timezone! Event lists will display incorrect times.] at /usr/share/zoneminder/www/includes/functions.php line 2426

So, what else am I missing?
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: [solved] Errors starting on fresh Debian 10 install

Post by Magic919 »

The error says MySQL has the wrong TZ. It probably picks this up from the OS when you start the daemon. Do a MySQL (d) restart.
-
Post Reply