Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug caused by db.ddl.create=true #27

Open
fh2002 opened this issue Mar 22, 2020 · 1 comment
Open

Bug caused by db.ddl.create=true #27

fh2002 opened this issue Mar 22, 2020 · 1 comment
Assignees
Labels

Comments

@fh2002
Copy link

fh2002 commented Mar 22, 2020

Error stack:

org.osgl.exception.ConfigurationException: Error init SQL db service
	at org.osgl.util.E.invalidConfiguration(E.java:328)
	at act.db.sql.SqlDbService.init(SqlDbService.java:149)
	at act.db.sql.SqlDbService$1.run(SqlDbService.java:76)
	at act.job.Job$4.apply(Job.java:455)
	at act.job.Job.doJob(Job.java:413)
	at act.job.Job.run(Job.java:337)
	at act.job.Job$LockableJobList$1.run(Job.java:109)
	at act.job.JobManager$ContextualJob$1.apply(JobManager.java:543)
	at act.job.Job.doJob(Job.java:413)
	at act.job.Job.run(Job.java:337)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: javax.persistence.PersistenceException: Failed to run script
	at io.ebeaninternal.dbmigration.DdlGenerator.runScript(DdlGenerator.java:174)
	at io.ebeaninternal.dbmigration.DdlGenerator.runCreateSql(DdlGenerator.java:200)
	at io.ebeaninternal.dbmigration.DdlGenerator.runDdlWith(DdlGenerator.java:131)
	at io.ebeaninternal.dbmigration.DdlGenerator.runDdl(DdlGenerator.java:116)
	at io.ebeaninternal.dbmigration.DdlGenerator.execute(DdlGenerator.java:92)
	at io.ebeaninternal.server.core.DefaultServer.executePlugins(DefaultServer.java:338)
	at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:131)
	at io.ebeaninternal.server.core.DefaultContainer.createServer(DefaultContainer.java:35)
	at io.ebean.EbeanServerFactory.createInternal(EbeanServerFactory.java:109)
	at io.ebean.EbeanServerFactory.create(EbeanServerFactory.java:70)
	at act.db.ebean.EbeanService.dataSourceProvided(EbeanService.java:118)
	at act.db.sql.SqlDbService.doInitDataSource(SqlDbService.java:275)
	at act.db.sql.SqlDbService.initDataSource(SqlDbService.java:257)
	at act.db.sql.SqlDbService.init(SqlDbService.java:118)
	... 16 common frames omitted
Caused by: java.sql.SQLException: Error executing stmt[create table user (
  id                            integer not null
)] error[[SQLITE_ERROR] SQL error or missing database (table user already exists)]
	at io.ebean.migration.ddl.DdlRunner.runStatement(DdlRunner.java:113)
	at io.ebean.migration.ddl.DdlRunner.runStatements(DdlRunner.java:70)
	at io.ebean.migration.ddl.DdlRunner.runAll(DdlRunner.java:49)
	at io.ebeaninternal.dbmigration.DdlGenerator.runScript(DdlGenerator.java:166)
	... 29 common frames omitted
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (table user already exists)
	at org.sqlite.core.DB.newSQLException(DB.java:941)
	at org.sqlite.core.DB.newSQLException(DB.java:953)
	at org.sqlite.core.DB.throwex(DB.java:918)
	at org.sqlite.core.NativeDB.prepare_utf8(Native Method)
	at org.sqlite.core.NativeDB.prepare(NativeDB.java:134)
	at org.sqlite.core.DB.prepare(DB.java:257)
	at org.sqlite.core.CorePreparedStatement.<init>(CorePreparedStatement.java:47)
	at org.sqlite.jdbc3.JDBC3PreparedStatement.<init>(JDBC3PreparedStatement.java:30)
	at org.sqlite.jdbc4.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:19)
	at org.sqlite.jdbc4.JDBC4Connection.prepareStatement(JDBC4Connection.java:35)
	at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:241)
	at org.sqlite.jdbc3.JDBC3Connection.prepareStatement(JDBC3Connection.java:205)
	at io.ebean.datasource.pool.PooledConnection.prepareStatement(PooledConnection.java:408)
	at io.ebean.datasource.pool.PooledConnection.prepareStatement(PooledConnection.java:382)
	at io.ebean.migration.ddl.DdlRunner.runStatement(DdlRunner.java:105)
	... 32 common frames omitted
@greenlaw110
Copy link
Contributor

@fh2002 please provide the following information:

  1. actframework version
  2. act-sql-common version
  3. did you hit this error when running app in dev mode or prod mode?

@greenlaw110 greenlaw110 self-assigned this Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants