Issues with using opalr for installing specific DataSHIELD release

Hi @yannick or possibly other developers of opalr!

I have written the following script with the goal to install a specific DataSHIELD version via opalr on the server side.

library(opalr)
o <- opal.login('administrator', 'password', url = 'https://localhost:8443', opts = list(ssl.verifypeer = 0))
dsadmin.install_package(o, 'dsBase', githubusername = "datashield", ref='5.1.0')
opal.logout(o)

It does what it should, but the command

dsadmin.install_package(o, 'dsBase', githubusername = "datashield", ref='5.1.0') 

yields an error: Error: Client error: (400) Bad Request; IllegalArgument: R option format is invalid

Can you explain this error?

When writing this code, I encountered some other behaviour which I would consider a bug: Without the “githubusername” argument, the “ref” is simply ignored. I figured it out how to do it after looking at the code of dsadmin.install_packages. This contradicts the documentation, which simply states, “If NULL (default), try to install from DataSHIELD package repository.”

I’ve now found out that the following request is done behind the scenes by dsadmin.install_packages. It yields am error, but does what’s intended:

opal rest --opal https://localhost:8443 --user  administrator --password password -m POST '/datashield/packages?name=datashield%2FdsBase&ref=6.0.0'
(22, 'The requested URL returned error: 400 Bad Request')

Hi Stefan,

I cannot reproduce your example, neither on localhost, nor on opal-demo.obiba.org.

library(opalr)
o <- opal.login('administrator', 'password', url = 'https://opal-demo.obiba.org')
dsadmin.install_package(o, 'dsBase', githubusername = "datashield", ref='6.0.0')
dsadmin.package_descriptions(o)
opal.logout(o)

You should have a look at the error details in the opal log file (can be downloaded from Administration > Java Virtual Machine > Logs) or the R server log file (can be downloaded from Administration > R > R server).

Cheers
Yannick

Apparently the error message “R option format is invalid” is coming from Opal that fails at parsing the DataSHIELD configuration from a R package. Are you developing one DataSHIELD package? if yes could you share the DataSHIELD configuration that is declared?

Will take the opportunity of this to make Opal more robust for that kind of errors.

1 Like

Thanks for the quick reply. I checked the log. There is the following line:

{"@timestamp":"2020-06-08T10:49:36.402+00:00","@version":1,"message":"/datashield/packages queryParams:{ref=[5.1.0], name=[datashield/dsBase]}","logger_name":"org.obiba.opal.web.security.AuditInterceptor","thread_name":"qtp413763859-125","level":"WARN","level_value":30000,"HOSTNAME":"datashield-vm","method":"POST","username":"administrator","status":"400"}

I assume this problems occurs because another package I developed, “dsBoltzmannMachines”, is installed.

Of course I would like to contribute my DataSHIELD configuration. How can I extract the information?

The DataSHIELD configuration of your dsBoltzmannMachines package should be in the DESCRIPTION file.

This is the description file of the package that is installed in addition to dsBase on my VM:

Thanks for sharing this. The error is in the Options definition: what is expected are key-value pairs, separated by commas. See how it is done in the dsBase package:

1 Like

Ah OK, thanks, I will update this in my package. It is strange though that the call errors because of the options of an unrelated package.

What you were trying to do is to install a DataSHIELD package. Once done Opal will scan the DataSHIELD R packages on the R server side to update the DataSHIELD configuration (discovery of the allowed functions and of the R options). Most probably dsBoltzmannMachines has always failed but the error could not be seen in the GUI.

The installation worked and also the methods are available and visible in the GUI. So I would have never guessed that this could be problematic, thanks.

You probably did not installed it through Opal then or something was broken recently in the JuliaConnectoR package. This is what I get in the R server:

* installing *source* package ‘dsBoltzmannMachines’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Error: object ‘juliaUsing’ is not exported by 'namespace:JuliaConnectoR'
Execution halted
ERROR: lazy loading failed for package ‘dsBoltzmannMachines’
* removing ‘/srv/R/library/dsBoltzmannMachines’
Error : Failed to install 'dsBoltzmannMachines' from GitHub

Sorry, I did not know that you wanted to try it out. The instructions for installing are more complicated and listed in the README of dsBoltzmannMachinesClient.

The dsBoltzmannMachines package has not been updated to work with the new version of the JuliaConnectoR that is on CRAN now. I have to say that I’m not entirely sure whether I used dsadmin.install_package or dsadmin.set_package_methods to register the package in Opal finally. I should test and document that!