eventnotification: The password for admin has not been migrated in ZM

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
SkippyDo
Posts: 219
Joined: Mon Nov 20, 2017 6:49 pm

eventnotification: The password for admin has not been migrated in ZM

Post by SkippyDo »

Recently updated zmeventnotification and am now seeing these errors (everything seems to be working fine):
PARENT: The password for admin has not been migrated in ZM. Please log into ZM with this username to migrate before using it with the ES. If that doesn't work, please configure a new user for the ES
Being thrown from zmeventnotification.pl.

Only relevant diff in zmeventnotification.ini is that debug level is now set to 4, whereas my old copy was set to 2.

In secrets.ini I have (and have never changed it):
ES_ADMIN_INTERFACE_PASSWORD=your_admin_interface_password

There isn't any documentation on that variable/setting. Which "admin?" There's DB admin and then there's ZM admin. I also have a generic ZM user for, I suppose, back end DB access. NONE of this has been changed.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: eventnotification: The password for admin has not been migrated in ZM

Post by asker »

ZM user.

1. Open up a mysql shell with the ZM db (usually mysql -u root zm or something similar)
2. Run the following command

Code: Select all

MariaDB [zm]> select * from Users where Username="admin";
I see:

Code: Select all

+----+----------+--------------------------------------------------------------+----------+---------+--------+--------+---------+----------+--------+---------+--------+--------------+------------+----------------+------------+
| Id | Username | Password                                                     | Language | Enabled | Stream | Events | Control | Monitors | Groups | Devices | System | MaxBandwidth | MonitorIds | TokenMinExpiry | APIEnabled |
+----+----------+--------------------------------------------------------------+----------+---------+--------+--------+---------+----------+--------+---------+--------+--------------+------------+----------------+------------+
|  1 | admin    |  $2y$and_lots_of_characters                                  |          |       1 | View   | Edit   | Edit    | Edit     | Edit   | Edit    | Edit   |              |            |              0 |          1 |
+----+----------+--------------------------------------------------------------+----------+---------+--------+--------+---------+----------+--------+---------+--------+--------------+------------+----------------+------------+
1 row in set (0.001 sec)
What do you see?
If you see the Password column starting with "--ZM--" then you have a user (admin) who is using the old sql functions to create a password and not bcrypt. You need to login to ZM web with that user. Then do the command above again, if "--ZM--" is gone, then good, ES will work as well.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
SkippyDo
Posts: 219
Joined: Mon Nov 20, 2017 6:49 pm

Re: eventnotification: The password for admin has not been migrated in ZM

Post by SkippyDo »

Database shows "admin" and the password entry starts with "-ZM-" (followed by a string of characters): only account showing "-ZM-". I regularly log in with this user (and have done so many times since the upgrade). Logging in as "admin" under the ZM web interface isn't making any change.

From my Debian system prompt 'man -k bcrypt' returns:
Crypt::Eksblowfish::Bcrypt (3pm) - Blowfish-based Unix crypt() password hash
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: eventnotification: The password for admin has not been migrated in ZM

Post by asker »

That should mean that ZM is converting the password to bcrypt every time you log in, but is not able to write that value to the DB.
Don't know why. You may want to check ZM logs during login to get clues.

As far as ES goes, create another user anew. It should be created with a proper bcrypt encrypted password and use that. Later, you may want to change the admin password. My guess is even retyping the admin password and hitting save in ZM should fix the problem. However, please make sure you know how to get into the DB and disable auth if something goes wrong.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
SkippyDo
Posts: 219
Joined: Mon Nov 20, 2017 6:49 pm

Re: eventnotification: The password for admin has not been migrated in ZM

Post by SkippyDo »

I reset the "admin" password from ZM (web) and that took care of the error. Just strange stuff...
Post Reply