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

Migration changelog-2021-01-26-1100-migrate-price-into-product-price.xml fails #2256

Closed
m-idler opened this issue Mar 8, 2021 · 7 comments
Closed
Assignees
Milestone

Comments

@m-idler
Copy link

m-idler commented Mar 8, 2021

I tried to do a clean setup based on the develop branch via docker-compose setup, unfortunately the migration script changelog-2021-01-26-1100-migrate-price-into-product-price.xml fails, seemingly because of this commit:
1f6795a

grails_1  | 2021-03-08 10:19:43,492 [main] ERROR context.GrailsContextLoader  - Error executing bootstraps: liquibase.exception.MigrationFailedException: Migration failed for change set 0.8.x/changelog-2021-01-26-1100-migrate-price-into-product-price.xml::2601202111001-1::awalkowiak:
grails_1  |      Reason: liquibase.exception.JDBCException: Error executing SQL INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
grails_1  |         SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0:
grails_1  |           Caused By: Error executing SQL INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
grails_1  |         SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0:
grails_1  |           Caused By: 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 'now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0' at line 2
grails_1  | org.codehaus.groovy.runtime.InvokerInvocationException: liquibase.exception.MigrationFailedException: Migration failed for change set 0.8.x/changelog-2021-01-26-1100-migrate-price-into-product-price.xml::2601202111001-1::awalkowiak:
grails_1  |      Reason: liquibase.exception.JDBCException: Error executing SQL INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
grails_1  |         SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0:
grails_1  |           Caused By: Error executing SQL INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
grails_1  |         SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0:
grails_1  |           Caused By: 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 'now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0' at line 2
grails_1  | 	at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:251)
grails_1  | 	at grails.util.Environment.executeForEnvironment(Environment.java:244)
grails_1  | 	at grails.util.Environment.executeForCurrentEnvironment(Environment.java:220)
grails_1  | 	at org.grails.tomcat.InlineExplodedTomcatServer.doStart(InlineExplodedTomcatServer.groovy:112)
grails_1  | 	at org.grails.tomcat.InlineExplodedTomcatServer$doStart.callCurrent(Unknown Source)
grails_1  | 	at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:97)
grails_1  | 	at grails.web.container.EmbeddableServer$start.call(Unknown Source)
grails_1  | 	at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:158)
grails_1  | 	at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy)
grails_1  | 	at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
grails_1  | 	at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
grails_1  | 	at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:149)
grails_1  | 	at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy)
grails_1  | 	at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116)
grails_1  | 	at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
grails_1  | 	at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
grails_1  | 	at RunApp$_run_closure1.doCall(RunApp.groovy:33)
grails_1  | 	at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
grails_1  | 	at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
grails_1  | 	at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
grails_1  | 	at gant.Gant.withBuildListeners(Gant.groovy:427)
grails_1  | 	at gant.Gant.this$2$withBuildListeners(Gant.groovy)
grails_1  | 	at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
grails_1  | 	at gant.Gant.dispatch(Gant.groovy:415)
grails_1  | 	at gant.Gant.this$2$dispatch(Gant.groovy)
grails_1  | 	at gant.Gant.invokeMethod(Gant.groovy)
grails_1  | 	at gant.Gant.executeTargets(Gant.groovy:590)
grails_1  | 	at gant.Gant.executeTargets(Gant.groovy:589)
grails_1  | Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set 0.8.x/changelog-2021-01-26-1100-migrate-price-into-product-price.xml::2601202111001-1::awalkowiak:
grails_1  |      Reason: liquibase.exception.JDBCException: Error executing SQL INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
grails_1  |         SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0:
grails_1  |           Caused By: Error executing SQL INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
grails_1  |         SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0:
grails_1  |           Caused By: 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 'now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0' at line 2
grails_1  | 	at liquibase.ChangeSet.execute(ChangeSet.java:238)
grails_1  | 	at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:26)
grails_1  | 	at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41)
grails_1  | 	at liquibase.Liquibase.update(Liquibase.java:112)
grails_1  | 	at liquibase.Liquibase$update.call(Unknown Source)
grails_1  | 	at BootStrap$_closure1.doCall(BootStrap.groovy:447)
grails_1  | 	... 28 more
grails_1  | Caused by: liquibase.exception.JDBCException: Error executing SQL INSERT INTO product_price (id, version, type, price, product_package_id, date_created, last_updated)
grails_1  |         SELECT uuid(), 0, 'DEFAULT_PRICE', price, id FROM product_package, now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0
grails_1  | 	at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55)
grails_1  | 	at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86)
grails_1  | 	at liquibase.change.AbstractChange.execute(AbstractChange.java:247)
grails_1  | 	at liquibase.change.AbstractChange.executeStatements(AbstractChange.java:93)
grails_1  | 	at liquibase.ChangeSet.execute(ChangeSet.java:214)
grails_1  | 	... 33 more
grails_1  | Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'now(), now()
grails_1  |         WHERE price IS NOT NULL AND price > 0' at line 2
grails_1  | 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
grails_1  | 	at com.mysql.jdbc.Util.getInstance(Util.java:408)
grails_1  | 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
grails_1  | 	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
grails_1  | 	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
grails_1  | 	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
grails_1  | 	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
grails_1  | 	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2491)
grails_1  | 	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2449)
grails_1  | 	at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
grails_1  | 	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:745)
grails_1  | 	at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)
grails_1  | 	at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78)
grails_1  | 	at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48)
grails_1  | 	... 37 more
grails_1  | Application context shutting down...
grails_1  | 2021-03-08 10:19:43,509 [Thread-20] INFO  support.DefaultLifecycleProcessor  - Stopping beans in phase 2147483647
grails_1  | 2021-03-08 10:19:43,517 [Thread-20] INFO  core.QuartzScheduler  - Scheduler DefaultPluginScheduler_$_NON_CLUSTERED paused.
grails_1  | 2021-03-08 10:19:43,564 [Thread-20] INFO  core.QuartzScheduler  - Scheduler DefaultPluginScheduler_$_NON_CLUSTERED shutting down.
grails_1  | 2021-03-08 10:19:43,564 [Thread-20] INFO  core.QuartzScheduler  - Scheduler DefaultPluginScheduler_$_NON_CLUSTERED paused.
grails_1  | 2021-03-08 10:19:43,565 [Thread-20] INFO  core.QuartzScheduler  - Scheduler DefaultPluginScheduler_$_NON_CLUSTERED shutdown complete.
grails_1  | 2021-03-08 10:19:44,612 [Thread-20] INFO  ehcache.EhCacheManagerFactoryBean  - Shutting down EHCache CacheManager
grails_1  | 2021-03-08 10:19:44,640 [Thread-20] INFO  impl.SessionFactoryImpl  - closing
grails_1  | 2021-03-08 10:19:44,642 [Thread-20] INFO  util.NamingHelper  - JNDI InitialContext properties:{}
grails_1  | Application context shutdown.
openboxes-docker_grails_1 exited with code 1
@jmiranda
Copy link
Member

jmiranda commented Mar 8, 2021

@m-idler Thank you!! We fixed this in our latest release branch. We usually don't merge release back down to develop until we're done with the release branch. But since this is a breaking issue, I'll cherry pick the commit now.

@jmiranda jmiranda self-assigned this Mar 8, 2021
@jmiranda jmiranda added this to the 0.8.15 milestone Mar 8, 2021
@jmiranda
Copy link
Member

jmiranda commented Mar 8, 2021

Need to cherry-pick 2f1119f from release/0.8.15 into develop.

@jmiranda
Copy link
Member

jmiranda commented Mar 8, 2021

@m-idler Pushed the commit. Can you see if that fixes it for you?

@m-idler
Copy link
Author

m-idler commented Mar 8, 2021

@jmiranda yes, that seems to have solved the issue (unfortunately it takes ages till all the migrations are run within the docker setup)

@jmiranda
Copy link
Member

jmiranda commented Mar 8, 2021

@m-idler It takes ages for it to run on a regular set up too. Apologies for that.

Sometimes that can be improved by increasing the memory allocation before getting started, but we have years of migrations that need to be executed.

Hopefully, it'll be faster once we release 0.9.0 as we've finally reset the changelog.

@jmiranda
Copy link
Member

jmiranda commented Mar 8, 2021

@m-idler We just found another bug that'll probably trip you up. We refactored the Edit Product page last week and I introduced a bug when creating a new product. Should be fixed tonight, so I'll merge that into develop as well.

@jmiranda
Copy link
Member

jmiranda commented Mar 9, 2021

Fixed 52a9f23

@jmiranda jmiranda closed this as completed Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants