SSL-connection to localhost Opal fails

Hi, I have installed Opal as a docker image on my localhost. That much worked. But I am struggling to connect to my Opal server over R from the same machine:

Specifically I am getting an SSL-timeout error:

Logging into the collaborating servers
   [----------------------------------------------------------------------------  Login server [===================================>-------------------------------------]  50% / 0s Error in curl::curl_fetch_memory(url, handle = handle) : 
  Timeout was reached: [localhost:8843] SSL connection timeout

For reference, I attach my code in R console for connecting and my docker-compose for Opal installation. Notice that the URL https://localhost:8843/ matches the port exposed by the docker-compose.

  ports:
    - "8843:8443" #Ports opal is exposed on
    - "8880:8080" #Ports opal is exposed on

R Console:

install.packages('DSI')
install.packages('DSOpal', dependencies=TRUE)
install.packages('dsBaseClient', repos=c(getOption('repos'), 'http://cran.datashield.org'), dependencies=TRUE)

#load libraries
library(DSI)
library(DSOpal)
library(dsBaseClient)

#Add Log-in Info
builder <- DSI::newDSLoginBuilder()
builder$append(server = "server",  url = "https://localhost:8843/",
               user = "administrator", password = "[PASSWORD]", driver = "OpalDriver", options='list(ssl_verifyhost=0, ssl_verifypeer=0)')

#Log-in Command
logindata <- builder$build()
connections <- DSI::datashield.login(logins = logindata, assign = TRUE)
#Log-out Command
DSI::datashield.logout(connections)

Docker-Compose:

version: '3'
services:
  opal:
    platform: linux/x86_64
    image: obiba/opal:4.5 #January 2023
    ports:
      - "8843:8443" #Ports opal is exposed on
      - "8880:8080" #Ports opal is exposed on
    links:
      - rock
      - mongo
      - mysqldata
    environment:
      - JAVA_OPTS=-Xms1G -Xmx8G -XX:+UseG1GC
      - OPAL_ADMINISTRATOR_PASSWORD=[PASSWORD]
      - MONGO_HOST=mongo
      - MONGO_PORT=27017
      - MYSQLDATA_HOST=mysqldata
      - MYSQLDATA_USER=opal
      - MYSQLDATA_PASSWORD=[PASSWORD]
      - ROCK_HOSTS=rock:8085
    volumes:
      - ./vol:/srv #You may want to customize your volume
  mongo:
    platform: linux/x86_64
    image: mongo:4.2
  mysqldata:
    platform: linux/x86_64
    image: mysql:5
    environment:
      - MYSQL_DATABASE=opal
      - MYSQL_ROOT_PASSWORD=[PASSWORD]
      - MYSQL_USER=opal
      - MYSQL_PASSWORD=[PASSWORD]
  rock:
    platform: linux/x86_64
    image: obiba/rock:1.0-R4.2 #Oct 2022

Hi,

Have you checked for any CSRF errors in the opal log? (opal_home/logs/opal.log or download it from Administration > Java Virtual Machine > Logs > Download - Server logs)

By the way, for the rock service you should go with the image datashield/rock-base:6.2-R4.2. See documentation:

https://opaldoc.obiba.org/en/latest/cookbook/r-datashield/datashield-profiles.html

Regards
Yannick

1 Like

Hi Yannick,

I just re-composed with the rock-base image and after a few hiccups it just worked on the first try. Not sure what went wrong before.

Cheers, Ahmet