myborobudur
myborobudur

Reputation: 4435

"Database 'default' is in inconsistent state!" comes and goes

I have the problem that the play database evolution on the deployed server is in inconsistent state again and again. I don't understand what's the problem.

I to often get this error:

[error] play - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sequence life_cycle_event_seq' at line 1 [ERROR:1064, SQLSTATE:42000]
Oops, cannot start the server.
@6epm5i5m6: Database 'default' is in inconsistent state!
    at play.api.db.evolutions.Evolutions$.checkEvolutionsState(Evolutions.scala:177)
    at play.api.db.evolutions.Evolutions$.applyScript(Evolutions.scala:275)
    at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1$$anonfun$apply$1.apply$mcV$sp(Evolutions.scala:446)
    at play.api.db.evolutions.EvolutionsPlugin.withLock(Evolutions.scala:483)
    at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:439)
    at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.scala:437)
    at scala.collection.immutable.List.foreach(List.scala:309)
    at play.api.db.evolutions.EvolutionsPlugin.onStart(Evolutions.scala:437)
    at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
    at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:63)
    at scala.collection.immutable.List.foreach(List.scala:309)
    at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:63)
    at play.api.Play$$anonfun$start$1.apply(Play.scala:63)
    at play.api.Play$$anonfun$start$1.apply(Play.scala:63)
    at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
    at play.api.Play$.start(Play.scala:62)
    at play.core.StaticApplication.<init>(ApplicationProvider.scala:54)
    at play.core.server.NettyServer$.createServer(NettyServer.scala:228)
    at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:259)
    at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:258)
    at scala.Option.map(Option.scala:145)
    at play.core.server.NettyServer$.main(NettyServer.scala:258)
    at play.core.server.NettyServer.main(NettyServer.scala)

It works suddenly after playing around with the whole process.

Upvotes: 6

Views: 7941

Answers (1)

mguillermin
mguillermin

Reputation: 4181

You should generate your evolution script after you switched your configuration to mysql.

The generated script is RDBMS-dependent. It needs to be created with the correct database engine before you launch play clean compile stage

Upvotes: 1

Related Questions