incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohit Yadav (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (CLOUDSTACK-1355) Exception when DB upgrade from 4.0.0 to 4.2.0-SNAPSHOT
Date Fri, 22 Feb 2013 13:48:13 GMT

     [ https://issues.apache.org/jira/browse/CLOUDSTACK-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rohit Yadav updated CLOUDSTACK-1355:
------------------------------------

    Comment: was deleted

(was: I deployed the 4.0 database and ran mgmt server from master; while I was not able to
produce the exception Gavin got, instead I got this exception:

2013-02-22 18:40:52.258:WARN:/client:unavailable
com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql.jdbc.JDBC4PreparedStatement@d573f78:
SELECT vm_template.id, vm_template.format, vm_template.unique_name, vm_template.name, vm_template.public,
vm_template.featured, vm_template.type, vm_template.url, vm_template.hvm, vm_template.bits,
vm_template.created, vm_template.removed, vm_template.account_id, vm_template.checksum, vm_template.display_text,
vm_template.enable_password, vm_template.guest_os_id, vm_template.bootable, vm_template.prepopulate,
vm_template.cross_zones, vm_template.hypervisor_type, vm_template.extractable, vm_template.source_template_id,
vm_template.template_tag, vm_template.uuid, vm_template.sort_key, vm_template.enable_sshkey,
vm_template.image_data_store_id, vm_template.size, vm_template.state, vm_template.update_count,
vm_template.updated FROM vm_template WHERE vm_template.name = _binary'vmware-tools.iso'  ORDER
BY RAND() LIMIT 1)
    
> Exception when DB upgrade  from 4.0.0 to 4.2.0-SNAPSHOT
> -------------------------------------------------------
>
>                 Key: CLOUDSTACK-1355
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1355
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Install and Setup
>    Affects Versions: 4.2.0
>         Environment: osx 10.8.2
> apache-maven-3.0.4
>            Reporter: gavin lee
>            Assignee: Rohit Yadav
>              Labels: db, upgrade
>             Fix For: 4.2.0
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> Build for DevCloud on master, after pull latest code, run jetty will raise below Exception:
> bash$ mvn -pl client jetty:run
> INFO  [cloud.upgrade.DatabaseUpgradeChecker] (main:) Grabbing lock to check for database
upgrade.
> INFO  [cloud.upgrade.DatabaseUpgradeChecker] (main:) DB version = 4.0.0 Code Version
= 4.2.0-SNAPSHOT
> INFO  [cloud.upgrade.DatabaseUpgradeChecker] (main:) Database upgrade must be performed
from 4.0.0 to 4.2.0-SNAPSHOT
> ERROR [utils.db.ScriptRunner] (main:) Error executing: alter table storage_pool modify
id bigint unsigned AUTO_INCREMENT UNIQUE NOT NULL 
> ERROR [utils.db.ScriptRunner] (main:) java.sql.SQLException: Cannot change column 'id':
used in a foreign key constraint 'fk_storage_pool_details__pool_id' of table 'cloud.storage_pool_details'
> ERROR [cloud.upgrade.DatabaseUpgradeChecker] (main:) Unable to execute upgrade script:
/Users/gavin_lee/projects/cs-apache/incubator-cloudstack/client/target/utilities/scripts/db/db/schema-40to410.sql
> java.sql.SQLException: Cannot change column 'id': used in a foreign key constraint 'fk_storage_pool_details__pool_id'
of table 'cloud.storage_pool_details'
> 	at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:193)
> 	at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:87)
> 	at com.cloud.upgrade.DatabaseUpgradeChecker.runScript(DatabaseUpgradeChecker.java:172)
> 	at com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.java:232)
> 	at com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.java:357)
> 	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
> 	at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> 	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
> 	at com.cloud.utils.db.TransactionContextBuilder.AroundAnyMethod(TransactionContextBuilder.java:43)
> 	at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
> 	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
> 	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> 	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
> 	at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
> 	at com.cloud.utils.component.ComponentContext.initComponentsLifeCycle(ComponentContext.java:72)
> When apply following work around:
> SET foreign_key_checks = 0; 
> on top of setup/db/db/schema-40to410.sql
> and 
> SET foreign_key_checks = 1; 
> at bottom of setup/db/db/schema-40to410.sql
> Another exception will raise:
> INFO  [cloud.upgrade.DatabaseUpgradeChecker] (main:) Grabbing lock to check for database
upgrade.
> INFO  [cloud.upgrade.DatabaseUpgradeChecker] (main:) DB version = 4.0.0 Code Version
= 4.2.0-SNAPSHOT
> INFO  [cloud.upgrade.DatabaseUpgradeChecker] (main:) Database upgrade must be performed
from 4.0.0 to 4.2.0-SNAPSHOT
> ERROR [utils.db.ScriptRunner] (main:) Error executing: alter table vm_template add image_data_store_id
bigint unsigned 
> ERROR [utils.db.ScriptRunner] (main:) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
Duplicate column name 'image_data_store_id'
> ERROR [cloud.upgrade.DatabaseUpgradeChecker] (main:) Unable to execute upgrade script:
/Users/gavin_lee/projects/cs-apache/incubator-cloudstack/client/target/utilities/scripts/db/db/schema-40to410.sql
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'image_data_store_id'
> 	at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:193)
> 	at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:87)
> 	at com.cloud.upgrade.DatabaseUpgradeChecker.runScript(DatabaseUpgradeChecker.java:172)
> 	at com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.java:232)
> 	at com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.java:357)
> 	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
> 	at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
> 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
> 	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
> 	at com.cloud.utils.db.TransactionContextBuilder.AroundAnyMethod(TransactionContextBuilder.java:43)
> 	at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
> 	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
> 	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message