OHDSI Home | Forums | Wiki | Github

Atlas not connecting to DB after Broadsea deployment

Hello,
I managed to complete most of the steps in the Broadsea “quick start” deployment instructions, however when I start Atlas in my browser, I still get the common error:

Application initialization failed
Unable to connect to an instance of the WebAPI.
Please contact your administrator to resolve this issue.

Let me describe my steps and what I see.
First, I followed the steps in the Python ETL of SynPUF data to CDMv5 repo to create a CDM. I created a Docker image which includes it, based on the official PostgreSQL docker.
I manage to connect to this DB from my host machine, using PgAdmin. The DB name is “ohdsi” and the data is included in a schema called “synpuf5”. I can see in PgAdmin 39 tables which are created there, as expected.
There is also a “results” schema which is empty, I created it as per the instructions in the ETL-CMS repo.

With this database live, I deploy Broadsea by running docker-compose up -d.
These are the contents of my docker-compose.yml file, with IPs and usernames/passwords ommited:

version: '2'

services:

  broadsea-methods-library:
    image: ohdsi/broadsea-methodslibrary
    ports:
      - "8787:8787"
      - "6311:6311"
    environment:
      - PASSWORD=mypass

  broadsea-webtools:
    image: ohdsi/broadsea-webtools
    ports:
      - "8080:8080"
    volumes:
     - .:/tmp/drivers/:ro
     - ./config-local.js:/usr/local/tomcat/webapps/atlas/js/config-local.js:ro
    environment:
      - WEBAPI_URL=http://localhost:8080
      - env=webapi-postgresql
      - security_enabled=false
      - security_origin=localhost
      - datasource_driverClassName=org.postgresql.Driver
      - datasource_url=jdbc:postgresql://{IP}:5432/ohdsi     
      - datasource.cdm.schema=synpuf5
      - datasource.ohdsi.schema=ohdsi
      - datasource_username={USERNAME}
      - datasource_password={PASSWORD}
      - spring.jpa.properties.hibernate.default_schema=ohdsi
      - spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
      - spring.batch.repository.tableprefix=ohdsi.BATCH_
      - flyway_datasource_driverClassName=org.postgresql.Driver
      - flyway_datasource_url=jdbc:postgresql://{IP}:5432/ohdsi
      - flyway_schemas=ohdsi
      - flyway.placeholders.ohdsiSchema=ohdsi
      - flyway_datasource_username={USERNAME}
      - flyway_datasource_password={PASSWORD}
      - flyway.locations=classpath:db/migration/postgresql

At this stage, after running docker-compose up -d for the first time, I see in PgAdmin another schema called “ohdsi” created with 66 tables in it, including “source” and “source_daimon”. These are the contents of the stderr log under /var/log/supervisor at this point:

Can't open /usr/local/tomcat/webapps/penelope/web/js/app.js: No such file or directory.
cp: cannot stat '/tmp/drivers/*.jar': No such file or directory
12-Oct-2021 06:04:53.712 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.46
12-Oct-2021 06:04:53.715 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          May 8 2021 17:35:52 UTC
12-Oct-2021 06:04:53.715 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.46.0
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.10.47-linuxkit
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/local/openjdk-8/jre
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_292-b10
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
12-Oct-2021 06:04:53.716 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
12-Oct-2021 06:04:53.721 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
12-Oct-2021 06:04:53.726 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.28] using APR version [1.6.5].
12-Oct-2021 06:04:53.726 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
12-Oct-2021 06:04:53.726 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
12-Oct-2021 06:04:53.730 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1d  10 Sep 2019]
12-Oct-2021 06:04:54.072 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
12-Oct-2021 06:04:54.103 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [616] milliseconds
12-Oct-2021 06:04:54.142 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
12-Oct-2021 06:04:54.142 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.46]
12-Oct-2021 06:04:54.171 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/WebAPI.war]
12-Oct-2021 06:04:54.182 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Context] failed to set property [antiJARLocking] to [true]
12-Oct-2021 06:05:01.862 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
12-Oct-2021 06:05:35.016 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/WebAPI.war] has finished in [40,843] ms
12-Oct-2021 06:05:35.017 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/atlas]
12-Oct-2021 06:05:35.029 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/atlas] has finished in [11] ms
12-Oct-2021 06:05:35.034 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
12-Oct-2021 06:05:35.048 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [40980] milliseconds

Now, I follow the Broadsea instructions, and run docker-compose down. Then I run my edited source_source_daimon.sql file in PgAdmin within the “ohdsi” schema. This is my edited file:

-- remove any previously added database connection configuration data

truncate ohdsi.source cascade;

truncate ohdsi.source_daimon cascade;

-- OHDSI CDM source

INSERT INTO ohdsi.source( source_id, source_name, source_key, source_connection, source_dialect)

VALUES (1, 'OHDSI CDM V5 Database', 'synpuf5',

'jdbc:postgresql://{IP}:5432/ohdsi?user={USERNAME}&password={PASSWORD}', 'postgresql');

-- CDM daimon

INSERT INTO ohdsi.source_daimon( source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (1, 1, 0, 'synpuf5', 2);

-- VOCABULARY daimon

INSERT INTO ohdsi.source_daimon( source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (2, 1, 1, 'synpuf5', 2);

-- RESULTS daimon

INSERT INTO ohdsi.source_daimon( source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (3, 1, 2, 'ohdsi', 2);

-- EVIDENCE daimon

INSERT INTO ohdsi.source_daimon( source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (4, 1, 3, 'ohdsi', 2);

It runs successfully and I can see in PgAdmin the changes being made in the “source” and “source_daimon” tables.

Then, I run docker-compose up -d again, and open Atlas in my browser, and get the “Unable to connect to an instance of the WebAPI” error. At this point, the error log file looks pretty similar to before:

Can't open /usr/local/tomcat/webapps/penelope/web/js/app.js: No such file or directory.
cp: cannot stat '/tmp/drivers/*.jar': No such file or directory
12-Oct-2021 06:14:12.231 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.46
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          May 8 2021 17:35:52 UTC
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.46.0
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            5.10.47-linuxkit
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/local/openjdk-8/jre
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_292-b10
12-Oct-2021 06:14:12.234 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
12-Oct-2021 06:14:12.235 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
12-Oct-2021 06:14:12.235 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
12-Oct-2021 06:14:12.238 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
12-Oct-2021 06:14:12.238 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
12-Oct-2021 06:14:12.238 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
12-Oct-2021 06:14:12.238 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
12-Oct-2021 06:14:12.238 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
12-Oct-2021 06:14:12.238 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
12-Oct-2021 06:14:12.239 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
12-Oct-2021 06:14:12.239 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
12-Oct-2021 06:14:12.239 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
12-Oct-2021 06:14:12.245 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.28] using APR version [1.6.5].
12-Oct-2021 06:14:12.245 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
12-Oct-2021 06:14:12.245 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
12-Oct-2021 06:14:12.250 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1d  10 Sep 2019]
12-Oct-2021 06:14:12.580 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
12-Oct-2021 06:14:12.609 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [600] milliseconds
12-Oct-2021 06:14:12.649 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
12-Oct-2021 06:14:12.649 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.46]
12-Oct-2021 06:14:12.681 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/WebAPI.war]
12-Oct-2021 06:14:12.693 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Context] failed to set property [antiJARLocking] to [true]
12-Oct-2021 06:14:20.188 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
12-Oct-2021 06:14:41.475 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/WebAPI.war] has finished in [28,791] ms
12-Oct-2021 06:14:41.476 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/atlas]
12-Oct-2021 06:14:41.489 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/atlas] has finished in [13] ms
12-Oct-2021 06:14:41.494 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
12-Oct-2021 06:14:41.507 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [28933] milliseconds

Can you think of something I didn’t do right? or steps I can take to find the problem? I assume it could be related to the first two lines in the log which don’t look right:

Can't open /usr/local/tomcat/webapps/penelope/web/js/app.js: No such file or directory.
cp: cannot stat '/tmp/drivers/*.jar': No such file or directory

But I have no idea what to do about it.

Thank you,

Alex

Update: I think I had a problem in the config-local.js file. I played with it manually as part of my experiments. Now I changed it to its original form and Atlas finally loaded for me!

However, I am getting this error now, when trying to select a data source:

Update: Now with the same exact settings, I cannot reproduce the working part, and again getting the “Unable to connect to an instance of the WebAPI” error when opening Atlas.

Really strange, I know. Any thoughts what may cause it to be “unstable” given what I already achieved (source, source_daimon tables exist, able to run manually the source_source_daimon.sql file, etc’, able to open Atlas in browser, just not have it connect to the DB, which is otherwise alive)

t