You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "Alena Prokharchyk (JIRA)" <ji...@apache.org> on 2014/02/07 19:59:21 UTC

[jira] [Commented] (CLOUDSTACK-6061) Unable to execute upgrade script: schema-421to430.sql, Duplicate column name 'related'

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-6061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13894856#comment-13894856 ] 

Alena Prokharchyk commented on CLOUDSTACK-6061:
-----------------------------------------------

Nux, this problem usually happens when the upgrade was run twice, failed the first time, and the db rollback wasn't performed after failure as suggested by the Install guide.
I suspect that this is what happened - need you to double check:

1) You've started upgrading from 4.2.1 to 4.3, but forgot to install the new template while being on 4.2.1. So the upgrade started updating the tables,then found the template is missing, and failed. The code doesn't do automatic rollback, to the db version still says 4.2.1, and some tables/fields inserted by 4.2.1-4.3 upgrade script, are already present.
2) You forgot to rollback, installed a new template, and tried to run t he upgrade script again.
3) The upgrade script will run 4.2.1-4.3 upgrade again, and it fails because the fields are present.

To confirm that the upgrade was ran twice, please check this sentence in MS log. If you see it more than once, then my theory is correct, and you have to run the upgrade fresh:

"Database upgrade must be performed from 4.2.1 to 4.3.0"

> Unable to execute upgrade script: schema-421to430.sql, Duplicate column name 'related'
> --------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-6061
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6061
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Management Server
>    Affects Versions: 4.2.1, 4.3.0
>         Environment: CentOS 6.5 x86_64 management server
> Using http://tmp.nux.ro/cloudsnap430_4308/ built from revision 4308
>            Reporter: Nux
>            Assignee: Alena Prokharchyk
>            Priority: Critical
>              Labels: db, upgrade
>
> Running an advanced zone with SG on 4.2.1, NFS primary and secondary storage, one instance and one extra volume. One management server, 2 HVs.
> Upgraded to 4.3.0 as follows:
> 1. service cloudstack-management stop
> 2. yum -y update (to update cloudstack-* rpms)
> 3. Add new SystemVM tmplate
> /usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt -m /mnt/secondary -u http://jenkins.buildacloud.org/view/4.3/job/cloudstack-4.3-systemvm/lastSuccessfulBuild/artifact/tools/appliance/dist/systemvmtemplate-2014-02-06-master-kvm.qcow2.bz2  -h kvm -F
> 4. service cloudstack-management start
> The following shows up in the management log:
> http://fpaste.org/75337/
> This is how my cloud DB looked like BEFORE the upgrade; this is the working 4.2.1 DB:
> http://tmp.nux.ro/ifu82kcloud.sql
> One Note:
> If I install 4.2.1 and run cloudstack-setup-databases and right after this upgrade to 4.3.0 then there is no problem.
> If I start using 4.2.1, add zones, HVs etc to it and THEN try to upgrade to 4.3.0 then the problem appears.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)