0

I run debian stable on several boxes. This morning I installed some security updates affecting Java on different boxes. The problem is that now I have some issues in using RJSDMX on one of them, despite they all having similar configurations.

https://github.com/amattioc/SDMX

which is a tool (available in many languages) to download statistical data from different providers. Part of the discussion is available here

https://github.com/amattioc/SDMX/issues/222

(including the suggestion to resort to the development version of RJSDMX). The situation is the following: if I install the development version of RJSDMX with

require(devtools)
install_github(repo = "amattioc/SDMX", subdir = "RJSDMX")

and then I try running the following short script

library(tidyverse)
library(RJSDMX)

estat_retrieval <- function(dataset_query){


    
res <- getTimeSeriesTable('EUROSTAT', dataset_query
    )  |>  as_tibble()

return(res)
    
}



query <-     "ert_bil_eur_a/A.AVG.NAC.RON"

all_rates_ini <- estat_retrieval(query)

all_rates_ini

sessionInfo()

I get this output

── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
✔ ggplot2 3.4.0     ✔ purrr   1.0.1
✔ tibble  3.1.8     ✔ dplyr   1.1.0
✔ tidyr   1.3.0     ✔ stringr 1.5.0
✔ readr   2.1.3     ✔ forcats 0.5.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
Loading required package: rJava
Loading required package: zoo

Attaching package: ‘zoo’

The following objects are masked from ‘package:base’:

    as.Date, as.Date.numeric

2023-01-30T15:40:23.983 INFO       [it.bancaditalia.oss.sdmx.client.RestSdmxClient runQuery] Contacting web service with query: https://ec.europa.eu/eurostat/api/dissemination/sdmx/2.1/dataflow/ESTAT/ert_bil_eur_a/latest
2023-01-30T15:40:24.448 SEVERE     [it.bancaditalia.oss.sdmx.client.RestSdmxClient runQuery] Exception. Class: javax.net.ssl.SSLHandshakeException - Message: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  it.bancaditalia.oss.sdmx.exceptions.SdmxIOException: Connection problems while talking to endpoint: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 11 (bullseye)

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8          LC_NUMERIC=C                 
 [3] LC_TIME=en_GB.UTF-8           LC_COLLATE=en_GB.UTF-8       
 [5] LC_MONETARY=en_GB.UTF-8       LC_MESSAGES=en_GB.UTF-8      
 [7] LC_PAPER=en_GB.UTF-8          LC_NAME=en_GB.UTF-8          
 [9] LC_ADDRESS=en_GB.UTF-8        LC_TELEPHONE=en_GB.UTF-8     
[11] LC_MEASUREMENT=en_GB.UTF-8    LC_IDENTIFICATION=en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] RJSDMX_3.0-4    zoo_1.8-11      rJava_1.0-6     forcats_0.5.2  
 [5] stringr_1.5.0   dplyr_1.1.0     purrr_1.0.1     readr_2.1.3    
 [9] tidyr_1.3.0     tibble_3.1.8    ggplot2_3.4.0   tidyverse_1.3.2

loaded via a namespace (and not attached):
 [1] pillar_1.8.1        compiler_4.2.2      cellranger_1.1.0   
 [4] dbplyr_2.2.1        tools_4.2.2         lattice_0.20-45    
 [7] timechange_0.1.1    googledrive_2.0.0   jsonlite_1.8.4     
[10] lubridate_1.9.0     lifecycle_1.0.3     gargle_1.2.1       
[13] gtable_0.3.1        pkgconfig_2.0.3     rlang_1.0.6        
[16] reprex_2.0.2        DBI_1.1.3           cli_3.6.0          
[19] haven_2.5.1         xml2_1.3.3          withr_2.5.0        
[22] httr_1.4.4          generics_0.1.3      vctrs_0.5.2        
[25] fs_1.5.2            hms_1.1.2           googlesheets4_1.0.1
[28] grid_4.2.2          tidyselect_1.2.0    glue_1.6.2         
[31] R6_2.5.1            fansi_1.0.4         readxl_1.4.1       
[34] tzdb_0.3.0          modelr_0.1.9        magrittr_2.0.3     
[37] backports_1.4.1     scales_1.2.1        ellipsis_0.3.2     
[40] rvest_1.0.3         assertthat_0.2.1    colorspace_2.0-3   
[43] utf8_1.2.2          stringi_1.7.8       munsell_0.5.0      
[46] broom_1.0.1         crayon_1.5.2  

Apparently it is an issue with updating some Java certificates, but I have no idea about how to do that. Running

$ sudo R CMD javareconf
Java interpreter : /usr/lib/jvm/default-java/bin/java
Java version     : 11.0.18
Java home path   : /usr/lib/jvm/default-java
Java compiler    : /usr/lib/jvm/default-java/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/lib/jvm/default-java/bin/jar

trying to compile and link a JNI program 
detected JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
gcc -I"/usr/share/R/include" -DNDEBUG -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux     -fpic  -g -O2 -ffile-prefix-map=/home/jranke/git/r-backports/bullseye/r-base-4.2.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -c conftest.c -o conftest.o
gcc -shared -L/usr/lib/R/lib -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/default-java/lib/server -ljvm -L/usr/lib/R/lib -lR


JAVA_HOME        : /usr/lib/jvm/default-java
Java library path: $(JAVA_HOME)/lib/server
JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/server -ljvm
Updating Java configuration in /usr/lib/R
Done.

did not help. Any suggestion is really appreciated!

larry77
  • 1,309
  • 14
  • 29

1 Answers1

0

I discovered the solution was a one-liner

sudo update-ca-certificates -f

as in

https://stackoverflow.com/a/43873005

larry77
  • 1,309
  • 14
  • 29