error on BAHMNI MART

bahmni
mart
Tags: #<Tag:0x00007f88c9958130> #<Tag:0x00007f88c995afc0>

(focus shao) #1

Hello Team, am getting this error during installation of bahmni-mart:

fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”: “AnsibleUndefinedVariable: {{ OPENMRS_DB_PASSWORD }}: ‘OPENMRS_DB_PASSWORD’ is undefined”}


(sudhamsh kandukuri) #2

Hi,

Please define the following variables under setup file

/etc/bahmni-mart-playbook/setup.yml

  • ANALYTICS_DB_PASSWORD
  • OPENMRS_DB_PASSWORD

and re-run the installation


(focus shao) #3

hey sudhamsh, so i did that and it worked fine, but now am facing challenge that all table with person info, orders have data except obs forms, i can see some of obs forms on analytics db but with no data. thanks in advance focus


(Pramida Tumma) #4

This would need changing the config file. Can you please post the bahmni mart log so that we can analyze more. Also, are you using Bahmni or only Openmrs?


(focus shao) #5

Am using bahmni, see logs bellow:

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [DROP TABLE IF EXISTS “baseline_past_tb_treatment_drug_regimen” CASCADE; CREATE TABLE “baseline_past_tb_treatment_drug_regimen”( “id_baseline_past_tb_treatment_drug_regimen” integer PRIMARY KEY , “patient_id” integer , “encounter_id” integer , “obs_datetime” text , “date_created” text , “location_id” integer , “location_name” text , “program_id” integer , “program_name” text , “id_tb_treatment_initilization” integer REFERENCES “tb_-treatment_initilization" ("id_tb-treatment_initilization") ON DELETE CASCADE , “baseline_past_tb_treatment_drug_regimen” text );]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "tb-treatment_initilization" does not exist at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:445) at org.bahmni.mart.table.TableGeneratorStep.lambda$createTables$0(TableGeneratorStep.java:34) at java.util.ArrayList.forEach(Unknown Source) at org.bahmni.mart.table.TableGeneratorStep.createTables(TableGeneratorStep.java:29) at org.bahmni.mart.config.stepconfigurer.StepConfigurer.createTables(StepConfigurer.java:57) at org.bahmni.mart.job.StepRegister.getJob(StepRegister.java:32) at org.bahmni.mart.job.ObsJobStrategy.getJob(ObsJobStrategy.java:21) at org.bahmni.mart.job.JobContext.getJob(JobContext.java:59) at org.bahmni.mart.executors.MartJobExecutor.lambda$execute$0(MartJobExecutor.java:65) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.collect(Unknown Source) at org.bahmni.mart.executors.MartJobExecutor.execute(MartJobExecutor.java:71) at org.bahmni.mart.BatchConfiguration.lambda$run$0(BatchConfiguration.java:38) at java.util.ArrayList.forEach(Unknown Source) at org.bahmni.mart.BatchConfiguration.run(BatchConfiguration.java:37) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:732) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:716) at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:703) at org.springframework.boot.SpringApplication.run(SpringApplication.java:304) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) at org.bahmni.mart.Application.main(Application.java:12) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: org.postgresql.util.PSQLException: ERROR: relation "tb-_treatment_initilization” does not exist at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266) at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) at com.sun.proxy.$Proxy44.execute(Unknown Source) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:436) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408) … 35 common frames omitted

2018-10-18 06:44:33.857 WARN 13040 — [main] o.bahmni.mart.executors.MartJobExecutor : StatementCallback; bad SQL grammar [DROP TABLE IF EXISTS “baseline_past_tb_treatment_drug_regimen” CASCADE; CREATE TABLE “baseline_past_tb_treatment_drug_regimen”( “id_baseline_past_tb_treatment_drug_regimen” integer PRIMARY KEY , “patient_id” integer , “encounter_id” integer , “obs_datetime” text , “date_created” text , “location_id” integer , “location_name” text , “program_id” integer , “program_name” text , “id_tb_treatment_initilization” integer REFERENCES “tb_-treatment_initilization" ("id_tb-treatment_initilization") ON DELETE CASCADE , “baseline_past_tb_treatment_drug_regimen” text );]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "tb-_treatment_initilization” does not exist

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [DROP TABLE IF EXISTS “baseline_past_tb_treatment_drug_regimen” CASCADE; CREATE TABLE “baseline_past_tb_treatment_drug_regimen”( “id_baseline_past_tb_treatment_drug_regimen” integer PRIMARY KEY , “patient_id” integer , “encounter_id” integer , “obs_datetime” text , “date_created” text , “location_id” integer , “location_name” text , “program_id” integer , “program_name” text , “id_tb_treatment_initilization” integer REFERENCES “tb_-treatment_initilization" ("id_tb-treatment_initilization") ON DELETE CASCADE , “baseline_past_tb_treatment_drug_regimen” text );]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "tb-treatment_initilization" does not exist at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:445) at org.bahmni.mart.table.TableGeneratorStep.lambda$createTables$0(TableGeneratorStep.java:34) at java.util.ArrayList.forEach(Unknown Source) at org.bahmni.mart.table.TableGeneratorStep.createTables(TableGeneratorStep.java:29) at org.bahmni.mart.config.stepconfigurer.StepConfigurer.createTables(StepConfigurer.java:57) at org.bahmni.mart.job.StepRegister.getJob(StepRegister.java:32) at org.bahmni.mart.job.REGJobStrategy.getJob(REGJobStrategy.java:21) at org.bahmni.mart.job.JobContext.getJob(JobContext.java:59) at org.bahmni.mart.executors.MartJobExecutor.lambda$execute$0(MartJobExecutor.java:65) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.collect(Unknown Source) at org.bahmni.mart.executors.MartJobExecutor.execute(MartJobExecutor.java:71) at org.bahmni.mart.BatchConfiguration.lambda$run$0(BatchConfiguration.java:38) at java.util.ArrayList.forEach(Unknown Source) at org.bahmni.mart.BatchConfiguration.run(BatchConfiguration.java:37) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:732) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:716) at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:703) at org.springframework.boot.SpringApplication.run(SpringApplication.java:304) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) at org.bahmni.mart.Application.main(Application.java:12) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: org.postgresql.util.PSQLException: ERROR: relation "tb-_treatment_initilization” does not exist at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266) at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) at com.sun.proxy.$Proxy44.execute(Unknown Source) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:436) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408) … 35 common frames omitted

2018-10-18 06:44:34.551 WARN 13040 — [main] o.bahmni.mart.executors.MartJobExecutor : StatementCallback; bad SQL grammar [DROP TABLE IF EXISTS “baseline_past_tb_treatment_drug_regimen” CASCADE; CREATE TABLE “baseline_past_tb_treatment_drug_regimen”( “id_baseline_past_tb_treatment_drug_regimen” integer PRIMARY KEY , “patient_id” integer , “encounter_id” integer , “obs_datetime” text , “date_created” text , “location_id” integer , “location_name” text , “program_id” integer , “program_name” text , “id_tb_treatment_initilization” integer REFERENCES “tb_-treatment_initilization" ("id_tb-treatment_initilization") ON DELETE CASCADE , “baseline_past_tb_treatment_drug_regimen” text );]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "tb-_treatment_initilization” does not exist

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [DROP TABLE IF EXISTS “baseline_past_tb_treatment_drug_regimen” CASCADE; CREATE TABLE “baseline_past_tb_treatment_drug_regimen”( “id_baseline_past_tb_treatment_drug_regimen” integer PRIMARY KEY , “patient_id” integer , “encounter_id” integer , “obs_datetime” text , “date_created” text , “location_id” integer , “location_name” text , “program_id” integer , “program_name” text , “id_tb_treatment_initilization” integer REFERENCES “tb_-treatment_initilization" ("id_tb-treatment_initilization") ON DELETE CASCADE , “baseline_past_tb_treatment_drug_regimen” text );]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "tb-treatment_initilization" does not exist at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:419) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:445) at org.bahmni.mart.table.TableGeneratorStep.lambda$createTables$0(TableGeneratorStep.java:34) at java.util.ArrayList.forEach(Unknown Source) at org.bahmni.mart.table.TableGeneratorStep.createTables(TableGeneratorStep.java:29) at org.bahmni.mart.config.stepconfigurer.StepConfigurer.createTables(StepConfigurer.java:57) at org.bahmni.mart.job.StepRegister.getJob(StepRegister.java:32) at org.bahmni.mart.job.DispositionJobStrategy.getJob(DispositionJobStrategy.java:21) at org.bahmni.mart.job.JobContext.getJob(JobContext.java:59) at org.bahmni.mart.executors.MartJobExecutor.lambda$execute$0(MartJobExecutor.java:65) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.collect(Unknown Source) at org.bahmni.mart.executors.MartJobExecutor.execute(MartJobExecutor.java:71) at org.bahmni.mart.BatchConfiguration.lambda$run$0(BatchConfiguration.java:38) at java.util.ArrayList.forEach(Unknown Source) at org.bahmni.mart.BatchConfiguration.run(BatchConfiguration.java:37) at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:732) at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:716) at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:703) at org.springframework.boot.SpringApplication.run(SpringApplication.java:304) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) at org.bahmni.mart.Application.main(Application.java:12) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: org.postgresql.util.PSQLException: ERROR: relation "tb-_treatment_initilization” does not exist at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2433) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2178) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266) at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114) at com.sun.proxy.$Proxy44.execute(Unknown Source) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:436) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408) … 35 common frames omitted

2018-10-18 06:44:37.652 WARN 13040 — [main] o.bahmni.mart.executors.MartJobExecutor : StatementCallback; bad SQL grammar [SELECT sb.surgical_block_id, concat_ws(’ ‘, ifnull(pn.given_name, ‘’), ifnull(pn.family_name, ‘’)) AS primary_provider_name, concat_ws(’ ‘, ifnull(pn2.given_name, ‘’), ifnull(pn2.family_name, ‘’)) AS creator_name, l.name AS location_name, sb.start_datetime AS block_starttime, sb.end_datetime AS block_endtime, sb.date_created AS date_created, sb.date_changed AS date_changed, cb.changed_by AS changed_by FROM surgical_block sb INNER JOIN location l ON l.location_id = sb.location_id AND l.retired = 0 AND sb.voided = 0 INNER JOIN provider p ON p.provider_id = sb.primary_provider_id AND p.retired = 0 INNER JOIN person_name pn ON pn.person_id = p.person_id AND pn.voided = 0 INNER JOIN provider p2 ON p2.provider_id = sb.creator AND p2.retired = 0 INNER JOIN person_name pn2 ON pn2.person_id = p2.person_id AND pn2.voided = 0 LEFT OUTER JOIN (SELECT surgical_block_id, concat_ws(’ ', ifnull(pn4.given_name, ‘’), ifnull(pn4.family_name, ‘’)) AS changed_by FROM surgical_block sb1 INNER JOIN provider p3 ON p3.provider_id = sb1.changed_by AND sb1.voided = 0 INNER JOIN person_name pn4 ON pn4.person_id = p3.person_id) cb ON cb.surgical_block_id = sb.surgical_block_id LIMIT 1]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table ‘openmrs.surgical_block’ doesn’t exist


(focus shao) #6

turns out some of concepts were causing this. tried to put them in obs -> “columnsToIgnore” cand worked fine. thank you


(focus shao) #7

Hello Pramida Tumma, AM exipirience this error during installation to the production server, any help will be much appriciated:

TASK [bahmni-mart-scdf : Run Liquibase migration] ****************************** fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“liquibase”, “–driver=org.postgresql.Driver”, “–classpath=/opt/bahmni-mart/lib/postgresql-42.2.2.jar”, “–changeLogFile=/opt/bahmni-mart/conf/bahmni-mart-scdf-liquibase.xml”, “–defaultSchemaName=public”, “–url=jdbc:postgresql://localhost:5432/analytics”, “–username=analytics”, “–password=”, “update”], “delta”: “0:00:00.730019”, “end”: “2018-10-24 19:42:34.663000”, “failed”: true, “rc”: 255, “start”: “2018-10-24 19:42:33.932981”, “stderr”: “Liquibase update Failed: Unknown Reason”, “stdout”: “”, “stdout_lines”: [], “warnings”: []} to retry, use: --limit @/etc/bahmni-mart-playbook/all.retry

PLAY RECAP ********************************************************************* localhost : ok=36 changed=14 unreachable=0 failed=1


(sudhamsh kandukuri) #8

Hi

Please run the following command to re-run the migration

liquibase --driver=org.postgresql.Driver --classpath=/opt/bahmni-mart/lib/postgresql-42.2.2.jar --changeLogFile=/opt/bahmni-mart/conf/bahmni-mart-scdf-liquibase.xml --defaultSchemaName=public --url=jdbc:postgresql://localhost:5432/analytics --username=analytics --password=’’ update

The ouput will show if there is any error while running the migrations


(focus shao) #9

Thank you, i had to go to the file and run SQL manually


(Arjun Khandelwal) #10

@fosha i am seeing the same issue. What SQL did you run manually to fix this issue? Once we understand the issue, might be better to fix in the installation itself so that others don’t get it.