BiocManager
BiocManager copied to clipboard
Error: loading failed for install BiocManager packages
These days I installed the BiocManager in R version 4.2.0, but I am failed for it I tried lots of method, but got the same error I am appreciate it if you have some idea to solve it!!
install.packages("BiocManager") trying URL 'http://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/BiocManager_1.30.18.tar.gz' Content type 'application/octet-stream' length 289602 bytes (282 KB) ================================================== downloaded 282 KB
- installing source package ‘BiocManager’ ... ** package ‘BiocManager’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location Warning in file(con, "r") : URL 'https://bioconductor.org/config.yaml': Timeout of 60 seconds was reached Error: package or namespace load failed for ‘BiocManager’: .onAttach failed in attachNamespace() for 'BiocManager', details: call: if (max(r) == package_version("3.6")) { error: argument is of length zero Error: loading failed Execution halted ERROR: loading failed
- removing ‘/home/public/myspace/jqzhou/R-4.2.0/library/BiocManager’
The downloaded source packages are in ‘/tmp/Rtmp69nVfA/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Warning message: In install.packages("BiocManager") : installation of package ‘BiocManager’ had non-zero exit status
Hi @zhoujiaqi704 Have you tried to connect directly to https://bioconductor.org/config.yaml ? Please check your firewall settings. Best regards, Marcel
@LiNk-NY It looks like under some circumstances, like here, .version_map_config_element() can actually return a character(0). Which then leads to the "argument is of length zero" error above.
This happens if the call to .version_map_get_online_config("https://bioconductor.org/config.yaml") succeeds (i.e. doesn't return an error) and the returned txt contains junk. The current implementation of .version_map_get_online() assumes that this cannot happen. But this seems to be what happened to the OP.
Maybe an additional check could be added right after the first call to .version_map_config_element()? E.g. something like this:
bioc_r_map <- .version_map_config_element(txt, "r_ver_for_bioc_ver")
if (!length(bioc_r_map))
return(.VERSION_MAP_SENTINEL)
bioc <- package_version(names(bioc_r_map))
r <- package_version(unname(bioc_r_map))
Thanks, H.
Hi @zhoujiaqi704 Have you tried to connect directly to https://bioconductor.org/config.yaml ? Please check your firewall settings. Best regards, Marcel
Thanks a lot! I cannot connect to the https://bioconductor.org/config.yaml, but can directly connect to the http://bioconductor.org/config.yaml. Maybe a problem between https and http.
But I tried changed my url.method, like: options(download.file.method = 'libcurl') and options(url.method='libcurl'), but it didn't work.
- I've checked the firewall settings on my service.
[jqzhou@localhost ~]$ systemctl status firewalld.service ● firewalld.service Loaded: masked (/dev/null; bad) Active: inactive (dead)
It seem like the firewall is inactive
Indeed, I'm freshman of it. So, I'm not full understand the mentioned issue about ".version_map_config_element()", should I modify the original code? Because when I run the code you mentioned in my R (version 4.2.0), it got an error about could not find function ".version_map_config_element()"
@zhoujiaqi704 That comment was directed to Marcel @LiNk-NY, the maintainer of the BiocManager package. It was not meant to solve your problem.
@zhoujiaqi704
Thanks a lot! I cannot connect to the https://bioconductor.org/config.yaml, but can directly connect to the http://bioconductor.org/config.yaml. Maybe a problem between https and http.
We have http fallbacks in case https does not work so that should not be a problem.
Consider changing your timeout option to 600 with options(timeout = 600).
The issue you describe seems to be related to your network connection and not the package.
Best, Marcel
I wonder if that fallback can be tested by @zhoujiaqi704 ? I installed BiocManager without the 'test load' step
install.packages("BiocManager", INSTALL_opts = "--no-test-load")
and have
> result <- BiocManager:::.version_map_get_online_config("https://bioconductor.org/config.yaml")
> length(result)
[1] 329
Thanks for suggestions by @LiNk-NY & @mtmorgan !
I think maybe something wrong with my service internet connection. Because I try to set the timeout option to 600, I got the same error.
I also tried:
install.packages("BiocManager", INSTALL_opts = "--no-test-load")
and
result <- BiocManager:::.version_map_get_online_config("http://bioconductor.org/config.yaml") length(result) [1] 2
I cannot connect the https, but when connected to the http, I only got the length 2.
Can you print out the value of result?
result <- BiocManager:::.version_map_get_online_config("http://bioconductor.org/config.yaml")
result
And can you also confirm that you get the same value of result if you use https://?
result <- BiocManager:::.version_map_get_online_config("https://bioconductor.org/config.yaml")
result
Hello @mtmorgan
The value of result for http was:
> result <- BiocManager:::.version_map_get_online_config("http://bioconductor.org/config.yaml")
> result
[1] "<html><head><script language=javascript>location='http://10.108.255.249/index_1.html?url='+document.location;</script></head></html>"
[2] ""
And for https:
> result <- BiocManager:::.version_map_get_online_config("https://bioconductor.org/config.yaml")
Warning message:
In file(con, "r") :
URL 'https://bioconductor.org/config.yaml': Timeout of 60 seconds was reached
> result
[1] "<html><head><script language=javascript>location='http://10.108.255.249/index_1.html?url='+document.location; </script></head></html>"
[2] ""
Hi @zhoujiaqi704 This seems to be a connectivity issue rather than an issue in the package. The changes in the referenced commit should make it more robust.
Do you have any other updates? If not, feel free to re-open.