Zoneminder db access broken

SimpleUser

Cadet
Joined
Apr 7, 2022
Messages
9
I had zoneminder working almost great for more than one year.
It was not great because:

1) I never was able to start it automatically after a server power down (because of power failure)
2) I had a 2TB HDD that was becoming short

So, hoping to fix 1) and leaving 2) for after I decided to update the zoneminder plugin though the Plugins -> UPDATE
I think nothing was updated (in the shell I issue zmc --version and I still have the same version that is 1.36.12) and I guess access to the db was lost, as when I write:

Code:
zmcamtool.pl       zmore              zmtrigger.pl
zmcontrol.pl       zmpkg.pl           zmu
zmdc.pl            zmrecover.pl       zmupdate.pl
root@ZoneminderJail:~ # zmc --version
1.36.12
root@ZoneminderJail:~ # service zoneminder start
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Access denied for user 'dbadmin'@'localhost' (using password: YES) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Access denied for user 'dbadmin'@'localhost' (using password: YES) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
06/13/22 19:41:13.520021 zmpkg[48519].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Access denied for user 'dbadmin'@'localhost' (using password: YES) error val:]
06/13/22 19:41:13.520312 zmpkg[48519].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Access denied for user 'dbadmin'@'localhost' (using password: YES) error val:]
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Access denied for user 'dbadmin'@'localhost' (using password: YES) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.


I did made my search before posting this and I found other users saying that the password on the post install notes must match the settings on the /usr/local/etc/zm.conf file. This makes total sense, but I do not know what changed the password or settings (the failed update ?!). So I did checked the post install notes:

1655145802783.png


so I made sure that they are both the same:

1655146058936.png



I also changed the file /root/dbpassword so that the password is the same (also the dbname and dbuser):
1655145914777.png


I did restarted the jail not nothing... The GUI presents:

1655146110855.png


So it looks a permission thing.
At the end no update was made and system is down.

I would be very interested in knowing how should I update correctly zoneminder before repairing what is wrong, and yes, I need this repaired. I do not want my wife saying that all the invested time and resources are for nothing. I think something will happen where the cameras are needed when they are offline...

Thank you
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Updating a plugin may cause the pkgs to be reinstalled over the top or even removed and then installed again, so could certainly result in the password generation from scratch that you have observed.

I'm not personally comfortable with that outcome and neither update plugins via that method nor elect to use plugins in general when building a jail is possible (either by just installing pkgs or by following/running a script provided on the forum).

Chances are you have the possibility to roll back the jail to before the upgrade (as the upgrade will usually initiate an iocage snapshot before proceeding)... I recommend doing that.

After you have rolled back, I recommend looking at this thread to get some ideas about how to go forward with it.
 

SimpleUser

Cadet
Joined
Apr 7, 2022
Messages
9
Thank you for your time and reply.
As I do not know how to go back to a previous state, I wonder if it would be better and most effective to delete the jail and create a new one. Maybe it would be created with the latest version available and I would just need to duplicate the current cameras settings.
 

drinking12many

Contributor
Joined
Apr 8, 2012
Messages
148
Can you connect to it using that account and password locally? If not then yes I would assume that password got regenerated. I have upgraded mine a few times and never had that issue. I have reverted it before without too many problems though. You could also probably clone an older snapshot to another mount point and get your old password and try that see if you can this access it locally if so you would just need to fix by logging in with the old password and updating the mysql account to the new.


1655171683364.png
 

fastzombies

Explorer
Joined
Aug 11, 2022
Messages
57
Did this ever get resolved? I have a similar problem after adding mount points.
 
Top