Update to 1.32.3 error

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Update to 1.32.3 error

Post by BiloxiGeek » Sat Dec 29, 2018 1:33 pm

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

User avatar
knight-of-ni
Posts: 2228
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Update to 1.32.3 error

Post by knight-of-ni » Sat Dec 29, 2018 2:38 pm

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
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Re: Update to 1.32.3 error

Post by BiloxiGeek » Mon Dec 31, 2018 2:44 pm

Thanks, that fixed the problem. It's back up and running as expected again.

User avatar
knight-of-ni
Posts: 2228
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Update to 1.32.3 error

Post by knight-of-ni » Mon Dec 31, 2018 2:54 pm

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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Re: Update to 1.32.3 error

Post by BiloxiGeek » Mon Dec 31, 2018 3:16 pm

Yep, didn't notice the change but it looks exactly as you say it should.

BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Re: Update to 1.32.3 error

Post by BiloxiGeek » Mon Dec 31, 2018 4:15 pm

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 3284 times

User avatar
knight-of-ni
Posts: 2228
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Update to 1.32.3 error

Post by knight-of-ni » Mon Dec 31, 2018 4:17 pm

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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Re: Update to 1.32.3 error

Post by BiloxiGeek » Mon Dec 31, 2018 4:28 pm

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.

BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Re: Update to 1.32.3 error

Post by BiloxiGeek » Tue Jan 01, 2019 1:48 pm

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 3259 times

User avatar
knight-of-ni
Posts: 2228
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Update to 1.32.3 error

Post by knight-of-ni » Tue Jan 01, 2019 2:08 pm

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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Re: Update to 1.32.3 error

Post by BiloxiGeek » Tue Jan 01, 2019 2:21 pm

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.

User avatar
knight-of-ni
Posts: 2228
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Update to 1.32.3 error

Post by knight-of-ni » Sun Jan 06, 2019 2:18 pm

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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

BiloxiGeek
Posts: 240
Joined: Tue Feb 11, 2014 2:04 pm

Re: Update to 1.32.3 error

Post by BiloxiGeek » Mon Jan 07, 2019 11:12 am

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]> 

Baylink
Posts: 330
Joined: Sun Jun 19, 2005 3:19 am

Re: Update to 1.32.3 error

Post by Baylink » Thu Jul 18, 2019 6:34 pm

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.

Post Reply

Who is online

Users browsing this forum: davama and 4 guests