You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Sanjay Tripathi <sa...@citrix.com> on 2013/02/18 19:19:32 UTC

unable to upgrade database to 4.2.0

Hi all,

It seems like CloudStack is not upgrading the database to 4.2.0.
I checked the DatabaseUpgradeChecker file and the Upgrade410to420() was missing from "upgradeMap", so I added it but after this, CloudStack throwing this error:
"The end upgrade version is actually at 4.2.0 but our management server code version is at 4.1.0-SNAPSHOT".
This is because our MS code version is 4.1.0 so CS is not allowing to upgrade database beyond 4.1.0 .

Is there any other way to upgrade the database or we have to change the MS code version to 4.2.0-SNAPSHOT?

Regards,
Sanjay

RE: unable to upgrade database to 4.2.0

Posted by Koushik Das <ko...@citrix.com>.
As part of the DB changes create-schema.sql was changed to remove all changes post 4.0. So as part of that the changes to hypervisor_capabilities table also got removed. I later moved it to 410to420.sql.
@Sanjay: To fix your issue try recreating the db or locally comment out the relevant lines in 410to420.sql.

-Koushik

> -----Original Message-----
> From: Sanjay Tripathi
> Sent: Tuesday, February 19, 2013 5:57 PM
> To: cloudstack-dev@incubator.apache.org
> Cc: Koushik Das
> Subject: RE: unable to upgrade database to 4.2.0
> 
> 
> As a workaround, in DatabaseUpgradeChecker I added the upgrade path in
> maps and commented out the database version check with MS code Version,
> that worked.
> 
> 
> @Koushik: while running the jetty server, getting this error:
> 
> ERROR [utils.db.ScriptRunner] (main:) Error executing: ALTER TABLE
> `cloud`.`hypervisor_capabilities` ADD COLUMN `max_hosts_per_cluster` int
> unsigned DEFAULT NULL COMMENT 'Max. hosts in cluster supported by
> hypervisor'
> ERROR [utils.db.ScriptRunner] (main:)
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate
> column name 'max_hosts_per_cluster'
> 
> I checked create-schema.sql and  "max_hosts_percluster" column is already
> present in "hypervisor_capabilities" table.
> Can you pls remove the sql queries which are not required in schema-
> 410to420.sql.
> 
> Thanks,
> Sanjay
> 
> > -----Original Message-----
> > From: rohityadav89@gmail.com [mailto:rohityadav89@gmail.com] On
> Behalf
> > Of Rohit Yadav
> > Sent: Tuesday, February 19, 2013 4:10 PM
> > To: cloudstack-dev@incubator.apache.org
> > Subject: Re: unable to upgrade database to 4.2.0
> >
> > On Mon, Feb 18, 2013 at 11:49 PM, Sanjay Tripathi
> > <sa...@citrix.com> wrote:
> > > Hi all,
> > >
> > > It seems like CloudStack is not upgrading the database to 4.2.0.
> > > I checked the DatabaseUpgradeChecker file and the Upgrade410to420()
> > was missing from "upgradeMap", so I added it but after this,
> > CloudStack throwing this error:
> > > "The end upgrade version is actually at 4.2.0 but our management
> > > server
> > code version is at 4.1.0-SNAPSHOT".
> > > This is because our MS code version is 4.1.0 so CS is not allowing
> > > to upgrade
> > database beyond 4.1.0 .
> > >
> > > Is there any other way to upgrade the database or we have to change
> > > the
> > MS code version to 4.2.0-SNAPSHOT?
> >
> > That is one way to fix it in pom, or if you want to enforce you can
> > change the target or pkg version in DatabaseUpgraderChecker (make sure
> > you add an upgrade path in the maps):
> >                 String dbVersion = _dao.getCurrentVersion();
> >                 String currentVersion =
> > this.getClass().getPackage().getImplementationVersion();
> >
> > I'll send out an email to change the version to 4.2.0 now that we've
> > branched out 4.1 already.
> >
> > Regards.
> >
> > >
> > > Regards,
> > > Sanjay

Re: unable to upgrade database to 4.2.0

Posted by Rohit Yadav <bh...@apache.org>.
Yes, I've sent them email on that, the create-schema should not
diverge from 4.0 create-schema except for the drop table rules. There
is another thread on that http://markmail.org/message/2v3hqmanasol6okw

And I started a thread on fixing those diversions:
http://markmail.org/thread/z32xdbr2injgjrrp

We have to move them (the changes) to schema upgrade paths in
schema-40to41 and schema-41to42 as applicable and as soon as possible.

Regards.

On Tue, Feb 19, 2013 at 5:56 PM, Sanjay Tripathi
<sa...@citrix.com> wrote:
>
> As a workaround, in DatabaseUpgradeChecker I added the upgrade path in maps and commented out the database version check with MS code Version, that worked.
>
>
> @Koushik: while running the jetty server, getting this error:
>
> ERROR [utils.db.ScriptRunner] (main:) Error executing: ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_hosts_per_cluster` int unsigned DEFAULT NULL COMMENT 'Max. hosts in cluster supported by hypervisor'
> ERROR [utils.db.ScriptRunner] (main:) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'max_hosts_per_cluster'
>
> I checked create-schema.sql and  "max_hosts_percluster" column is already present in "hypervisor_capabilities" table.
> Can you pls remove the sql queries which are not required in schema-410to420.sql.
>
> Thanks,
> Sanjay
>
>> -----Original Message-----
>> From: rohityadav89@gmail.com [mailto:rohityadav89@gmail.com] On Behalf
>> Of Rohit Yadav
>> Sent: Tuesday, February 19, 2013 4:10 PM
>> To: cloudstack-dev@incubator.apache.org
>> Subject: Re: unable to upgrade database to 4.2.0
>>
>> On Mon, Feb 18, 2013 at 11:49 PM, Sanjay Tripathi
>> <sa...@citrix.com> wrote:
>> > Hi all,
>> >
>> > It seems like CloudStack is not upgrading the database to 4.2.0.
>> > I checked the DatabaseUpgradeChecker file and the Upgrade410to420()
>> was missing from "upgradeMap", so I added it but after this, CloudStack
>> throwing this error:
>> > "The end upgrade version is actually at 4.2.0 but our management server
>> code version is at 4.1.0-SNAPSHOT".
>> > This is because our MS code version is 4.1.0 so CS is not allowing to upgrade
>> database beyond 4.1.0 .
>> >
>> > Is there any other way to upgrade the database or we have to change the
>> MS code version to 4.2.0-SNAPSHOT?
>>
>> That is one way to fix it in pom, or if you want to enforce you can change the
>> target or pkg version in DatabaseUpgraderChecker (make sure you add an
>> upgrade path in the maps):
>>                 String dbVersion = _dao.getCurrentVersion();
>>                 String currentVersion =
>> this.getClass().getPackage().getImplementationVersion();
>>
>> I'll send out an email to change the version to 4.2.0 now that we've branched
>> out 4.1 already.
>>
>> Regards.
>>
>> >
>> > Regards,
>> > Sanjay

RE: unable to upgrade database to 4.2.0

Posted by Sanjay Tripathi <sa...@citrix.com>.
As a workaround, in DatabaseUpgradeChecker I added the upgrade path in maps and commented out the database version check with MS code Version, that worked.


@Koushik: while running the jetty server, getting this error:

ERROR [utils.db.ScriptRunner] (main:) Error executing: ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `max_hosts_per_cluster` int unsigned DEFAULT NULL COMMENT 'Max. hosts in cluster supported by hypervisor'
ERROR [utils.db.ScriptRunner] (main:) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'max_hosts_per_cluster'

I checked create-schema.sql and  "max_hosts_percluster" column is already present in "hypervisor_capabilities" table.
Can you pls remove the sql queries which are not required in schema-410to420.sql.

Thanks,
Sanjay

> -----Original Message-----
> From: rohityadav89@gmail.com [mailto:rohityadav89@gmail.com] On Behalf
> Of Rohit Yadav
> Sent: Tuesday, February 19, 2013 4:10 PM
> To: cloudstack-dev@incubator.apache.org
> Subject: Re: unable to upgrade database to 4.2.0
> 
> On Mon, Feb 18, 2013 at 11:49 PM, Sanjay Tripathi
> <sa...@citrix.com> wrote:
> > Hi all,
> >
> > It seems like CloudStack is not upgrading the database to 4.2.0.
> > I checked the DatabaseUpgradeChecker file and the Upgrade410to420()
> was missing from "upgradeMap", so I added it but after this, CloudStack
> throwing this error:
> > "The end upgrade version is actually at 4.2.0 but our management server
> code version is at 4.1.0-SNAPSHOT".
> > This is because our MS code version is 4.1.0 so CS is not allowing to upgrade
> database beyond 4.1.0 .
> >
> > Is there any other way to upgrade the database or we have to change the
> MS code version to 4.2.0-SNAPSHOT?
> 
> That is one way to fix it in pom, or if you want to enforce you can change the
> target or pkg version in DatabaseUpgraderChecker (make sure you add an
> upgrade path in the maps):
>                 String dbVersion = _dao.getCurrentVersion();
>                 String currentVersion =
> this.getClass().getPackage().getImplementationVersion();
> 
> I'll send out an email to change the version to 4.2.0 now that we've branched
> out 4.1 already.
> 
> Regards.
> 
> >
> > Regards,
> > Sanjay

Re: unable to upgrade database to 4.2.0

Posted by Rohit Yadav <bh...@apache.org>.
On Mon, Feb 18, 2013 at 11:49 PM, Sanjay Tripathi
<sa...@citrix.com> wrote:
> Hi all,
>
> It seems like CloudStack is not upgrading the database to 4.2.0.
> I checked the DatabaseUpgradeChecker file and the Upgrade410to420() was missing from "upgradeMap", so I added it but after this, CloudStack throwing this error:
> "The end upgrade version is actually at 4.2.0 but our management server code version is at 4.1.0-SNAPSHOT".
> This is because our MS code version is 4.1.0 so CS is not allowing to upgrade database beyond 4.1.0 .
>
> Is there any other way to upgrade the database or we have to change the MS code version to 4.2.0-SNAPSHOT?

That is one way to fix it in pom, or if you want to enforce you can
change the target or pkg version in DatabaseUpgraderChecker (make sure
you add an upgrade path in the maps):
                String dbVersion = _dao.getCurrentVersion();
                String currentVersion =
this.getClass().getPackage().getImplementationVersion();

I'll send out an email to change the version to 4.2.0 now that we've
branched out 4.1 already.

Regards.

>
> Regards,
> Sanjay