molgenis / molgenis-service-armadillo

Armadillo; a DataSHIELD implementation, part of the MOLGENIS suite
https://molgenis.github.io/molgenis-service-armadillo/
GNU Lesser General Public License v3.0
7 stars 10 forks source link

/install-package endpoint doesn't work #511

Closed marikaris closed 6 months ago

marikaris commented 1 year ago

Add profile xenon, whitelist dsBase, resourcer and start it.

Download the following: MolgenisArmadillo_2.0.1.tar.gz

Run this:

library(MolgenisArmadillo)

armadillo_url <- "http://localhost:8080/"
armadillo.login(armadillo_url)
token <- armadillo.get_token(armadillo_url)
armadillo.install_packages("/your/path/here/MolgenisArmadillo_2.0.1.tar.gz", "xenon")

Message:

Attempting to install package [ '/Users/mkslofstra/git/MolgenisArmadillo_2.0.1.tar.gz' ]
Package [ '/Users/mkslofstra/git/MolgenisArmadillo_2.0.1.tar.gz' ] installed

Expected: Can run profile with updated R package.

Actual:

Error: Internal server error: Error in FUN(X[[i]], ...) :
there is no package called ‘MolgenisArmadillo’

So the package is not installed

See also https://molgenis.github.io/molgenis-r-armadillo/articles/install_packages.html

clemens-tolboom commented 1 year ago

My comments moved to https://github.com/molgenis/molgenis-service-armadillo/issues/515

clemens-tolboom commented 1 year ago

My logging shows the installation succeeds

15:24:14.024 [pool-2-thread-1|C8FCD377] INFO o.m.r.service.RExecutorServiceImpl - Installing package 'MolgenisArmadillo_2.0.1.tar.gz' 15:24:14.024 [pool-2-thread-1|C8FCD377] INFO o.m.r.service.RExecutorServiceImpl - Copying 'MolgenisArmadillo_2.0.1.tar.gz' to R... 15:24:14.061 [pool-2-thread-1|C8FCD377] DEBUG o.molgenis.r.rserve.RserveConnection - Copied 2 MB in 32ms [64,700 MB/s] 15:24:14.062 [pool-2-thread-1|C8FCD377] DEBUG o.m.r.service.RExecutorServiceImpl - Evaluate remotes::install_local('MolgenisArmadillo_2.0.1.tar.gz', dependencies = TRUE, upgrade = 'never') 15:24:44.391 [http-nio-8080-exec-5|C8FCD377] TRACE o.m.a.interceptor.MDCInterceptor - preHandle 15:24:44.397 [http-nio-8080-exec-5|C8FCD377] WARN o.s.w.s.m.s.DefaultHandlerExceptionResolver - Resolved [org.springframework.web.context.request.async.AsyncRequestTimeoutException]

Further investigation shows by running in the xenon container shows the library is installed.

R -e 'library("MolgenisArmadillo")'
StuartWheater commented 12 months ago

As part of dsBaseClient CI tests the following is performed:

curl -u admin:admin --max-time 300 -v -H 'Content-Type: multipart/form-data' -F "file=@dsBase_6.3.1-permissive.tar.gz" -X POST http://localhost:8080/install-package

The package install, if performed independently, is successful, but curl indicates a 503 HTTP error.

clemens-tolboom commented 11 months ago

Checking rock server (xenon [datashield/rock-base:latest])

==> rock.log <== 2023-11-23 15:21:40,956 - DEBUG - org.springframework.web.servlet.DispatcherServlet - Completed 200 OK 2023-11-23 15:21:41,079 - DEBUG - org.springframework.web.servlet.DispatcherServlet - POST "/r/session/916f6d4d-09a1-4738-8cf3-1ceabc8cc557/_upload?path=MolgenisArmadillo_2.0.1.tar.gz&overwrite=true", parameters={multipart} 2023-11-23 15:21:41,337 - DEBUG - org.springframework.web.multipart.commons.CommonsMultipartResolver - Part 'file', size 2111022 bytes, filename='MolgenisArmadillo_2.0.1.tar.gz' 2023-11-23 15:21:41,354 - DEBUG - org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to org.obiba.rock.rest.RSessionController#uploadFile(User, String, CommonsMultipartFile, String, boolean, boolean) 2023-11-23 15:21:41,411 - DEBUG - org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor - Using 'text/plain', given [text/plain, application/json, application/+json, /] and supported [/*] 2023-11-23 15:21:41,415 - DEBUG - org.springframework.web.multipart.commons.CommonsMultipartResolver - Cleaning up part 'file', filename 'MolgenisArmadillo_2.0.1.tar.gz' 2023-11-23 15:21:41,416 - DEBUG - org.springframework.web.servlet.DispatcherServlet - Completed 200 OK 2023-11-23 15:21:41,433 - DEBUG - org.springframework.web.servlet.DispatcherServlet - POST "/r/session/916f6d4d-09a1-4738-8cf3-1ceabc8cc557/_eval", parameters={} 2023-11-23 15:21:41,434 - DEBUG - org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped to org.obiba.rock.rest.RSessionController#evalScriptJSON(User, String, boolean, String, UriComponentsBuilder) 2023-11-23 15:21:41,439 - DEBUG - org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor - Read "application/x-rscript;charset=UTF-8" to ["remotes::install_local('MolgenisArmadillo_2.0.1.tar.gz', dependencies = TRUE, upgrade = 'never')"]

So it seems the file arrived ... not sure what upgrade never means

RStudio

armadillo_url <- "http://localhost:8080/" armadillo.login(armadillo_url) [1] "We're opening a browser so you can log in with code JRKWPR" token <- armadillo.get_token(armadillo_url) [1] "We're opening a browser so you can log in with code ZYXTNT" armadillo.install_packages("~/Downloads/MolgenisArmadillo_2.0.1.tar.gz", "xenon") Attempting to install package [ '~/Downloads/MolgenisArmadillo_2.0.1.tar.gz' ] Error: Something went wrong (503): No message available

mswertz commented 6 months ago

cant reproduce