Bioconductor / AnnotationHub

Client for the Bioconductor AnnotationHub web resource
15 stars 12 forks source link

R Cannot connect to AnnotationHub server #43

Closed gxt13111560461 closed 10 months ago

gxt13111560461 commented 10 months ago

BiocManager::version() [1] ‘3.17’ packageVersion("AnnotationHub") [1] ‘3.8.0’ hub <- AnnotationHub::AnnotationHub() Cannot connect to AnnotationHub server, using 'localHub=TRUE' instead Using 'localHub=TRUE' If offline, please also see BiocManager vignette section on offline use Error in .updateHubDB(hub_bfc, .class, url, proxy, localHub) : Invalid Cache: sqlite file Hub has not been added to cache Run again with 'localHub=FALSE'

Who can help me? Thank you!

lshep commented 10 months ago

You need to have internet connection to run AnnotationHub. See also the troubleshooting section on "invalid cache" https://bioconductor.org/packages/3.17/bioc/vignettes/AnnotationHub/inst/doc/TroubleshootingTheCache.html#troubleshooting

gxt13111560461 commented 10 months ago

Hello, thank you for your answer. After a few days of trying, I can be sure that there is no problem with my network. It seems that the problem is that the installation package is not installed completely. However, after I manually uninstall and install successfully, I still get the error after trying again:

library(AnnotationHub) hub <- AnnotationHub() Cannot connect to AnnotationHub server, using 'localHub=TRUE' instead Using 'localHub=TRUE' If offline, please also see BiocManager vignette section on offline use Error in .updateHubDB(hub_bfc, .class, url, proxy, localHub) : Invalid Cache: sqlite file Hub has not been added to cache Run again with 'localHub=FALSE'

At 2023-08-21 20:11:53, "lshep" @.***> wrote:

You need to have internet connection to run AnnotationHub. See also the troubleshooting section on "invalid cache" https://bioconductor.org/packages/3.17/bioc/vignettes/AnnotationHub/inst/doc/TroubleshootingTheCache.html#troubleshooting

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

gxt13111560461 commented 10 months ago

Hello, thank you for your answer. After a few days of trying, I can be sure that there is no problem with my network. It seems that the problem is that the installation package is not installed completely. However, after I manually uninstall and install successfully, I still get the error after trying again:

library(AnnotationHub) hub <- AnnotationHub() Cannot connect to AnnotationHub server, using 'localHub=TRUE' instead Using 'localHub=TRUE' If offline, please also see BiocManager vignette section on offline use Error in .updateHubDB(hub_bfc, .class, url, proxy, localHub) : Invalid Cache: sqlite file Hub has not been added to cache Run again with 'localHub=FALSE'

The problem seems to be on the file:splite file. After reading the guidance document, I still can't understand, can you help me?

You need to have internet connection to run AnnotationHub. See also the troubleshooting section on "invalid cache" https://bioconductor.org/packages/3.17/bioc/vignettes/AnnotationHub/inst/doc/TroubleshootingTheCache.html#troubleshooting

lshep commented 10 months ago

Are you online or behind a proxy?

gxt13111560461 commented 10 months ago

I am online. ---- Replied Message ---- | From | @.> | | Date | 08/24/2023 22:21 | | To | @.> | | Cc | gxt13111560461 @.>, Comment @.> | | Subject | Re: [Bioconductor/AnnotationHub] R Cannot connect to AnnotationHub server (Issue #43) |

Are you online or behind a proxy?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

lshep commented 10 months ago

Are you behind a proxy? If you are behind a proxy on your network there is new documentation on how to operate behind a proxy. I forgot to version bump when I updated documentation for behind a proxy if should be live in the vignette soon. The AnnotationHub uses CRAN package httr functions HEAD and GET for accessing web resources. This can be problematic if operating behind a proxy. The easiest solution is to set the httr::set_config with the proxy information.

proxy <- httr::use_proxy("http://my_user:my_password@myproxy:8080")
## or
proxy <- httr::use_proxy(Sys.getenv('http_proxy'))
httr::set_config(proxy)
AnnotationHub::setAnnotationHubOption("PROXY", proxy)

If you are not behind a proxy can you check the following

AnnotationHub::getAnnotationHubOption("LOCAL")

and see if you can access the AnnotationHub

hub=getAnnotationHubOption("URL")
readBin(hub, n=1L, what="raw")
gxt13111560461 commented 10 months ago

require(AnnotationHub) hub <- AnnotationHub() Cannot connect to AnnotationHub server, using 'localHub=TRUE' instead Using 'localHub=TRUE' If offline, please also see BiocManager vignette section on offline use Error in .updateHubDB(hub_bfc, .class, url, proxy, localHub) : Invalid Cache: sqlite file Hub has not been added to cache Run again with 'localHub=FALSE' proxy <- @.***:8080") proxy <- httr::use_proxy(Sys.getenv('http_proxy')) httr::set_config(proxy) AnnotationHub::setAnnotationHubOption("PROXY", proxy) AnnotationHub::getAnnotationHubOption("LOCAL") [1] FALSE hub <- AnnotationHub() Assuming valid proxy connection through ':1' If you experience connection issues consider using 'localHub=TRUE' |==============================================================| 100% snapshotDate(): 2023-04-24Oh! Thank you for your help! I successfully solved this problem! Thank you from the bottom of my heart! Hope you are doing well.

At 2023-08-24 22:41:05, "lshep" @.***> wrote:

Are you behind a proxy? If you are behind a proxy on your network there is new documentation on how to operate behind a proxy. I forgot to version bump when I updated documentation for behind a proxy if should be live in the vignette soon. The AnnotationHub uses CRAN package httr functions HEAD and GET for accessing web resources. This can be problematic if operating behind a proxy. The easiest solution is to set the httr::set_config with the proxy information.

proxy <- @.***:8080")

or

proxy <- httr::use_proxy(Sys.getenv('http_proxy')) httr::set_config(proxy) AnnotationHub::setAnnotationHubOption("PROXY", proxy)

If you are not behind a proxy can you check the following

AnnotationHub::getAnnotationHubOption("LOCAL")

and see if you can access the AnnotationHub

hub=getAnnotationHubOption("URL") readBin(hub, n=1L, what="raw")

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

lshep commented 10 months ago

Glad that worked. The documentation behind this should be more visible on the next push of the package. Sorry for the delay and inconvenience.

Wull1994 commented 8 months ago

Hello, thank you for your answer. After a few days of trying, I can be sure that there is no problem with my network. It seems that the problem is that the installation package is not installed completely. However, after I manually uninstall and install successfully, I still get the error after trying again:

library(AnnotationHub) hub <- AnnotationHub() Cannot connect to AnnotationHub server, using 'localHub=TRUE' instead Using 'localHub=TRUE' If offline, please also see BiocManager vignette section on offline use Error in .updateHubDB(hub_bfc, .class, url, proxy, localHub) : Invalid Cache: sqlite file Hub has not been added to cache Run again with 'localHub=FALSE'

The problem seems to be on the file:splite file. After reading the guidance document, I still can't understand, can you help me?

You need to have internet connection to run AnnotationHub. See also the troubleshooting section on "invalid cache" https://bioconductor.org/packages/3.17/bioc/vignettes/AnnotationHub/inst/doc/TroubleshootingTheCache.html#troubleshooting

You can try to use VPN. I have the same problem, but when the VPN was used, the problem was solved.

lshep commented 8 months ago

See previous post about setting the proxy or if not behind a proxy see if AnnotationHub is accessible: https://github.com/Bioconductor/AnnotationHub/issues/43#issuecomment-1691815665