OHDSI Home | Forums | Wiki | Github

Error logged booting WebAPI

The following error shows up when I am booting WebAPI

DaimonType (Vocabulary) not found in Source

The stack trace is as follows:

2018-09-07 15:07:24.420 ERROR taskExecutor-1 org.springframework.batch.core.step.AbstractStep - - Encountered an error executing step warmCacheStep in job warmCache
java.lang.RuntimeException: DaimonType (Vocabulary) not found in Source
at org.ohdsi.webapi.source.Source.getTableQualifier(Source.java:75)
at org.ohdsi.webapi.cdmresults.CDMResultsCacheTasklet.warmCache(CDMResultsCacheTasklet.java:55)
at org.ohdsi.webapi.cdmresults.CDMResultsCacheTasklet.execute(CDMResultsCacheTasklet.java:89)
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406)
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:272)
at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:81)
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:374)
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)
at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:200)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:392)
at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:135)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

What does this mean?

It looks like when he application starts up, it wants to ‘warm a cache’ of vocabulary search terms. But, when you started the app, you probably didn’t have any sources set up in your webapi.SOURCE table. That’s causing the application to fail to start because someone coded that it’s a critical failure if there is no vocabulary set up. This might be considered a bug because due to recent changes, you can now go to the configuration screen and add/remove sources there, HOWEVER, that requires security is enabled…so, to get around this issue, populate your source table with a connection to a CDM (with the vocabulary tables in it) and then start up the app.

-Chris

I have sources set up in the WebAPI source table.

The tables created when WebAPI launched the first time are in a schema called OHDSI
The synpuf5 sample data and vocab are in a schema called SYNPUF5
And the results I generated from the Synpuf data using Achilles are in a schema called RESULTS

This is how I populated the source and source_daimon tables
INSERT INTO OHDSI.source (source_id, source_name, source_key, source_connection, source_dialect)
VALUES (1, ‘My Cdm’, ‘CDM_SOURCE’, {SYNPUF5 schema jdbc string}, ‘oracle’);
INSERT INTO OHDSI.source (source_id, source_name, source_key, source_connection, source_dialect)
VALUES (2, ‘Default vocabulary’, ‘VOCABULARY’, {SYNPUF5 schema jdbc string}, ‘oracle’);
INSERT INTO OHDSI.source (source_id, source_name, source_key, source_connection, source_dialect)
VALUES (3, ‘Results’, ‘RESULTS’, {RESULTS schema jdbc string}, ‘oracle’);
INSERT INTO OHDSI.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
VALUES (1,1,0, ‘CDM_SOURCE’, 0);
INSERT INTO OHDSI.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
VALUES (2,2,1, ‘VOCABULARY’, 0);
INSERT INTO OHDSI.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
VALUES (3,3,2, ‘RESULTS’, 0);
INSERT INTO OHDSI.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
VALUES (4,2,1, ‘VOCABULARY’, 1);

The is what the WebAPI shows for sources
[{“sourceId”:1,“sourceName”:“My Cdm”,“sourceDialect”:“oracle”,“sourceKey”:“CDM_SOURCE”,“daimons”:[{“sourceDaimonId”:1,“daimonType”:“CDM”,“tableQualifier”:“CDM_SOURCE”,“priority”:0}]},{“sourceId”:3,“sourceName”:“Results”,“sourceDialect”:“oracle”,“sourceKey”:“RESULTS”,“daimons”:[{“sourceDaimonId”:3,“daimonType”:“Results”,“tableQualifier”:“RESULTS”,“priority”:0}]},{“sourceId”:2,“sourceName”:“Default vocabulary”,“sourceDialect”:“oracle”,“sourceKey”:“VOCABULARY”,“daimons”:[{“sourceDaimonId”:4,“daimonType”:“Vocabulary”,“tableQualifier”:“VOCABULARY”,“priority”:1},{“sourceDaimonId”:2,“daimonType”:“Vocabulary”,“tableQualifier”:“VOCABULARY”,“priority”:0}]}]

The values you insert make it looks like you have 3 sources (one source per record inserted into the source table). Is that what you meant? Probably not.

Instead, you should have 1 record in source:

INSERT INTO OHDSI.source (source_id, source_name, source_key, source_connection, source_dialect) 
VALUES (1, 'My Cdm', 'CDM_SOURCE', {oracle database jdbc string}, 'oracle');

Then, you want to add the table qualifiers for the cdm, vocabulary and results schemas by inserting into source_daimon:

INSERT INTO OHDSI.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) 
VALUES (1,1,0, 'SYNPUF5', 0);
INSERT INTO OHDSI.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) 
VALUES (1,2,1, 'SYNPUF5', 0);
INSERT INTO OHDSI.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) 
VALUES (1,3,2, 'RESULTS', 0);

Your original inserts had the following problems:

  1. You made 3 source entries when you only have 1 source.
  2. your jdbc connection string appears to be ‘schema’ focused, but the jdbc connection string is only to connect to the database/server.
  3. The table qualifiers you set up were ‘CDM_SOURCE’, ‘VOCABULARY’, and ‘RESULTS’, when you don’t have a ‘CDM_SOURCE’ schema nor a ‘VOCABULARY’ schema. Instead, you have 2 schemas: ‘SYNPUF5’ and’RESULTS’. schema stored in your single database. So, you create source_daimon records to indicate wich schemas (cdm, vocabulary, results) have which names (‘SYNPUF5’, ‘SYNPUF5’, ‘RESULTS’).
t