OHDSI / Broadsea

Broadsea deploys the core OHDSI technology stack (Atlas & R Hades), using cross-platform Docker container technology.
http://ohdsi.github.io/Broadsea/
Apache License 2.0
76 stars 59 forks source link

JDBC connection error from fresh install of broadsea with broadsea-atlasDB due to JDBC connection error code: 99999 #135

Open natpatchara-w opened 4 months ago

natpatchara-w commented 4 months ago

JDBC connection error of broadsea with broadsea-atlasDB due to JDBC connection error code: 99999, java.lang.IllegalArgumentException: Prohibited character

On broadsea installation using step provide in https://github.com/OHDSI/Broadsea readme.md topic installation. After cloning git and compose docker as describe. The landing page display correctly but after switch to atlas page error is thrown as Application cannot initialized, unable to connect to an instance of WebAPI. atlas-error-page

running docker logs on webapi show the following logs

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v1.5.22.RELEASE)

2024-06-17 02:53:39.587 ERROR main org.apache.juli.logging.DirectJDKLog - [] - Unable to create initial connections of pool. org.postgresql.util.PSQLException: Something unusual has occurred to cause the driver to fail. Please report this exception. at org.postgresql.Driver.connect(Driver.java:282) ~[postgresql-42.3.7.jar!/:42.3.7] at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319) ~[tomcat-jdbc-8.5.43.jar!/:?] at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:212) ~[tomcat-jdbc-8.5.43.jar!/:?] at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:736) ~[tomcat-jdbc-8.5.43.jar!/:?] at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:668) ~[tomcat-jdbc-8.5.43.jar!/:?] ... Caused by: java.lang.IllegalArgumentException: Prohibited character at org.postgresql.shaded.com.ongres.saslprep.SaslPrep.saslPrep(SaslPrep.java:105) ~[postgresql-42.3.7.jar!/:42.3.7] at org.postgresql.shaded.com.ongres.scram.common.stringprep.StringPreparations$2.doNormalize(StringPreparations.java:55) ~[postgresql-42.3.7.jar!/:42.3.7] ... 2024-06-17 02:53:39.595 WARN main org.springframework.context.support.AbstractApplicationContext - [] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shiroFilter' defined in class path resource [org/ohdsi/webapi/ShiroConfiguration.class]: Unsatisfied dependency expressed through method 'shiroFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource [org/ohdsi/webapi/FlywayConfig.class]: Invocation of init method failed; nested exception is org.flywaydb.core.internal.dbsupport.FlywaySqlException: Unable to obtain Jdbc connection from DataSource

SQL State : 99999 Error Code : 0 Message : Something unusual has occurred to cause the driver to fail. Please report this exception.

full logs is attached below logs.txt

....................................................................................................................................................................................................................................................................

fixed

After researching I found that the problem was caused due to the the special character in authentication. And for this case was cause due to a misplace special character of new line in WEBAPI_DATASOURCE_PASSWORD causing JDBC driver to fail when trying yo connect with the atlasDB

pre-edit-secret

post-edit-secret

After delete an extra newline and restart container the problem was gone and webAPI succesfully connected to the DB.

post-edit-atlas-page

Suggested edit: delete the special character at the end of WEBAPI_DATASOURCE_PASSWORD

AZSJTinus commented 2 weeks ago

It looks like pull/running this repo to a windows system might change the line endings adding invisible characters. I got a similar issue when running Achilles, the issue there was the line endings in the heredoc. Pulling in Linux and starting it there gives no issues (for de default profile, I have yet to run the Achilles container).

natpatchara-w commented 2 weeks ago

Thank you for the response. I run these on my windows 10 machine and that is where I encounter this problem. At first, I thought it is a typo error so I open a pull request to try to correct that. But if it is like this then may be it is more of a platform problem. So that request might not be needed and an edit to document to inform a windows user of this bug might be more useful.

By the way, I think I will leave this open for a mean time in case that other person encounter the same problem unitl a more solid solution come.