Problems installing ZM (NON-DOCKER)

Forum for questions and support relating to the 1.34.x releases only.
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

you are again correct! ( I did not enter the ; )
result:
information_schema
mysql
performance_schema
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems installing ZM (NON-DOCKER)

Post by Magic919 »

Ok, that's good. You have MySQL running, you can get in, you have no ZM DB.

You can use the command on one of the earlier links to create the DB.

From outside MySQL, just the usual command prompt for root.

Code: Select all

mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
That will create the ZM DB and populate it.
-
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

Much appreciated!
I will follow your instructions, then follow previous write ups. If I run into trouble, I will be back.
Also, will be back if it all works!
TY again tons for spending your Sun morning with me on this. I was truly lost and the internet gives hundreds of suggestions. It's like info spaghetti!
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems installing ZM (NON-DOCKER)

Post by Magic919 »

No problem. It's a freezing Sunday afternoon here.

My tip for the next stage would be get ZM running. Starting the service and getting zero errors would prove that.

The WebUI is a separate matter and might fail in some way, probably viewing live streams (if it fails).

Good luck.
-
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

Sorry, I tried, but I'm back;
this is what I did:
rainer@Zone:~$ sudo su
[sudo] password for rainer:
root@Zone:/home/rainer# systemctl enable zoneminder
root@Zone:/home/rainer# 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@Zone:/home/rainer#

This is the systemctl log:
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 Sun 2021-01-10 11:13:18 EST; 1s ago
Process: 5527 ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=255/EXCEPTION)
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems installing ZM (NON-DOCKER)

Post by Magic919 »

It's just another step in the journey.

Really you need to check the logs. Might as well get familiar with them.

Code: Select all

ls -la /var/log/zm
You should see zoneminder.log.

Code: Select all

tail -f -n 200 /var/log/zm/zoneminder.log
As I'm lazy I quite like

Code: Select all

egrep -i 'fat|err|war' /var/log/zm/zoneminder.log
-
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

Here we go: (it's not giving me a clue) :
rainer@Zone:~$ chown -R www.data /var/lib/ZM
chown: invalid user: ‘www.data

rainer@Zone:~$ ls -la /var/log/zm
total 8
drwxr-xr-x 2 www-data root 4096 Oct 19 15:22 .
drwxrwxr-x 17 root syslog 4096 Jan 10 08:31 ..

rainer@Zone:~$ tail -f -n 200 /var/log/zm/zoneminder.log
tail: cannot open '/var/log/zm/zoneminder.log' for reading: No such file or directory
tail: no files remaining

rainer@Zone:~$ egrep -f 'fat|err|war' /var/log/zm/zoneminder.log
grep: fat|err|war: No such file or directory
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems installing ZM (NON-DOCKER)

Post by Magic919 »

I wouldn't go ahead with the chown command, but the correct user is usually www-data.

It's not creating any logs (or not where I'd expect them).

For now, just run it manually -

Code: Select all

sudo zmpkg.pl start
See what that gives us.
-
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

sudo zmpkg.pl start
[sudo] password for rainer:
DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
01/10/2021 13:51:40.955687 zmpkg[7711].ERR [ZoneMinder::Database:113] [Error reconnecting to db: errstr:Access denied for user 'zmuser'@'localhost' (using password: YES) error val:]
01/10/2021 13:51:40.955989 zmpkg[7711].ERR [ZoneMinder::Database:113] [Error reconnecting to db: errstr:Access denied for user 'zmuser'@'localhost' (using password: YES) error val:]
DBI connect('database=zm;host=localhost','zmuser',...) failed: Access denied for user 'zmuser'@'localhost' (using password: YES) at /usr/share/perl5/ZoneMinder/Database.pm line 110.
01/10/2021 13:51:40.956615 zmpkg[7711].ERR [ZoneMinder::Database:113] [Error reconnecting to db: errstr:Access denied for user 'zmuser'@'localhost' (using password: YES) error val:]
Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 96.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmpkg.pl line 34.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 34.
rainer@Zone:~$
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems installing ZM (NON-DOCKER)

Post by Magic919 »

Ok. It can't access the database. It grabs the credentials from /etc/zm/zm.conf Usual is zmuser and zmpass.

This needs some MySQL commands run, like before, inside the MySQL.

Code: Select all

CREATE USER 'zmuser'@localhost IDENTIFIED BY 'zmpass';
(If CREATE does not work try with ALTER )
GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES ;
quit
-
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

Done:

rainer@Zone:~$ sudo mysql -u root -p
[sudo] password for rainer:
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5957
Server version: 10.3.25-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE USER 'zmuser'@'localhost' IDENTIFIED BY 'zmpass';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> QUIT
Bye
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems installing ZM (NON-DOCKER)

Post by Magic919 »

Now try to start ZM manually and see what's next. It'll start or throw the next hurdle.
-
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

and no errors :)
rainer@Zone:~$ sudo systemctl enable zoneminder
rainer@Zone:~$ sudo systemctl start zoneminder
rainer@Zone:~$

should I now try to access via browser? or are there other steps first
I actually went and tried: http://hostname/zm - unable to connect

Not Found

The requested URL was not found on this server.
Apache/2.4.41 (Ubuntu) Server at (my box IP) Port 80
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Problems installing ZM (NON-DOCKER)

Post by Magic919 »

It's in layers, like an onion :-)

You have got it as far as running, but that's no guarantee you'll have the WebUI.

Did you run the Apache bit?

Code: Select all

a2enconf zoneminder
This is the bit that will configure Apache to allow the /zm bit to work.

Code: Select all

service apache2 restart
after that.
-
rfeyer
Posts: 34
Joined: Sun Jul 10, 2016 11:36 am

Re: Problems installing ZM (NON-DOCKER)

Post by rfeyer »

OK, I got a ZM screen, Privacy disclaimer type.
If this now means it should work, I have to say: You are a genius! You talked a 63 y.o. fairly new to Linux though this!
TY TONS

I will continue to explore.
If this works, hopefully I can reproduce it :)

You should write a blog on 'Installing Zoneminder and expected caveats!'

Again, TY tons
Post Reply