openmrs common-lab-module Show "Error while trying to start module Unable to update data model using liquibase.xml. Module: Common Lab Test"

I cloned the module from here https://github.com/seekme94/openmrs-module-commonlabtest/tree/beta the module build successfully with mvn clean install command.

The module development is in two branches so I switch to local branch name(beta) and build the module again and upload it to reference application.The module is not starting and show this error “Error while trying to start module Unable to update data model using liquibase.xml. Module: Common Lab Test“ The complete error log https://pastebin.com/jM5c3PtK

The required version for this module was platform 2.1.2 so run that as well,but I’m getting the same error.

Please note on master branch it does not show any error.It’s uploaded successfully,but most updated code is in beta branch which is required so I need to build module from that branch.

@owais.hussain @tahira @dkayiwa @shujaat @ahmed14 your help will be highly appreciated. Thanks

@naveed1228 , first you should drop all the tables of commonlabmodule from the database. you can get the table which has name by “commonlab_” . Then you should also all the entries of commonlab in liquliquibasechangelog table .

Now your issue wil be resolved. This is because OpenMRS mantains the database change by liquibase and liquibase saves entries in liquibase table. So if you switch branches , there are some database changes different then in other branch that’s why you are encountering this issue . Hope this resolves the issues.

I try your approach several time but the error is keep coming.Just a brief what I’m doing currently. 1:I cloned the code then switch branch to beta build using mvn clean install. 2:I uploaded but it’s show the liquibase error. 3:I removed the five table of commonlabModule from DB and all entries from liquibaselogtable. 4:I removed the module and upload it again it does not start.When I hit start button the same error appear again.

okay @naveed1228 , try this for once ,

  1. delete Module from OpenMRS ,
  2. Delete Module from Modules folder also .
  3. drop all the tables having name “commonlab*”
  4. delete all the entries of CommonLab* from liquibasechangelog table .
  5. restart openMRS
  6. install omod file of the module.

See , if this works for you or not ?

Please try cleaning your tomcat work directory also.

We don’t necessarily need to drop all the module tables but since, this module is not in release environment therefore, module tables can be dropped to incorporate any new db changes that were made during development.

It’s not working @ahmed14.I try also with removing the directory as well.

I have added a comment about a failure am getting because of this commit: https://github.com/seekme94/openmrs-module-commonlabtest/commit/cf9a9500cfcd146fc0b413ab5161dbae89729964#diff-f097d035b1047bfff23d909d6bf5feb4

@dkayiwa I have responded to your comment on git.