Page 1 of 1

Update to 1.32.3 error

Posted: Sat Dec 29, 2018 1:33 pm
by BiloxiGeek
Yum updated my zm install but the zmupdate.pl script is failing. Any known fix for this?

Code: Select all

[root@icezone ~]# zmupdate.pl 

Initiating database upgrade to version 1.32.3 from version 1.32.2

Please ensure that ZoneMinder is stopped on your system prior to upgrading the datab
Press enter to continue or ctrl-C to stop : 

Do you wish to take a backup of your database prior to upgrading?
This may result in a large file in /var/lib/zoneminder/temp if you have a lot of eve
Press 'y' for a backup or 'n' to continue : n

Upgrading database to version 1.32.3
Loading config from DB 223 entries
Saving config to DB 223 entries
Upgrading DB to 1.32.3 from 1.32.2
ERROR 1054 (42S22) at line 314: Unknown column 'Hostname' in 'Servers'
Output: Column Protocol already exists in Servers
Column Protocol already exists in Servers
Command 'mysql -hlocalhost -uzmuser -p"password" zm < /usr/share/zoneminder/db/zm_up
 status: 1

Re: Update to 1.32.3 error

Posted: Sat Dec 29, 2018 2:38 pm
by knight-of-ni
Missing dB columns is a sign there was a previous zmupdate error that was never resolved.
I commonly run into this, even with my own systems, when the zmuser account does not (did not) have all permission granted to it at the time of the original failure, which in your case looks to be a long time ago. In the long ago past, zmuser accounts ran w/o the "Alter" permission, which is exactly what you need to be allowed to insert the Hostname column into the dB.


To fix this specific error, first make sure your zmuser account has been granted all permission on the zm dB:

Code: Select all

mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"
mysqladmin -uroot -p reload
If you are not using the default credentials, then modify the sql to match your environment.

Now re-run the dB update script that originally created the Hostname column:

Code: Select all

mysql -uroot -p zm < /usr/share/zoneminder/db/zm_update-1.28.109.sql
Now try to run zmupdate.pl again.

DISCLAIMER:
There may very well be other missing components in your database, which might cause zmupdate.pl to fail again. If that happens, I recommend you fake the version in the database back to 1.28.0 then immediately run zmupdate.pl again. This will trigger *all* the dB updates again, all the way back to 1.28.0, just to be sure you got them all. See the example in the following thread where I had a user roll his system back to 1.30.4. Modify the sql in the example to go back to 1.28.0 in your case:
viewtopic.php?f=38&t=27622&p=108402&hil ... .4#p108402

Re: Update to 1.32.3 error

Posted: Mon Dec 31, 2018 2:44 pm
by BiloxiGeek
Thanks, that fixed the problem. It's back up and running as expected again.

Re: Update to 1.32.3 error

Posted: Mon Dec 31, 2018 2:54 pm
by knight-of-ni
Excellent, glad to hear it.

Did you have any issues with the README this go around?
I split zoneminder into subpackages, which required additional changes to the README. If all went as intended, you may not have even noticed.

You should have three zoneminder packages on your system now:
zoneminder
zoneminder-common
zoneminder-httpd

The first package is an empty meta package, that simply pulls in the other two. You can remove it once the other two are successfully installed.

Re: Update to 1.32.3 error

Posted: Mon Dec 31, 2018 3:16 pm
by BiloxiGeek
Yep, didn't notice the change but it looks exactly as you say it should.

Re: Update to 1.32.3 error

Posted: Mon Dec 31, 2018 4:15 pm
by BiloxiGeek
After getting 1.32.3 to run correctly I purged quite a few events to clean up some disk space. Everything seems to be working but I'm seeing some odd numbers in the console.

I used the command line and API calls to delete the events and then ran zmaudit.pl when I had purged everything.
odd-numbers.png
odd-numbers.png (182.77 KiB) Viewed 9518 times

Re: Update to 1.32.3 error

Posted: Mon Dec 31, 2018 4:17 pm
by knight-of-ni
Yeah, I've seen that too on one machine, but not others. I am not sure yet how that happens, but the negative numbers go away as soon as a new event is recorded. Let me know if that holds true for your system.

Oh, and note that it appears to just be cosmetic.

Re: Update to 1.32.3 error

Posted: Mon Dec 31, 2018 4:28 pm
by BiloxiGeek
I just read the thread in the 1.33.x area about what sounds like the same issue. I've forced an alert on one camera and that does not seem to clear things up. I did observe that my event ID's got reset to 1 somewhere along the way, they had been up in the 34xxx range before. I'll give a few hours and check back to see if it rights itself.

Re: Update to 1.32.3 error

Posted: Tue Jan 01, 2019 1:48 pm
by BiloxiGeek
Still seeing negative event counts in the console. Everything seems to be working normally at least.
86D59A5E-19EA-4838-B1BF-A9F098DDEED2.jpeg
86D59A5E-19EA-4838-B1BF-A9F098DDEED2.jpeg (895.41 KiB) Viewed 9493 times

Re: Update to 1.32.3 error

Posted: Tue Jan 01, 2019 2:08 pm
by knight-of-ni
Try running this sql script directly:

Code: Select all

mysql -uroot -p zm < /usr/share/zoneminder/db/zm_update-1.32.3.sql
This will drop and rebuild the sql triggers that compute the totals you see on the web console. It is safe to run this as many times as you want.

Re: Update to 1.32.3 error

Posted: Tue Jan 01, 2019 2:21 pm
by BiloxiGeek
doesn’t seem to change the behavior though. Still got the negative event counts in the console. I did run it while ZM was stopped. Also forced an event on a couple of the low def monitors which results in two events since each high def monitor is linked to it’s low def version. The events get recorded as expected and deleting them goes normally.

Still have the negative counts but currently zero events in reality.

Re: Update to 1.32.3 error

Posted: Sun Jan 06, 2019 2:18 pm
by knight-of-ni
We still have not been able to duplicate this.

This is just a guess, but run this sql query to see what the timezone offset is on your sql server:

Code: Select all

SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP);
Then determine the timezone offset in both php and the system, by converting the timezone name to it's current offset. Verify all three timezone offsets match.

Re: Update to 1.32.3 error

Posted: Mon Jan 07, 2019 11:12 am
by BiloxiGeek
They all agree with each other.

System:

Code: Select all

[root@icezone etc]# ll localtime
lrwxrwxrwx 1 root root 37 Mar 24  2015 localtime -> ../usr/share/zoneinfo/America/Chicago
/etc/php.ini:

Code: Select all

date.timezone = America/Chicago
Database:

Code: Select all

MariaDB [(none)]> use zm;
Database changed
MariaDB [zm]> SELECT TIMEDIFF(NOW(), UTC_TIMESTAMP);
+--------------------------------+
| TIMEDIFF(NOW(), UTC_TIMESTAMP) |
+--------------------------------+
| -06:00:00                      |
+--------------------------------+
1 row in set (0.05 sec)

MariaDB [zm]> 

Re: Update to 1.32.3 error

Posted: Thu Jul 18, 2019 6:34 pm
by Baylink
The GRANT fix early in this thread worked for me as well, sorting a broken PPA-based upgrade from 1.30.2, to 1.32.3, as covered in a thread elsewhere.

Thanks.