(Closed) 1.28.1 Upgrade not updating database

Forum for questions and support relating to the 1.28.x releases only.
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

(Closed) 1.28.1 Upgrade not updating database

Post by chippy99 »

Hi, just upgraded to 1.28.1 and all seems ok so far except that when I ran

Code: Select all

zmupdate.pl --user=user --pass=pass
I got the message "Database already at version 1.28.0, update aborted". On the web interface I had V1.28.1 in red and when I clicked on it I got message to run zmupdate.pl.
I fixed it by manually updating the database with

Code: Select all

ALTER TABLE Monitors MODIFY Device tinytext;
as required for the upgrade and then

Code: Select all

update Config set Value="1.28.1" where value = "1.28.0";
So if you get the problem this may help but if this is a problem not just specific to me then it probably needs fixing in the install code.
Last edited by chippy99 on Wed Feb 18, 2015 2:10 pm, edited 1 time in total.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: 1.28.1 Upgrade not updating database

Post by knight-of-ni »

What distro are you running and how did you install zoneminder?
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/
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.28.1 Upgrade not updating database

Post by chippy99 »

That was quick !!

I am running Archlinux and I got the install from link in the announcement on this forum.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: 1.28.1 Upgrade not updating database

Post by knight-of-ni »

I edited the release, without making any changes, and re-saved the page, which triggered creation of a new tar.gz.
I have verified that the new tar.gz contains the proper references to 1.28.1. Go ahead and re-download the source files. It should be fixed.

Something very strange happened on github that I can't explain. When I created the release over the weekend, the first thing I noticed was that it said "10 days" ago when I just created the release seconds ago. Thanks to your post, I just now noticed that it did not create the .tar.gz correctly. I guess the .tar.gz was a repsentation of the release branch from 10 days ago as well.

I didn't noticed it earlier, because the rpms I build are based directly off a git-clone of the release branch, and did not exeprience the issue. Don't expect you to know any of this, I'm just baffled as to how this happened in the first place, which sucks because I don't know how to avoid it in the future.
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/
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.28.1 Upgrade not updating database

Post by chippy99 »

Ok, thanks for the update.
Does this mean I do not have the latest build of 1.28.1 and should I download it again ?
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: 1.28.1 Upgrade not updating database

Post by knight-of-ni »

If zoneminder is no longer displaying the version in red and/or refusing to start then you are good.
From what you posted, it looks like you discovered all the bits that were not correct and manually fixed them.
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/
chippy99
Posts: 66
Joined: Wed Aug 30, 2006 5:38 pm
Location: Barnet, Herts. UK

Re: 1.28.1 Upgrade not updating database

Post by chippy99 »

Ok, it all seems ok so I'll leave it alone, thanks again.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: (Closed) 1.28.1 Upgrade not updating database

Post by knight-of-ni »

Thanks for letting us know. I had no idea the source tarball was not right.
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/
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: (Closed) 1.28.1 Upgrade not updating database

Post by McFuzz »

Hello,

I just downloaded the tarball form the website, literally minutes ago, and it is still not working right:

Code: Select all

root@lulzsec:/usr/src/ZoneMinder-1.28.1/scripts# perl ./zmupdate.pl --version=1.28.0 --user=root --pass=xxxxxxx

Database already at version 1.28.0, update aborted.
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: (Closed) 1.28.1 Upgrade not updating database

Post by knight-of-ni »

The current tarball contents looks correct.
Make sure you are starting from a clean state before you (re)build. Make-uninstall the previous attempt.
When you expand the source files, open the file configure.ac. The second line, AC_INIT, should be at 1.28.1.
If that is not the case, then you somehow have a copy of the old tarball.
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/
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: (Closed) 1.28.1 Upgrade not updating database

Post by McFuzz »

knnniggett wrote:The current tarball contents looks correct.
Make sure you are starting from a clean state before you (re)build. Make-uninstall the previous attempt.
When you expand the source files, open the file configure.ac. The second line, AC_INIT, should be at 1.28.1.
If that is not the case, then you somehow have a copy of the old tarball.
Thankfully - I run a VM so I just reverted back to pre-upgrade state. I'll try it once more.

Edit: just did a clean slate - yes, configure.ac does show 1.28.1 - but still, the update fails!
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: (Closed) 1.28.1 Upgrade not updating database

Post by McFuzz »

I don't know if it matter at all - but this is what the DB reports prior to compiling the update:

Image
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: (Closed) 1.28.1 Upgrade not updating database

Post by McFuzz »

Here's another interesting tidbit - I tried to manually update the DB (run the commands in mysql cli) and while the UI now displays the 1.28.1 version in blue as opposed to red, ZM service fails to start, stating the following:

Code: Select all

Feb 18 10:55:33 lulzsec zmpkg[14428]: FAT [Version mismatch, system is version 1.28.0, database is 1.28.1, please run zmupdate.pl to update.]


Now I am really confused - what's going on here? I've done upgrades many times... never have had this kind of an issue. I am even tried doing a clean install (but kept the DB) - it still complains!
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: (Closed) 1.28.1 Upgrade not updating database

Post by knight-of-ni »

This message:

Code: Select all

Version mismatch, system is version 1.28.0, database is 1.28.1
Looks like this in the source code:

Code: Select all

Version mismatch, system is version ".ZM_VERSION.", database is ".$Config{ZM_DYN_DB_VERSION}.
ZM_DYN_DB_VERSION is at 1.28.1, which means you've updated the database correctly, but ZM_VERSION is still 1.28.0.

So where does ZM_VERSION come from?
It gets set in the Perl script called "Base.pm". On my system, that file is here:
/usr/share/perl5/vendor_perl/ZoneMinder/Base.pm

Yours is probably under /usr/local if you are not building a package

On a compiled system, the value of ZM_VERSION in Base.pm is going to look like a static number:

Code: Select all

use constant ZM_VERSION => "1.28.1";
But if you look at the uncompiled source code, it is really tied to the make macro @VERSION@:

Code: Select all

use constant ZM_VERSION => "@VERSION@";
The value @VERSION@ represents the value I mentioned previsouly, AC_INIT, at line 2 of configure.ac
So if ZM_VERSION is 1.28.0, then that can only mean you've got files on your system that were built with a configure.ac still at the old 1.28.0.

I can't see exactly what you are doing, but somehow or someway, you've either got stale files hanging around or you are building off of a configure.ac that has 1.28.0 in it and you don't realize it. That is the only thing it could be.
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/
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: (Closed) 1.28.1 Upgrade not updating database

Post by McFuzz »

Must be a stale file, then. I double checked configure.ac several time and it points to 1.28.1:

Code: Select all

root@lulzsec:/usr/src/ZoneMinder-1.28.1# cat configure.ac | grep AC_INIT
AC_INIT(zm,1.28.1,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
root@lulzsec:/usr/src/ZoneMinder-1.28.1#
Now - I just re-downloaded the tarball from the website and recompiled it. Here's what Base.pm shows now; I have not run make install yet:

Code: Select all

use constant ZM_VERSION => "1.28.1";
So now I ran make install - all went through just fine; no errors. Try to run the update script - same exact issue; still complains that I am on 1.28.0.


Where is the .ZM_VERSION value written after compiling and installing?


And here's the most baffling thing:

This is what the UI shows while the service is offline:

Image

Ok - so at this point I went into mysql cli and modified the Monitor table as well as update config to reflect 1.28.1; have not started the service yet but refreshed the UI:

Image

At this point - all is well. Now I try to start the UI...:

Code: Select all

root@lulzsec:/usr/local/bin# service zm start
Starting ZoneMinder: failure

root@lulzsec:/usr/local/bin# tail /var/log/syslog
.....
Feb 18 12:22:06 lulzsec zmpkg[13975]: FAT [Version mismatch, system is version 1.28.0, database is 1.28.1, please run zmupdate.pl to update.]


Back to square one :|


The ONLY thing I can think of is that perhaps when compiling it is reading Base.pm from a previous version folder? I have some of the older source codes in /usr/src but in their own directories. I don't have anything pointing to those and it has never been a problem before. I suppose I can try and recompile everything after cleaning the old versions, though.


By the way - I also have Base.pm in /usr/local/share/perl5/ZoneMinder/Base.pm after compilation and it too shows 1.28.1...
Locked