1.28.100 failed upgrade Ubuntu 15.04

Forum for questions and support relating to the 1.28.x releases only.
Locked
Fatman
Posts: 12
Joined: Mon May 07, 2012 12:24 pm

1.28.100 failed upgrade Ubuntu 15.04

Post 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
Fatman
Posts: 12
Joined: Mon May 07, 2012 12:24 pm

Re: 1.28.100 failed upgrade Ubuntu 15.04

Post 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;
bbunge
Posts: 2944
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: 1.28.100 failed upgrade Ubuntu 15.04

Post 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
Fatman
Posts: 12
Joined: Mon May 07, 2012 12:24 pm

Re: 1.28.100 failed upgrade Ubuntu 15.04

Post 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.
bbunge
Posts: 2944
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: 1.28.100 failed upgrade Ubuntu 15.04

Post 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
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: 1.28.100 failed upgrade Ubuntu 15.04

Post 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.
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/
Fatman
Posts: 12
Joined: Mon May 07, 2012 12:24 pm

Re: 1.28.100 failed upgrade Ubuntu 15.04

Post 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:
Locked