# Build standalone failure

**URL:** <https://talk.openmrs.org/t/build-standalone-failure/30318>\
**Category:** Uncategorized\
**Created:** [September 23, 2020, 9:25pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318 "2020-09-23T21:25:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 23, 2020, 9:25pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/1 "2020-09-23T21:25:01Z")

</div>

Hello folks ;

I have been running a ci plan for platform 2.4.0 and the plan failed on the [build standalone stage](https://ci.openmrs.org/browse/OP-OPM8-23) 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

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [September 24, 2020, 9:14am UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/2 "2020-09-24T09:14:51Z")

</div>

I have just made a commit. Can you try again?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 24, 2020, 10:45am UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/3 "2020-09-24T10:45:56Z")

</div>

@dkayiwa i have tried again and got another failure from liquibase [https://ci.openmrs.org/browse/OP-OPM8-26/log](https://ci.openmrs.org/browse/OP-OPM8-26/log)

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [September 25, 2020, 2:33pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/4 "2020-09-25T14:33:12Z")

</div>

Hey there, I am happy to try a local build, where can I find the commands that are run in the build step pls?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 25, 2020, 2:37pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/5 "2020-09-25T14:37:52Z")

</div>

@wolf u can do the build set up on the [2.4.x plan via bamboo ci](https://ci.openmrs.org/chain/viewChainBranches.action?planKey=OP-OPM), hope you have bamboo credentials…

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [September 25, 2020, 3:00pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/6 "2020-09-25T15:00:16Z")

</div>

> > hope you have bamboo credentials…

Not yet, could you export the setup and share it with me pls?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [September 25, 2020, 3:09pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/7 "2020-09-25T15:09:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [September 25, 2020, 4:16pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/8 "2020-09-25T16:16:44Z")

</div>

Thanks Daniel, the repository is [https://github.com/openmrs/openmrs-distro-platform](https://github.com/openmrs/openmrs-distro-platform), is that right?

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [September 25, 2020, 5:34pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/9 "2020-09-25T17:34:12Z")

</div>

Hey there, here comes a summary of what I looked into and found.

- Cloned [https://github.com/openmrs/openmrs-distro-platform](https://github.com/openmrs/openmrs-distro-platform)
- git checkout 2.4.x
- mvn clean package
- docker-compose up

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](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](https://github.com/openmrs/openmrs-distro-referenceapplication/blob/master/package/src/main/resources/openmrs-distro.sql).

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?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 26, 2020, 5:22pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/10 "2020-09-26T17:22:08Z")

</div>

> [@wolf](#):
>
> 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](https://github.com/openmrs/openmrs-distro-referenceapplication/blob/master/package/src/main/resources/openmrs-distro.sql)?

cc @dkayiwa

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [September 26, 2020, 6:43pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/11 "2020-09-26T18:43:27Z")

</div>

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](https://github.com/openmrs/openmrs-standalone)

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 28, 2020, 6:32am UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/12 "2020-09-28T06:32:02Z")

</div>

hello @wolf

were you able to to run `mvn clean package -Dopenmrs.version=2.4.0-SNAPSHOT` on openmrs-standalone ?

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [September 28, 2020, 5:17pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/13 "2020-09-28T17:17:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 29, 2020, 11:13am UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/14 "2020-09-29T11:13:37Z")

</div>

hello @wolf sorry about the delayed response

i run the above command and got [https://pastebin.com/Mnhq0hPF](https://pastebin.com/Mnhq0hPF) , i run it again and got this result [https://pastebin.com/7sZbSFc7](https://pastebin.com/7sZbSFc7)

cc @dkayiwa

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [September 30, 2020, 8:35am UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/15 "2020-09-30T08:35:28Z")

</div>

Thanks for sharing the logs, @gcliff.

The first run fails because there is not enough memory:

```
[ERROR] Java heap space -> [Help 1]
[ERROR]
[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]
[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?

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 30, 2020, 12:57pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/16 "2020-09-30T12:57:16Z")

</div>

@wolf i have increased my maven JVM space as advised [here](https://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryError) but still getting the same response failure about java heap space

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [September 30, 2020, 4:35pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/17 "2020-09-30T16:35:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gcliff](https://talk.openmrs.org/user_avatar/talk.openmrs.org/gcliff/32/8783_2.png) [@gcliff](https://talk.openmrs.org/u/gcliff)\
**Post date:** [September 30, 2020, 6:43pm UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/18 "2020-09-30T18:43:21Z")

</div>

> [@wolf](#):
>
> Can you throw in more memory?

@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

> [@wolf](#):
>
> How much are you actually using?

the [build logs](https://pastebin.com/Qk9fWanV) dont show how mush memory you have used

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [October 1, 2020, 7:02am UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/19 "2020-10-01T07:02:23Z")

</div>

@dkayiwa could you please run a local build to see if you can reproduce the Liquibase error?

---

<div class="post-metadata">

**Author:** ![wolf](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wolf/32/4020_2.png) [@wolf](https://talk.openmrs.org/u/wolf)\
**Post date:** [October 1, 2020, 10:56am UTC](https://talk.openmrs.org/t/build-standalone-failure/30318/20 "2020-10-01T10:56:09Z")

</div>

@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

[Next page](https://talk.openmrs.org/t/build-standalone-failure/30318.md?page=2)
