Hello.
I'm running ORDS 21.1 in OpenShift 4 with Tomcat and it's having issues when using the TNS connection type. If I use the basic connection type, everything is fine.
This is a snippet of my ords_params.properties file where TNS is configured:
db.connectionType=tns
db.tnsDirectory=/u01/network/admin
db.tnsAliasName=MY_ALIAS
OpenShift is using a BuildConfig to build ORDS from a Dockerfile and the java command in the Dockerfile sets the TNS admin directory:
RUN $JAVA_HOME/bin/java -Xmx$JAVA_HEAP_MAX -Doracle.net.tns_admin=/u01/network/admin -jar /u01/ords/ords.war
At this point the TNS connection is working and I can see the following output in the log from running ords.war.
Apologies for not posting complete logs, I have no way to retrieve them from the OpenShift cluster.
2023-05-19T15:53:10.668Z INFO Oracle REST Data Services schema version 21.1.1.r1162032 is installed.
But when it comes to Tomcat starting ORDS, I see connection pool errors in the log:
2023-05-19T15:54:43.956Z WARNING The pool named: |apex|| is invalid and will be ignored: ORDS was unable to make a connection to the database. …… IO Error: Unknown host specified ……
2023-05-19T15:54:43.964Z SEVERE IO Error: Unknown host specified …… |apex|| …… jdbc:oracle:thin:@MY_ALIAS
I've tried the following Tomcat images, with no change in behaviour:
- tomcat:9.0.20-jre8-alpine
- 9.0.75-jre11
- 9.0.75-jdk17
I've also tried opening up the permissions on the tnsnames.ora file and its parent folder structure but that also did not change the behaviour.
RUN chmod 777 /u01 && \
chmod 777 /u01/network && \
chmod 777 /u01/network/admin && \
chmod 777 /u01/network/admin/tnsnames.ora
Like I said, if I switch to basic everything works fine, so I'm fairly convinced it's an issue with my ORDS configuration.
Any help would be much appreciated.
Thanks.