Updating on the stable PPA

Forum for questions and support relating to the 1.29.x releases only.
Locked
aptalca
Posts: 3
Joined: Sat Jun 20, 2015 5:48 pm

Updating on the stable PPA

Post by aptalca »

Quick question,

I noticed that updating from 1.28.1 to 1.29 release candidate requires manual intervention (database update & mysql permissions)

If one is on the stable PPA (iconnor's on ubuntu 14.04), should one expect the update to 1.29 to happen automatically without user intervention once 1.29 is released as stable?

The reason I am asking is I am maintaining a docker version of zoneminder and I would hate it to break for all the users at once. I'd rather make the necessary changes to the container before the stable is released.

Here's my container for reference: https://hub.docker.com/r/aptalca/docker-zoneminder/

Thanks
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Updating on the stable PPA

Post by bbunge »

The "plan" for 1.29.x in Ubuntu was to make the install "Debian like" which would require the database to be created or updated manually. However, there has been some recent discussion on this topic and the package maintainer for ZM under Ubuntu is wondering if he should stick with this change. As for now I am going to wait and see and prepare for either eventuality.

bb
summetj
Posts: 11
Joined: Sat Jan 01, 2011 12:48 pm

Re: Updating on the stable PPA

Post by summetj »

My PPA updated from 1.28 to 1.29. and zoneminder failed to restart.

I ran the database update script successfully and now the zoneminder service has restarted, but none of my cameras are working.

Can you tell me more details about the manual corection for "mysql permissions" that you mention above?
Or if anybody else knows what steps I need to do to finish the update manually so my cameras work.

(They all show up as red in the main website, and I get no video feeds from them.)
Thanks,
Jay
aptalca
Posts: 3
Joined: Sat Jun 20, 2015 5:48 pm

Re: Updating on the stable PPA

Post by aptalca »

bbunge wrote:The "plan" for 1.29.x in Ubuntu was to make the install "Debian like" which would require the database to be created or updated manually. However, there has been some recent discussion on this topic and the package maintainer for ZM under Ubuntu is wondering if he should stick with this change. As for now I am going to wait and see and prepare for either eventuality.

bb
Thanks for the update. I hope the stable branch doesn't just update, breaking it for all of my users. I will wait and see.
summetj wrote: My PPA updated from 1.28 to 1.29. and zoneminder failed to restart.

I ran the database update script successfully and now the zoneminder service has restarted, but none of my cameras are working.

Can you tell me more details about the manual corection for "mysql permissions" that you mention above?
Or if anybody else knows what steps I need to do to finish the update manually so my cameras work.

(They all show up as red in the main website, and I get no video feeds from them.)
Thanks,
Jay
This page details the steps needed to fix it: https://github.com/pliablepixels/zmNinj ... PI-package
summetj
Posts: 11
Joined: Sat Jan 01, 2011 12:48 pm

Re: Updating on the stable PPA

Post by summetj »

Is there a way to do this without changing my repository to -master?

I wanted to stay on the "stable" repository, (after all, the stable repository upgraded to 1.29, why do I need to switch to the -master?)


I followed all of the directions, but am still getting a problem. It looks like my database is missing something important (ServerID related?).
The web interface works fine, but none of the cameras are capturing because the backend (zmdc?) are not able to start due to a problem when they try to get some configuration data from the database.

(I ran the zmupdate.pl file and it reports that the database is correctly updated to 1.29.0)



The logs show:
Jan 12 20:32:38 igor zmwatch[25511]: INF [Restarting capture daemon for BabyMonitor, shared data not valid]
Jan 12 20:32:38 igor undef[26077]: ERR [Bogus number of lines return from query, 0 returned for query SELECT Id FROM Servers WHERE Name='192.168.2.16'.]
Jan 12 20:32:38 igor undef[26077]: FAT [Can't get ServerId for Server 192.168.2.16]
Jan 12 20:32:38 igor zmdc[25412]: ERR ['zmc -m 4' exited abnormally, exit status 255]
Jan 12 20:32:38 igor zmdc[25412]: INF ['zmc -m 6' starting at 16/01/12 20:32:38, pid = 26083]
Jan 12 20:32:38 igor zmdc[26083]: INF ['zmc -m 6' started at 16/01/12 20:32:38]
Jan 12 20:32:39 igor zmwatch[25511]: ERR [Memory map file '/dev/shm/zm.mmap.7' does not exist. zmc might not be running.]
Jan 12 20:32:39 igor zmwatch[25511]: INF [Restarting capture daemon for Back, shared data not valid]
Jan 12 20:32:39 igor undef[26083]: ERR [Bogus number of lines return from query, 0 returned for query SELECT Id FROM Servers WHERE Name='192.168.2.16'.]
Jan 12 20:32:39 igor undef[26083]: FAT [Can't get ServerId for Server 192.168.2.16]
Jan 12 20:32:39 igor zmdc[25412]: ERR ['zmc -m 6' exited abnormally, exit status 255]
Jan 12 20:32:39 igor zmdc[25412]: INF ['zmc -m 7' starting at 16/01/12 20:32:39, pid = 26088]
Jan 12 20:32:39 igor zmdc[26088]: INF ['zmc -m 7' started at 16/01/12 20:32:39]
Jan 12 20:32:39 igor undef[26088]: ERR [Bogus number of lines return from query, 0 returned for query SELECT Id FROM Servers WHERE Name='192.168.2.16'.]
Jan 12 20:32:39 igor undef[26088]: FAT [Can't get ServerId for Server 192.168.2.16]
Jan 12 20:32:39 igor zmdc[25412]: ERR ['zmc -m 7' exited abnormally, exit status 255]
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Updating on the stable PPA

Post by bbunge »

Ah... as of 12JAN16 the stable repository only contains ZM 1.28.1 for Ubuntu 14.04.

https://launchpad.net/~iconnor/+archive ... zoneminder

If you got 1.29.0 you are on the development version: zoneminder-master

I sure hope I'm not reading you wrong. It has been a long two days of travel up the East coast to discover my home network had gone south thanks to Century Link changing some things... :-(
summetj
Posts: 11
Joined: Sat Jan 01, 2011 12:48 pm

Re: Updating on the stable PPA

Post by summetj »

I was definitely at 1.28.x and then when I did a "apt-get grade" it moved me to 1.29.0...so perhaps I was on the master all along.

In any case, after the upgrade everything broke and isn't working, which isn't the behaviour I would expect from an automated package based upgrade.

I think I have a line on the problem. In the web gui there is a "servers" tab that has no servers listed. I tried to add a server with the appropriate hostname and IP port, and I got the following error message:
SQL-ERR 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Hostname' in 'field list'', statement was 'INSERT INTO Servers set Name = 'Igor', Hostname = '192.168.2.16''

It looks like my ZMC's are looking for this info, and it wasn't there in my 1.28 version, and the zmupdate.pl file may have put the table into the database, but something about that table isn't quite right for the version I have installed.

Anybody have a suggestion that doesn't involve blowing my entire database away and reloading it?

When I go into the database the table looks like this:
mysql> show columns in Servers;
+----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+------------------+------+-----+---------+----------------+
| Id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| Name | varchar(64) | NO | | | |
| State_Id | int(10) unsigned | YES | | NULL | |
+----------+------------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

The web gui is complaining that there isn't a "Hostname" field, so something went wonky with the database upgrade.

When I try to run it again, I get:
Database already at version 1.29.0, update aborted.
summetj
Posts: 11
Joined: Sat Jan 01, 2011 12:48 pm

Re: Updating on the stable PPA

Post by summetj »

Update: for some reason the database upgrade procedure missed the zm_update-1.28.109.sql file (I don't know why, or if any others updates were missed.) This resulted in the above table not having "Hostname" entry in it. I ran the update procedure (below) manually to add it. This allowed me to add the local server (using the IP for the name and the hostname) in the web GUI without the error I had been getting previously, and this got rid of the errors the ZMC's were having, and everything stated to work again!
Jay



-- This updates a 1.28.106 database to 1.28.107

SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Servers'
AND table_schema = DATABASE()
AND column_name = 'Hostname'
) > 0,
"SELECT 'Column Hostname already exists in Servers'",
"ALTER TABLE `Servers` ADD COLUMN `Hostname` TEXT AFTER Name"
));

PREPARE stmt FROM @s;
EXECUTE stmt;
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Updating on the stable PPA

Post by bbunge »

Known issue which has been fixed in the current versions on the PPA master.

viewtopic.php?f=34&t=23860
summetj
Posts: 11
Joined: Sat Jan 01, 2011 12:48 pm

Re: Updating on the stable PPA

Post by summetj »

Glad it was fixed, I wasn't sure if it was just something funky about my set up of if it was affecting others.
Locked