Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6526311059 for ; Mon, 28 Jul 2014 22:05:24 +0000 (UTC) Received: (qmail 43644 invoked by uid 500); 28 Jul 2014 22:05:22 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 43603 invoked by uid 500); 28 Jul 2014 22:05:22 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 43592 invoked by uid 99); 28 Jul 2014 22:05:21 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 22:05:21 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Alena.Prokharchyk@citrix.com designates 66.165.176.89 as permitted sender) Received: from [66.165.176.89] (HELO SMTP.CITRIX.COM) (66.165.176.89) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 22:05:04 +0000 X-IronPort-AV: E=Sophos;i="5.01,751,1400025600"; d="scan'208";a="156547958" Received: from sjcpex01cl01.citrite.net ([10.216.14.143]) by FTLPIPO01.CITRIX.COM with ESMTP/TLS/AES128-SHA; 28 Jul 2014 22:04:38 +0000 Received: from SJCPEX01CL02.citrite.net ([169.254.2.203]) by SJCPEX01CL01.citrite.net ([10.216.14.143]) with mapi id 14.03.0181.006; Mon, 28 Jul 2014 15:04:37 -0700 From: Alena Prokharchyk To: "dev@cloudstack.apache.org" , "rohit.yadav@shapeblue.com" Subject: Re: [BUG] upgrade path to 4.4.1 Thread-Topic: [BUG] upgrade path to 4.4.1 Thread-Index: AQHPqpzzeEj1p9zy00mpKiiDFM3n6pu2a76AgAADjICAAA3sAP//jWOA Date: Mon, 28 Jul 2014 22:04:36 +0000 Message-ID: References: <53D6C6A6.3060503@shapeblue.com> In-Reply-To: <53D6C6A6.3060503@shapeblue.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.4.1.140326 x-originating-ip: [10.13.107.78] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org The upgrade path should also be merged to master branch. Where btw I already see an upgrade path from 4.4 to 4.5 implemented. Should we change it to 4.4.1->4.5? -Alena. On 7/28/14, 2:54 PM, "Rohit Yadav" wrote: >Hi, > >Adding upgrade paths is simple (you may add/update a wiki page on it): > >- You add a upgrade path class under com.cloud.upgrade.dao, something >like UpgradeVERAtoVERb, in our case Upgrade440to441 which should >implement the interface DbUpgrade. If there is some complex migration >you need to do in code put the sql and other statements in >performDataMigration method. >- Put upgrade path sql statements in db/schema-440to441.sql >- Put upgrade path cleanup statements in db/schema-440to441-cleanup.sql >- Finally add the version key and add/append the upgrade class in >DatabaseUpgradeChecker and all other keys where there is a previous >upgrade path. > >On 4.4 branch see the following commit for reference which fixes this: >9de4abeb49f74cd9a4418a97a4d25e5266c81f94 > >I hope the way upgrade stuff works and the boilerplate code we add >everytime should be fixed/refactored in future. > >On 4.4, I went ahead and fixed an apidoc build issue using master's: >https://git-wip-us.apache.org/repos/asf?p=3Dcloudstack.git;a=3Dblobdiff;f= =3Dtool >s/apidoc/gen_toc.py;h=3D1ad493d59ab6fb1fb52bbd07c17dc754bc128b0e;hp=3Dbcc8= 417c >3c5d3de2feb4129613038468c5ab9ac7;hb=3D628d8e6;hpb=3D0ac2eb4f671841b2525db8= 1094 >0d8502e6a3dcf4 > >Regards. > >Will Stevens wrote: >> If there is documentation for how to do this somewhere, I could >>implement >> an empty upgrade path. Do we know if there are database changes needed >>for >> the 4.4.1 upgrade from 4.4.0? How would that requirement be captured? >> >> Cheers, >> >> Will >> >> >> *Will STEVENS* >> Lead Developer >> >> *CloudOps* *| *Cloud Solutions Experts >> 420 rue Guy *|* Montreal *|* Quebec *|* H3J 1S6 >> w cloudops.com *|* tw @CloudOps_ >> >> >> On Mon, Jul 28, 2014 at 4:52 PM, Daan Hoogland >> wrote: >> >>> Will, >>> >>> this is a bug due to our upgrade scheme: we have not yet implemented >>> it so it is missing. We need to implement some (possibly empty) >>> upgrade path to make sure this will still work for 4.4.1. >>> >>> On Mon, Jul 28, 2014 at 9:46 PM, Will Stevens >>> wrote: >>>> I am guessing this is a bug, but I want to post it here before I >>>>create a >>>> ticket. I have pulled down the latest code from the 4.4 branch (which >>>> results in the 4.4.1 release). >>>> >>>> I am able to compile the code without any issues, but when I run the >>>> following command to deploy my DB it fails. >>>> >>>> $ mvn -P developer -pl developer,tools/devcloud -Ddeploydb >>>> >>>> The error is: >>>> [ERROR] Failed to execute goal >>>> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (create-schema) on >>>>project >>>> cloud-developer: An exception occured while executing the Java class. >>> null: >>>> InvocationTargetException: The end upgrade version is actually at >>>>4.4.0 >>> but >>>> our management server code version is at 4.4.1-SNAPSHOT -> [Help 1] >>>> >>>> It looks like there is no upgrade path from 4.4.0 to 4.4.1, but I am >>>>just >>>> taking that from the error. >>>> >>>> I checked the './setup/db/db' directory and there is no file for >>>> 'schema-440to441.sql'. Also, I looked in >>>> './engine/schema/src/com/cloud/upgrade/dao' and there is no >>>> 'Upgrade440to441.java' file. Since this file does not exist, it is >>>> obviously not included in the >>>> './engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java' >>>>file >>>> either (which is where the error originates from). >>>> >>>> I have included the entire output for completeness... >>>> >>>> Listening for transport dt_socket at address: 8787 >>>> [INFO] Scanning for projects... >>>> [INFO] >>>>=20 >>>>----------------------------------------------------------------------- >>>>- >>>> [INFO] Reactor Build Order: >>>> [INFO] >>>> [INFO] Apache CloudStack Developer Mode >>>> [INFO] Apache CloudStack DevCloud >>>> [INFO] >>>> >>>> [INFO] >>>>=20 >>>>----------------------------------------------------------------------- >>>>- >>>> [INFO] Building Apache CloudStack Developer Mode 4.4.1-SNAPSHOT >>>> [INFO] >>>>=20 >>>>----------------------------------------------------------------------- >>>>- >>>> [INFO] >>>> [INFO] --- maven-checkstyle-plugin:2.11:check (cloudstack-checkstyle) >>>>@ >>>> cloud-developer --- >>>> [INFO] Starting audit... >>>> Audit done. >>>> >>>> [INFO] >>>> [INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties >>>> (default) @ cloud-developer --- >>>> [WARNING] Ignoring missing properties file: >>>> /mnt/hgfs/cs/cloudstack/developer/../utils/conf/db.properties.override >>>> [INFO] >>>> [INFO] --- maven-remote-resources-plugin:1.3:process (default) @ >>>> cloud-developer --- >>>> [INFO] >>>> [INFO] --- maven-antrun-plugin:1.7:run (default) @ cloud-developer --- >>>> [INFO] Executing tasks >>>> >>>> main: >>>> [INFO] Executed tasks >>>> [INFO] >>>> [INFO]>>> exec-maven-plugin:1.2.1:java (create-schema) @ >>>>cloud-developer >>>> [INFO] >>>> [INFO] --- maven-checkstyle-plugin:2.11:check (cloudstack-checkstyle) >>>>@ >>>> cloud-developer --- >>>> [INFO] Starting audit... >>>> Audit done. >>>> >>>> [INFO] >>>> [INFO]<<< exec-maven-plugin:1.2.1:java (create-schema) @ >>>>cloud-developer >>>> <<< >>>> [INFO] >>>> [INFO] --- exec-maven-plugin:1.2.1:java (create-schema) @ >>>>cloud-developer >>>> --- >>>> log4j:WARN No appenders could be found for logger >>>> (org.springframework.core.env.StandardEnvironment). >>>> log4j:WARN Please initialize the log4j system properly. >>>> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig >>>>for >>>> more info. >>>> =3D=3D=3D=3D=3D=3D=3D=3D> WARNING: Provided file does not exist: >>>> /mnt/hgfs/cs/cloudstack/developer/../utils/conf/db.properties.override >>>> =3D=3D=3D=3D=3D=3D=3D=3D> WARNING: Provided file does not exist: >>>> /mnt/hgfs/cs/cloudstack/developer/developer-prefill.sql.override >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Initializing database=3Dcloud with host=3Dl= ocalhost port=3D3306 >>>> username=3Dcloud password=3Dcloud >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: drop database if= exists `cloud` >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: create database = `cloud` >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: GRANT ALL ON clo= ud.* to >>>>'cloud'@`localhost` >>>> identified by 'cloud' >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: GRANT ALL ON clo= ud.* to 'cloud'@`%` >>> identified >>>> by 'cloud' >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Initializing database=3Dcloud_usage with ho= st=3Dlocalhost >>>>port=3D3306 >>>> username=3Dcloud password=3Dcloud >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: drop database if= exists `cloud_usage` >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: create database = `cloud_usage` >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: GRANT ALL ON clo= ud_usage.* to 'cloud'@ >>> `localhost` >>>> identified by 'cloud' >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: GRANT ALL ON clo= ud_usage.* to >>>>'cloud'@`%` >>>> identified by 'cloud' >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Initializing database=3Dcloudbridge with ho= st=3Dlocalhost >>>>port=3D3306 >>>> username=3Dcloud password=3Dcloud >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: drop database if= exists `cloudbridge` >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: create database = `cloudbridge` >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: GRANT ALL ON clo= udbridge.* to 'cloud'@ >>> `localhost` >>>> identified by 'cloud' >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D> Running query: GRANT ALL ON clo= udbridge.* to >>>>'cloud'@`%` >>>> identified by 'cloud' >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/target/db/create-schema.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/target/db/create-schema-premium.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/target/db/templates.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_schema.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_multipart.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_index.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> >>>=20 >>>/mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_multipart_alter. >>>sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>>=20 >>>>/mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_bucketpolicy.sq >>>>l >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>>=20 >>>>/mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_policy_alter.sq >>>>l >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_offering.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> >>>=20 >>>/mnt/hgfs/cs/cloudstack/developer/target/db/cloudbridge_offering_alter.s >>>ql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing SQL file at >>>> /mnt/hgfs/cs/cloudstack/developer/developer-prefill.sql >>>> =3D=3D=3D=3D=3D=3D=3D=3D> Processing upgrade: >>>>com.cloud.upgrade.DatabaseUpgradeChecker >>>> [WARNING] >>>> java.lang.reflect.InvocationTargetException >>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> at >>>> >>>=20 >>>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav >>>a:57) >>>> at >>>> >>>=20 >>>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor >>>Impl.java:43) >>>> at java.lang.reflect.Method.invoke(Method.java:606) >>>> at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) >>>> at java.lang.Thread.run(Thread.java:744) >>>> Caused by: com.cloud.utils.exception.CloudRuntimeException: The end >>> upgrade >>>> version is actually at 4.4.0 but our management server code version >>>>is at >>>> 4.4.1-SNAPSHOT >>>> at >>>> >>>=20 >>>com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker. >>>java:272) >>>> at >>>> >>>=20 >>>com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.ja >>>va:432) >>>> at com.cloud.upgrade.DatabaseCreator.main(DatabaseCreator.java:217) >>>> ... 6 more >>>> [INFO] >>>>=20 >>>>----------------------------------------------------------------------- >>>>- >>>> [INFO] Reactor Summary: >>>> [INFO] >>>> [INFO] Apache CloudStack Developer Mode .................. FAILURE >>> [13.648s] >>>> [INFO] Apache CloudStack DevCloud ........................ SKIPPED >>>> [INFO] >>>>=20 >>>>----------------------------------------------------------------------- >>>>- >>>> [INFO] BUILD FAILURE >>>> [INFO] >>>>=20 >>>>----------------------------------------------------------------------- >>>>- >>>> [INFO] Total time: 16.677s >>>> [INFO] Finished at: Mon Jul 28 15:13:44 EDT 2014 >>>> [INFO] Final Memory: 38M/95M >>>> [INFO] >>>>=20 >>>>----------------------------------------------------------------------- >>>>- >>>> [ERROR] Failed to execute goal >>>> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (create-schema) on >>>>project >>>> cloud-developer: An exception occured while executing the Java class. >>> null: >>>> InvocationTargetException: The end upgrade version is actually at >>>>4.4.0 >>> but >>>> our management server code version is at 4.4.1-SNAPSHOT -> [Help 1] >>>> [ERROR] >>>> [ERROR] To see the full stack trace of the errors, re-run Maven with >>>>the >>> -e >>>> switch. >>>> [ERROR] Re-run Maven using the -X switch to enable full debug logging. >>>> [ERROR] >>>> [ERROR] For more information about the errors and possible solutions, >>>> please read the following articles: >>>> [ERROR] [Help 1] >>>>=20 >>>>http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException >>>> >>>> I currently have a dev environment available that I can revert to a >>>>clean >>>> install to test potential solutions if anyone has suggestions. >>>> >>>> Cheers, >>>> >>>> *Will STEVENS* >>>> Lead Developer >>>> >>>> *CloudOps* *| *Cloud Solutions Experts >>>> 420 rue Guy *|* Montreal *|* Quebec *|* H3J 1S6 >>>> w cloudops.com *|* tw @CloudOps_ >>> >>> >>> -- >>> Daan >>> >> > >-- >Rohit Yadav >Software Architect, ShapeBlue >M. +41 779015219 | rohit.yadav@shapeblue.com >Blog: bhaisaab.org | Twitter: @_bhaisaab > > >Find out more about ShapeBlue and our range of CloudStack related services > >IaaS Cloud Design & >Build >CSForge =AD rapid IaaS deployment framework >CloudStack Consulting >CloudStack Infrastructure >Support >CloudStack Bootcamp Training >Courses > >This email and any attachments to it may be confidential and are intended >solely for the use of the individual to whom it is addressed. Any views >or opinions expressed are solely those of the author and do not >necessarily represent those of Shape Blue Ltd or related companies. If >you are not the intended recipient of this email, you must neither take >any action based upon its contents, nor copy or show it to anyone. Please >contact the sender if you believe you have received this email in error. >Shape Blue Ltd is a company incorporated in England & Wales. ShapeBlue >Services India LLP is a company incorporated in India and is operated >under license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is >a company incorporated in Brasil and is operated under license from Shape >Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by The Republic of >South Africa and is traded under license from Shape Blue Ltd. ShapeBlue >is a registered trademark.