Hello folks ;
I have been running a ci plan for platform 2.4.0 and the plan failed on the build standalone stage which according to the logs is due to a liquibase migration of a change set complaining that the number of columns does match in the destination table
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.10.2:update (empty-db-add-ciel-data) on project standalone:
23-Sep-2020 20:50:35 [ERROR] Error setting up or running Liquibase:
23-Sep-2020 20:50:35 [ERROR] Migration failed for change set /home/bamboo-agent/bamboo-agent/xml-data/build-dir/OP-OPM8-BS/standalone/target/liquibase/liquibase-ciel-data.xml::20120315-1000::standalone:
23-Sep-2020 20:50:35 [ERROR] Reason: liquibase.exception.DatabaseException: Column count doesn't match value count at row 1 [Failed SQL: (1136) insert into liquibasechangelog values('200905150821', 'bwolfe',
23-Sep-2020 20:50:35 [ERROR] 'liquibase-update-to-latest.xml', '2012-03-15 11:00:00', 10242,
23-Sep-2020 20:50:35 [ERROR] 'EXECUTED', '3:c0b7abc7eb00f243325b4a3fb2afc614', 'Custom SQL',
23-Sep-2020 20:50:35 [ERROR] 'Deleting duplicate concept word keys', NULL, '2.0.1')]
23-Sep-2020 20:50:35 [ERROR] -> [Help 1]
Requesting for your thoughts on this
cc @ibacher @wolf @dkayiwa @mozzy
I have just made a commit. Can you try again?
@dkayiwa i have tried again and got another failure from liquibase https://ci.openmrs.org/browse/OP-OPM8-26/log
Hey there, I am happy to try a local build, where can I find the commands that are run in the build step pls?
@wolf u can do the build set up on the 2.4.x plan via bamboo ci, hope you have bamboo credentials…
hope you have bamboo credentials…
Not yet, could you export the setup and share it with me pls?
This is the command that he is running:
mvn clean package -Dopenmrs.version=2.4.0-SNAPSHOT
It spawns a couple of MySQL instances which it may not stop on failing. So to run it again, you would need to first kill them, in order to avoid the connection password errors.
Hey there, here comes a summary of what I looked into and found.
The docker-compose log contains a liquibase error:
web_1 | INFO - ChangeLogDetective.getInitialLiquibaseSnapshotVersion(93) |2020-09-25T17:11:20,618| file 'org/openmrs/liquibase/snapshots/schema-only/liquibase-schema-only-1.9.x.xml' contains 2 un-run change sets
web_1 | INFO - ChangeLogDetective.logUnRunChangeSetDetails(202) |2020-09-25T17:11:20,619| file 'org/openmrs/liquibase/snapshots/schema-only/liquibase-schema-only-1.9.x.xml' contains un-run change set with id '20120529-2230' by author 'mvorobey'
web_1 | INFO - ChangeLogDetective.logUnRunChangeSetDetails(202) |2020-09-25T17:11:20,619| file 'org/openmrs/liquibase/snapshots/schema-only/liquibase-schema-only-1.9.x.xml' contains un-run change set with id '20120529-2231' by author 'mvorobey'
web_1 | WARN - InitializationFilter$InitializationCompletion$1.run(1724) |2020-09-25T17:11:20,703| Error while trying to update to the latest database version
web_1 | java.lang.IllegalStateException: identifying the snapshot version that had been used to initialize the OpenMRS database failed as no candidate change set resulted in zero un-run changes
web_1 | at org.openmrs.liquibase.ChangeLogDetective.getInitialLiquibaseSnapshotVersion(ChangeLogDetective.java:116) ~[openmrs-api-2.4.0-SNAPSHOT.jar:?]
web_1 | at org.openmrs.web.filter.initialization.InitializationFilter$InitializationCompletion$1.run(InitializationFilter.java:1703) [openmrs-web-2.4.0-SNAPSHOT.jar:?]
web_1 | at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
which is actually something that I fixed in https://github.com/openmrs/openmrs-distro-referenceapplication in May 2020. The database dump contained in that repository was incomplete and I added two change sets.
The respective commit is available here.
It looks like the same fix needs to be applied to the source of
openmrs-distro-platform/target/distro/dbdump/dump.sql. Where does that file come from pls?
@wolf this file is not in the openmrs platform-distro, am not seeing it there, may be i need to introduce it . Will this suffice given the a PR with the commit?
He gets the problem while trying to run the command
mvn clean package -Dopenmrs.version=2.4.0-SNAPSHOT on the master branch of this repository: https://github.com/openmrs/openmrs-standalone
were you able to to run
mvn clean package -Dopenmrs.version=2.4.0-SNAPSHOT on openmrs-standalone ?
Unfortunately not, but for a different reason. My machine cannot run the MySQL executable that comes with OpenMRS standalone:
[MysqldResource] launching mysqld (driver_launched_mysqld_1)
Exception in thread "driver_launched_mysqld_1" com.mysql.management.util.WrappedException: java.io.IOException: Cannot run program "/Users/wolf/Projects/OpenMRS/code10/openmrs-standalone/target/emptydatabase/bin/mysqld": error=86, Bad CPU type in executable
Could you please provide me with the full log of running
mvn clean package -Dopenmrs.version=2.4.0-SNAPSHOT command on your side?
hello @wolf sorry about the delayed response
i run the above command and got https://pastebin.com/Mnhq0hPF , i run it again and got this result https://pastebin.com/7sZbSFc7
Thanks for sharing the logs, @gcliff.
The first run fails because there is not enough memory:
[ERROR] Java heap space -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryError
The second run then fails as the mysql folder cannot be deleted, probably because mysql is still running as the first run did not finish orderly:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project standalone: Failed to clean project: Failed to delete C:\Users\Cliff\Desktop\project\openmrs-standalone\target\emptydatabase\data\mysql -> [Help 1]
These errors are not related to processing Liquibase change logs as such, could you please re-run with more memory available to mvn?
@wolf i have increased my maven JVM space as advised here but still getting the same response failure about java heap space
Can you throw in more memory? How much are you actually using?
We need to be able to reproduce the Liquibase error you saw the other day.
@wolf yes i have been throwing in more memory and for each adjustment i make the build time ranges between 40-60 mins after much hanging, thats why its taking alot of time to figure out the right memory
the build logs dont show how mush memory you have used
@dkayiwa could you please run a local build to see if you can reproduce the Liquibase error?
@gcliff when running
mvn clean package -Dopenmrs.version=2.4.0-SNAPSHOT -X -DXmx=1024M
-X results in a more detailed log
- and you can double check the memory available to mvn by searching for
-DXmx=1024M in the log output