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 D44FC10DA3 for ; Fri, 14 Jun 2013 06:37:35 +0000 (UTC) Received: (qmail 20034 invoked by uid 500); 14 Jun 2013 06:37:33 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 20007 invoked by uid 500); 14 Jun 2013 06:37:32 -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 19999 invoked by uid 99); 14 Jun 2013 06:37:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jun 2013 06:37:30 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of seizadi@infoblox.com designates 205.234.19.214 as permitted sender) Received: from [205.234.19.214] (HELO mx2.infoblox.com) (205.234.19.214) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jun 2013 06:37:24 +0000 X-ASG-Debug-ID: 1371191820-0640d74cc14e7610001-AbHazq Received: from x2008hub1.infoblox.com (x2008hub1.infoblox.com [205.234.19.248]) by mx2.infoblox.com with ESMTP id ApIpCBtY1Ik9CJbe for ; Thu, 13 Jun 2013 23:37:00 -0700 (PDT) X-Barracuda-Envelope-From: seizadi@infoblox.com X-Barracuda-Apparent-Source-IP: 205.234.19.248 Received: from X2008MB1.infoblox.com ([fe80::cc0b:9da5:6863:8541]) by x2008hub1.infoblox.com ([fe80::a3:8989:52dd:1d09%10]) with mapi id 14.02.0298.004; Thu, 13 Jun 2013 23:37:00 -0700 From: Soheil Eizadi To: "dev@cloudstack.apache.org" Subject: Master Branch problem cannot login Thread-Topic: Master Branch problem cannot login X-ASG-Orig-Subj: Master Branch problem cannot login Thread-Index: AQHOaMmDVIkg5VxWGUqHiiIXNGEXSA== Date: Fri, 14 Jun 2013 06:36:59 +0000 Message-ID: <6717EC2E5A665A40A5AF626D7D4FA906C17EC9@x2008mb1.infoblox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [76.21.3.40] Content-Type: multipart/alternative; boundary="_000_6717EC2E5A665A40A5AF626D7D4FA906C17EC9x2008mb1infobloxc_" MIME-Version: 1.0 X-Barracuda-Connect: x2008hub1.infoblox.com[205.234.19.248] X-Barracuda-Start-Time: 1371191820 X-Barracuda-URL: http://205.234.19.214:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at infoblox.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.133860 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Checked: Checked by ClamAV on apache.org --_000_6717EC2E5A665A40A5AF626D7D4FA906C17EC9x2008mb1infobloxc_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I synced today, initialized the database and built image and found that I c= ould not login to the CS UI. Not sure exactly what is going on but looks li= ke the default field for Account Table was not created, when I tried to man= ually create it I got an error. The problem corrected itself when I ran the= deployDB mvn build a second time after I had created the field manually. I= can now log into the CS UI, but I thought I would document it here. -Soheil Below is more detail log. Administrators-MacBook-Pro-7:cloudstack seizadi$ git branch * infoblox master Administrators-MacBook-Pro-7:cloudstack seizadi$ git merge master Already up-to-date. >From AccountVO.java: @Entity @Table(name=3D"account") public class AccountVO implements Account { @Id @GeneratedValue(strategy=3DGenerationType.IDENTITY) @Column(name=3D"id") private long id; ..... @Column(name =3D "default") boolean isDefault; >From create-schema.sql I don't see any field default defined: CREATE TABLE `cloud`.`account` ( `id` bigint unsigned NOT NULL auto_increment, `account_name` varchar(100) COMMENT 'an account name set by the creator o= f the account, defaults to username for single accounts', `uuid` varchar(40), `type` int(1) unsigned NOT NULL, `domain_id` bigint unsigned, `state` varchar(10) NOT NULL default 'enabled', `removed` datetime COMMENT 'date removed', `cleanup_needed` tinyint(1) NOT NULL default '0', `network_domain` varchar(255), `default_zone_id` bigint unsigned, PRIMARY KEY (`id`), INDEX i_account__removed(`removed`), CONSTRAINT `fk_account__default_zone_id` FOREIGN KEY `fk_account__default= _zone_id`(`default_zone_id`) REFERENCES `data_center`(`id`) ON DELETE CASCA= DE, INDEX `i_account__cleanup_needed`(`cleanup_needed`), INDEX `i_account__account_name__domain_id__removed`(`account_name`, `doma= in_id`, `removed`), CONSTRAINT `fk_account__domain_id` FOREIGN KEY(`domain_id`) REFERENCES `d= omain` (`id`), INDEX `i_account__domain_id`(`domain_id`), CONSTRAINT `uc_account__uuid` UNIQUE (`uuid`) ) ENGINE=3DInnoDB DEFAULT CHARSET=3Dutf8; mysql> select * from account; +----+--------------+--------------------------------------+------+--------= ---+---------+---------+----------------+----------------+-----------------= + | id | account_name | uuid | type | domain_= id | state | removed | cleanup_needed | network_domain | default_zone_id = | +----+--------------+--------------------------------------+------+--------= ---+---------+---------+----------------+----------------+-----------------= + | 1 | system | 401c6676-d1f2-11e2-a780-ee6f6199dc83 | 1 | = 1 | enabled | NULL | 0 | NULL | NULL = | | 2 | admin | 401c74fe-d1f2-11e2-a780-ee6f6199dc83 | 1 | = 1 | enabled | NULL | 0 | NULL | NULL = | +----+--------------+--------------------------------------+------+--------= ---+---------+---------+----------------+----------------+-----------------= + 2 rows in set (0.00 sec) ---- ERROR [cloud.api.ApiServlet] (2071009240@qtp-761108485-3:) unknown exceptio= n writing api response com.cloud.utils.exception.CloudRuntimeException: DB Exception on: com.mysql= .jdbc.PreparedStatement@52c0152d: SELECT account.id, account.account_name, = account.type, account.domain_id, account.state, account.removed, account.cl= eanup_needed, account.network_domain, account.uuid, account.default_zone_id= , account.default FROM account WHERE account.id =3D 2 at com.cloud.utils.db.GenericDaoBase.findById(GenericDaoBase.java:979) at com.cloud.utils.component.ComponentInstantiationPostProcessor$Intercepto= rDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) at com.cloud.utils.db.GenericDaoBase.findByIdIncludingRemoved(GenericDaoBas= e.java:939) at com.cloud.utils.component.ComponentInstantiationPostProcessor$Intercepto= rDispatcher.intercept(ComponentInstantiationPostProcessor.java:125) at com.cloud.user.AccountManagerImpl.getAccount(AccountManagerImpl.java:163= 2) at com.cloud.api.ApiServer.loginUser(ApiServer.java:808) at com.cloud.api.ApiServlet.processRequest(ApiServlet.java:210) at com.cloud.api.ApiServlet.doPost(ApiServlet.java:71) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2= 16) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler= Collection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav= a:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.j= ava:945) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:= 410) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java= :582) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unkno= wn column 'account.default' in 'field list' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA= ccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons= tructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:= 2155) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:231= 8) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(Delegat= ingPreparedStatement.java:96) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(Delegat= ingPreparedStatement.java:96) at com.cloud.utils.db.GenericDaoBase.findById(GenericDaoBase.java:976) ... 34 more If I create it manually: diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index c88132d..e49782d 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -1326,6 +1326,7 @@ CREATE TABLE `cloud`.`account` ( `cleanup_needed` tinyint(1) NOT NULL default '0', `network_domain` varchar(255), `default_zone_id` bigint unsigned, + `default` tinyint NOT NULL default '0', PRIMARY KEY (`id`), INDEX i_account__removed(`removed`), CONSTRAINT `fk_account__default_zone_id` FOREIGN KEY `fk_account__defaul= t_zone_id`(`default_zone_id`) REFERENCES `data_center`(`id` I get following error: =3D=3D=3D=3D=3D=3D=3D=3D> Processing upgrade: com.cloud.upgrade.DatabaseUpg= radeChecker [WARNING] java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) at java.lang.Thread.run(Thread.java:680) Caused by: com.cloud.utils.exception.CloudRuntimeException: Unable to upgra= de the database at com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.= java:266) at com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgradeChecker.ja= va:364) at com.cloud.upgrade.DatabaseCreator.main(DatabaseCreator.java:216) ... 6 more Caused by: com.cloud.utils.exception.CloudRuntimeException: Unable to execu= te upgrade script: /Users/seizadi/cloudstack/infoblox_branch/cloudstack/dev= eloper/target/db/db/schema-410to420.sql at com.cloud.upgrade.DatabaseUpgradeChecker.runScript(DatabaseUpgradeChecke= r.java:183) at com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpgradeChecker.= java:235) ... 8 more Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Dupli= cate column name 'default' 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(DatabaseUpgradeChecke= r.java:174) ... 9 more After removing the change to create-schema.sql now I have the default colum= n in my database, initialized to true/1 and I can login to UI. mysql> select * from account; +----+--------------+--------------------------------------+------+--------= ---+---------+---------+----------------+----------------+-----------------= +---------+ | id | account_name | uuid | type | domain_= id | state | removed | cleanup_needed | network_domain | default_zone_id = | default | +----+--------------+--------------------------------------+------+--------= ---+---------+---------+----------------+----------------+-----------------= +---------+ | 1 | system | 22ff801c-d4ba-11e2-bb4d-a088cb607e58 | 1 | = 1 | enabled | NULL | 0 | NULL | NULL = | 1 | | 2 | admin | 22ff8b34-d4ba-11e2-bb4d-a088cb607e58 | 1 | = 1 | enabled | NULL | 0 | NULL | NULL = | 1 | +----+--------------+--------------------------------------+------+--------= ---+---------+---------+----------------+----------------+-----------------= +---------+ 2 rows in set (0.00 sec) --_000_6717EC2E5A665A40A5AF626D7D4FA906C17EC9x2008mb1infobloxc_--