grimbough / biomaRt

R package providing query functionality to BioMart instances like Ensembl
https://bioconductor.org/packages/biomaRt/
32 stars 13 forks source link

Error in textConnection(BioMartVersion) : invalid 'text' argument #60

Open sigven opened 2 years ago

sigven commented 2 years ago

Hi,

Thanks for creating a very useful R package. I seem to be getting an error now, both using the BioConductor version (v2.50.3), as well as the version hosted on GitHub (v2.51.4)

When pulling in the human mart

mart <- biomaRt::useDataset(dataset = "hsapiens_gene_ensembl",         
                             mart    = useMart("ENSEMBL_MART_ENSEMBL",       
                                               host    = "https://www.ensembl.org"))  

I get the usual messages regarding unresponsive mirrors, but also an additional error message (see below). Got any idea on how to fix it?

Ensembl site unresponsive, trying uswest mirror
Ensembl site unresponsive, trying useast mirror
Error in textConnection(BioMartVersion) : invalid 'text' argument
In addition: Warning message:
In if (BioMartVersion == "\n" | BioMartVersion == "") { :
  the condition has length > 1 and only the first element will be used

kind regards, Sigve

themudo commented 5 months ago

Hi, I am having the same error in code that worked just a few months ago. Any clue what is going on? Is it connection issues with the ensembl website? Cheers, Gonçalo

themudo commented 5 months ago

I solved it by running: closeAllConnections()

grimbough commented 5 months ago

Yes, at the moment the Ensembl site seems to be very flaky. Visiting https://www.ensembl.org/biomart/martview/ I sometimes get the correct pages, sometimes a "this service is unavailable" page, and sometimes just a spinning wheel.

biomaRt is supposed to catch the ""this service is unavailable" page and give you a useful error message, however I've not been able to track down what's actually going wrong to generate the invalid 'text' argument error

dlaehnemann commented 5 months ago

I am also mostly getting this kind of error (and then sometimes useEnsembl() runs through and connects):

> mart <- biomaRt::useEnsembl(
  biomart = "genes",
  verbose = TRUE,
  dataset = "hsapiens_gene_ensembl",
  version = "111" 
) 
Checking attributes ...Attempting web service request:
https://www.ensembl.org:443/biomart/martservice?type=attributes&dataset=hsapiens_gene_ensembl&requestid=biomaRt&mart=ENSEMBL_MART_ENSEMBL&virtualSchema=default
Error in textConnection(text, encoding = "UTF-8") : 
  invalid 'text' argument

Also, any pointers to where we can track if this connectivity problem is being dealt with? Or recommendations where to raise this? This basically renders a lot of analyses, and especially standardized analysis workflows, unusable and generates a number of issues filed with differing error messages, simply because the Ensembl site is flaky...

dlaehnemann commented 5 months ago

BTW, in other instances I do get a more useful error message:

Error: Your query has been redirected to http://status.ensembl.org indicating this Ensembl service is currently unavailable.
Look at ?useEnsembl for details on how to try a mirror site.

Only the status webpage isn't helpful (beyond stating the fact that The Ensembl web service you requested is temporarily unavailable.). Should we just contact the HelpDesk, to get more info? Or is there some other Ensembl site, that gives updates with regard to if something is done and what exactly is happening?

dlaehnemann commented 5 months ago

And here's another error message I have now gotten, just in case this helps tracking down possibilities of where the queries break down:

Error in curl::curl_fetch_memory(url, handle = handle) : 
  Timeout was reached: [www.ensembl.org] Operation timed out after 60002 milliseconds with 0 bytes received
Calls: <Anonymous> ... request_fetch -> request_fetch.write_memory -> <Anonymous>