Can't start zoneminder service

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
altesCoon
Posts: 2
Joined: Fri Feb 16, 2024 9:36 am

Can't start zoneminder service

Post by altesCoon »

Hi there.

I installed zm following the instructions in https://zoneminder.readthedocs.io/en/la ... buntu.html .

Ubuntu 22.04
zm 1.36 from ubuntu repository

When i try

Code: Select all

systemctl status zoneminder.service
i get these error messages:

Code: Select all

Feb 16 10:55:49 pt-t430 zmpkg[8707]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]
Feb 16 10:55:49 pt-t430 zmpkg.pl[8707]: Unable to connect to DB. ZM Cannot continue.
Feb 16 10:55:49 pt-t430 zmpkg.pl[8707]: BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 150.
Feb 16 10:55:49 pt-t430 zmpkg.pl[8707]: Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
Feb 16 10:55:49 pt-t430 zmpkg.pl[8707]: BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Feb 16 10:55:49 pt-t430 zmpkg.pl[8707]: Compilation failed in require at /usr/bin/zmpkg.pl line 34.
Feb 16 10:55:49 pt-t430 zmpkg.pl[8707]: BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 34.
Feb 16 10:55:50 pt-t430 systemd[1]: zoneminder.service: Control process exited, code=exited, status=255/EXCEPTION
Feb 16 10:55:50 pt-t430 systemd[1]: zoneminder.service: Failed with result 'exit-code'.
Feb 16 10:55:50 pt-t430 systemd[1]: Failed to start ZoneMinder CCTV recording and surveillance system.
I know, there is no database zm in mysql yet. Do i have to create it myself? I don't read about that in the link above (and other instructions).

When i try

Code: Select all

http://localhost/zm/
in browser, i get:

Code: Select all

Fatal error: Uncaught TypeError: array_replace(): Argument #1 ($array) must be of type array, bool given in /usr/share/zoneminder/www/includes/config.php:52 Stack trace: #0 /usr/share/zoneminder/www/includes/config.php(52): array_replace() #1 /usr/share/zoneminder/www/index.php(46): require_once('...') #2 {main} thrown in /usr/share/zoneminder/www/includes/config.php on line 52
What did i misunderstand?
Any help?

Thank you for all answers
Peter
Rayj00
Posts: 39
Joined: Mon Jan 09, 2023 3:56 pm

Re: Can't start zoneminder service

Post by Rayj00 »

I think the database is created in the install.

Check here: https://wiki.zoneminder.com/MySQL#About
Ruler
Posts: 232
Joined: Mon Nov 08, 2004 9:02 pm
Location: Bay City, MI

Re: Can't start zoneminder service

Post by Ruler »

I recently installed on Debian (which is what Ubuntu is built on) and do not remember having to manually create the database. Maybe try reinstalling from apt to trigger the scripts again? Or remove, reboot, and then install? (Sorry I do not have better ideas - just trying to come up with something that might trigger the database to be created on your system.)
This message is made up of not less than 90% recycled electrons.
dougmccrary
Posts: 1206
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Can't start zoneminder service

Post by dougmccrary »

The database zm is created during install.
When you started, had you done
sudo su ?
Won't work if you don't, last I saw...
altesCoon
Posts: 2
Joined: Fri Feb 16, 2024 9:36 am

Re: Can't start zoneminder service

Post by altesCoon »

Thank you all for your answers.
When you started, had you done
sudo su ?
I did not. There was nothing about that in the Installation Guide I linked above.

Okay, i removed and purged zm now and reinstalled it with the sudo su before.

Now I get this error:

Code: Select all

ERR [Error reconnecting to db: errstr:Access denied for user 'zmuser'@'localhost' (using password: YES) error val:]
I thought i can simply install this software, but it seems that i have to be an administrator and database expert ;-)
I never worked with mysql on linux, so i have no idea what is going on in the background.
dougmccrary
Posts: 1206
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Can't start zoneminder service

Post by dougmccrary »

I admit it's easy to do it wrong.
Please see this post. viewtopic.php?p=129569#p129569
It really works!
It works just as well on Ubuntu desktop, if you're more comfortable with that.
Post Reply