Page 1 of 1

1.28.100 failed upgrade Ubuntu 15.04

Posted: Mon Jul 27, 2015 12:05 am
by Fatman
Hi Everyone,

I was using 1.28.1 and performed a apt-get upgrade which failed to update zoneminder to version 1.28.100. Can anyone assist please?

I tried removing and re-installing but same issue.

apt-get install zoneminder

Reading package lists... Done
Building dependency tree
Reading state information... Done
zoneminder is already the newest version.
0 to upgrade, 0 to newly install, 0 to remove and 3 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up zoneminder (1.28.1+1-vivid-SNAPSHOT2015071501) ...

Initiating database upgrade to version 1.28.100 from version 1.28.1

Upgrading database to version 1.28.100
Loading config from DB
Saving config to DB
Upgrading DB to 1.28.1 from 1.28.1
Warning: Using a password on the command line interface can be insecure.

Database successfully upgraded to version 1.28.1.
Upgrading DB to 1.28.100 from 1.28.1
Warning: Using a password on the command line interface can be insecure.

Database successfully upgraded to version 1.28.100.
Upgrading DB to 1.28.99 from 1.28.1
Warning: Using a password on the command line interface can be insecure.
ERROR 1142 (42000) at line 376: CREATE command denied to user 'zmuser'@'localhost' for table 'Servers'
Output: Column Id exists in States
Column Id exists in States
Column IsActive exists in States
Column IsActive exists in States
Command 'mysql -hlocalhost -uzmuser -pzmpass zm < /usr/share/zoneminder/db/zm_update-1.28.99.sql' exited with status: 1
dpkg: error processing package zoneminder (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
zoneminder
E: Sub-process /usr/bin/dpkg returned an error code (1)


Any ideas and thanks in advance

Re: 1.28.100 failed upgrade Ubuntu 15.04

Posted: Mon Jul 27, 2015 12:20 am
by Fatman
Hi all,

note if i just run that command it fails

# mysql -hlocalhost -uzmuser -pzmpass zm < /usr/share/zoneminder/db/zm_update-1.28.99.sql
Warning: Using a password on the command line interface can be insecure.
Column Id exists in States
Column Id exists in States
Column IsActive exists in States
Column IsActive exists in States
ERROR 1142 (42000) at line 376: CREATE command denied to user 'zmuser'@'localhost' for table 'Servers'


- I believe its this section of the script that is failing, any pointers ??


SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name = 'Servers'
AND table_schema = DATABASE()
) > 0,
"SELECT 'Servers table exists'",
"CREATE TABLE `Servers` (
`Id` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(64) NOT NULL default '',
`State_Id` int(10) unsigned,
PRIMARY KEY (`Id`)
)"
));

PREPARE stmt FROM @s;
EXECUTE stmt;

Re: 1.28.100 failed upgrade Ubuntu 15.04

Posted: Mon Jul 27, 2015 7:47 pm
by bbunge
So, you upgraded Ubuntu 14.04 running Zoneminder 1.28.1 to Ubuntu 15.04? If so your 1.28.1 install was overwritten with Zoneminder 1.26.5 (which is the version in 15.04). And your database is corrupted, you are not a happy camper!

Easiest choice is to do a fresh install of Ubuntu 15.04 then install Zoneminder with the instructions on the WIKI.

You could try to purge Zoneminder (apt-get purge zoneminder), then follow the instructions on the WIKI to install Zoneminder.

bb

Re: 1.28.100 failed upgrade Ubuntu 15.04

Posted: Mon Jul 27, 2015 10:59 pm
by Fatman
Hi bbunge,

I installed zoneminder a month ago with 15.04 ubuntu and Zoneminder 1.28.1. Yesterday I performed the apt-get upgrade command to upgrade Zoneminder from 1.28.1 to 1.28.100.

Re: 1.28.100 failed upgrade Ubuntu 15.04

Posted: Mon Jul 27, 2015 11:20 pm
by bbunge
Interesting... Yesterday I did a fresh install of Zoneminder on Ubuntu 15.04 and ended up with ZM 1.28.2.

Might have to wait for the package maintainer to chime in. For now try the apt-get purge zoneminder and start over. If you really need to run a production system drop back to Ubuntu 14.04 LTS and install 1.28.1 from the PPA.

bb

Re: 1.28.100 failed upgrade Ubuntu 15.04

Posted: Tue Jul 28, 2015 1:25 am
by knight-of-ni
ERROR 1142 (42000) at line 376: CREATE command denied to user 'zmuser'@'localhost' for table 'Servers'
The zoneminder sql account does not have the necessary permission. That'll get ya every time. The mysql account zmuser must exist and it must have the following permissions:
create,select,insert,update,delete,lock tables,alter

Note that, you have chosen to run development snapshots of zoneminder, which will have problems time-to-time.

Re: 1.28.100 failed upgrade Ubuntu 15.04

Posted: Tue Jul 28, 2015 11:49 pm
by Fatman
Thanks knnniggett....... clearly needed a few more coffees or some sleep. manually ran script with the root user and it successfully updated DB.

This still means the apt-get upgrade process for zoneminder has an issue, but at least I was able to get myself out of trouble. Thanks for your assistance :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: