Hi
Looks more to be a permission issue
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: ALTER
command denied to user 'cloud'@'localhost' for table 'account'

When running create-database script I get this warning.

sql> GRANT ALL ON cloud.* to cloud@`%` identified by 'cloud'
[2017-07-07 09:47:56] [HY000][1287] Using GRANT statement to modify
existing user's properties other than privileges is deprecated and will be
removed in future release. Use ALTER USER statement for this operation.

Anyway I changed to MariaBD and made some progress :-)  but still an error.

My steps:

* running the following scripts to create databases: create-database.sql,
create-database-premium.sql, create-database-simulator.sql.

* running the following scripts to create base schemas: create-schema.sql,
create-schema-premium.sql, create-schema-simulator.sql

* start the ui with mvn -pl :cloud-client-ui jetty:run

But now it fail with (stack trace truncated but full available here:
https://gist.github.com/olamy/b13e5f831b933829dd2ced7ddb5dc59b

INFO  [c.c.u.DatabaseUpgradeChecker] (main:null) (logid:) Cleanup upgrade
Upgrade441to442 to upgrade from 4.4.1-4.4.2 to 4.4.2

ERROR [c.c.u.d.ScriptRunner] (main:null) (logid:) Error executing: ALTER
TABLE `cloud`.`guest_os_hypervisor` ADD FOREIGN KEY (`guest_os_id`)
REFERENCES `cloud`.`guest_os`(`id`)

ERROR [c.c.u.d.ScriptRunner] (main:null) (logid:)
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot add or update a child row: a foreign key constraint fails
(`cloud`.`#sql-882f_27`, CONSTRAINT `#sql-882f_27_ibfk_1` FOREIGN KEY
(`guest_os_id`) REFERENCES `guest_os` (`id`))

ERROR [c.c.u.DatabaseUpgradeChecker] (main:null) (logid:) Unable to execute
upgrade script:
/Users/olamy/dev/sources/open-sources/cloudstack/cloudstack/client/target/utilities/scripts/db/db/schema-442to450.sql

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot add or update a child row: a foreign key constraint fails
(`cloud`.`#sql-882f_27`, CONSTRAINT `#sql-882f_27_ibfk_1` FOREIGN KEY
(`guest_os_id`) REFERENCES `guest_os` (`id`))

ERROR [c.c.u.DatabaseUpgradeChecker] (main:null) (logid:) Unable to upgrade
the database

com.cloud.utils.exception.CloudRuntimeException: Unable to execute upgrade
script:
/Users/olamy/dev/sources/open-sources/cloudstack/cloudstack/client/target/utilities/scripts/db/db/schema-442to450.sql

Not sure what to do here :-(

On 6 July 2017 at 19:22, Wido den Hollander <w...@widodh.nl> wrote:

>
> > Op 6 juli 2017 om 9:02 schreef Olivier Lamy <ol...@apache.org>:
> >
> >
> > Hi,
> > Long time I didn't participate here.
> > I'd like to do some hacking.
> > I'm not clear on the process for noob :-)
> > I ran sql scripts:
> > * create-database.sql
> > * create-schema.sql
> >
> > Then I start with mvn -pl :cloud-client-ui jetty:run
> > But I got the this error (see stacktrace below)
> > I use osx, mysql 5.7.18_1 installed with brew
> >
> > Thanks a lot for your help
> >
> > Caused by: com.cloud.utils.exception.CloudRuntimeException: Unable to
> > upgrade the database
> >
> > at
> > com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpg
> radeChecker.java:438)
> >
> > at
> > com.cloud.upgrade.DatabaseUpgradeChecker.check(DatabaseUpgra
> deChecker.java:509)
> >
> > at
> > org.apache.cloudstack.spring.lifecycle.CloudStackExtendedLif
> eCycle.checkIntegrity(CloudStackExtendedLifeCycle.java:65)
> >
> > at
> > org.apache.cloudstack.spring.lifecycle.CloudStackExtendedLif
> eCycle.start(CloudStackExtendedLifeCycle.java:55)
> >
> > at
> > org.springframework.context.support.DefaultLifecycleProcesso
> r.doStart(DefaultLifecycleProcessor.java:173)
> >
> > ... 70 more
> >
> > Caused by: com.cloud.utils.exception.CloudRuntimeException: Unable to
> > execute upgrade script:
> > /Users/olamy/dev/sources/open-sources/cloudstack/cloudstack/
> client/target/utilities/scripts/db/db/schema-410to420.sql
> >
> > at
> > com.cloud.upgrade.DatabaseUpgradeChecker.runScript(DatabaseU
> pgradeChecker.java:331)
> >
> > at
> > com.cloud.upgrade.DatabaseUpgradeChecker.upgrade(DatabaseUpg
> radeChecker.java:425)
> >
> > ... 74 more
> >
> > Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
> ALTER
> > command denied to user 'cloud'@'localhost' for table 'account'
> >
>
> I see a access denied. Could you check the access credentials of the user
> in MySQL?
>
> Wido
>
> > at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:185)
> >
> > at com.cloud.utils.db.ScriptRunner.runScript(ScriptRunner.java:87)
> >
> > at
> > com.cloud.upgrade.DatabaseUpgradeChecker.runScript(DatabaseU
> pgradeChecker.java:322)
> > Cheers
> > --
> > Olivier Lamy
> > http://twitter.com/olamy | http://linkedin.com/in/olamy
>



-- 
Olivier Lamy
http://twitter.com/olamy | http://linkedin.com/in/olamy

Reply via email to