Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to fix a MySQL syntax error when deploying a working Play application to CloudBees?
    primarykey
    data
    text
    <p>I have very simple Play application that illustrates the use of MySQL (rather than the default H2) database available here:</p> <p><a href="https://github.com/ics-software-engineering/play-example-mysql" rel="nofollow noreferrer">https://github.com/ics-software-engineering/play-example-mysql</a></p> <p>The README file explains the steps required to run the application locally using a local installation of MySQL. <strong>It works fine locally.</strong></p> <p>I have been trying unsuccessfully to get this application to work on CloudBees. My basic strategy has been:</p> <ol> <li>Use the CloudBees Play 2 ClickStart to create a sample app, db, repo, and build system.</li> <li>Edit the build file to refer to my github repository.</li> <li>Rebuild and redeploy.</li> </ol> <p>More complete instructions on this strategy are available <a href="http://ics-software-engineering.github.io/play-example-continuous-integration/" rel="nofollow noreferrer">here</a>.</p> <p>When I go through this process, the system builds and deploys, but gets a MySQL syntax error in the application console when I attempt to retrieve the home page:</p> <pre><code>[ [37minfo [0m] play - database [default] connected at jdbc:mysql://ec2-23-21-211-172.compute-1.amazonaws.com:3306/play-example-mys [ [31merror [0m] 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 page_retrieval_seq' at line 1 [ERROR:1064, SQLSTATE:42000] Oops, cannot start the server. @6f3k8cj6c: Database 'default' is in inconsistent state! at play.api.db.evolutions.Evolutions$.checkEvolutionsState(Evolutions.scala:177) </code></pre> <p>This is a curious error because the syntax error "sequence page_retrieval_seq" is quite similar to one of the lines generated by Play in 1.sql when the database is the default (H2):</p> <pre><code>create sequence page_retrieval_seq </code></pre> <p>Unfortunately, this line is not actually in my 1.sql file, and I do not get this error when I run the system locally. I am running MySQL Ver 14.14 Distrib 5.6.12, for osx10.7 (x86_64).</p> <p>I recognize that for production use, it is not advisable to enable automatic evolutions, but that is not the problem I want to solve here. My goal is for the CloudBees application to provide a snapshot of the latest working version of the code, and for evolutions to work on CloudBees MySQL just like they work for my local MySQL installation.</p> <p>I have tried the steps outlined in <a href="https://stackoverflow.com/questions/15783586/connect-computer-database-jpa-play-2-1-sample-application-with-mysql">this answer</a> but it does not work on CloudBees, and anyway my current code already works correctly on a local installation of MySQL.</p> <p>Why does my simple Play application not deploy correctly on CloudBees, and how can I fix it? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload