iDigBio / ridigbio

ridigbio -- an R interface to iDigBio's API (see http://www.idigbio.org/)
http://idigbio.github.io/ridigbio/
Other
16 stars 10 forks source link

idig_search HTTP 400 #48

Closed sagesteppe closed 6 months ago

sagesteppe commented 6 months ago

Hi all,

Receiving a 400 on the searches in the documentation below - not sure if this is just bad timing or you all are moving away from idig_search. This was occurring yesterday ca. 5 PM MST, and again now.

sessionInfo()

R version 4.3.2 (2023-10-31) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 22.04.4 LTS

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.20.so; LAPACK version 3.10.0

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

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

other attached packages: [1] ridigbio_0.3.8

ridigbio::idig_search_records(rq=list(genus="acer"), limit=10) # good !

ridigbio::idig_search(type="media", rq=list(genus="acer"), limit=10)

Error: HTTP failure: 400 Error message from API server: {"error":"Internal Server Error"}

ridigbio::idig_search(rq=list(genus="acer"), limit=10)

Error: HTTP failure: 400 Error message from API server: {"error":"Internal Server Error"}

ridigbio::idig_search_media(rq=list(genus="acer"), 
                            mq=list("data.ac:accessURI"=list("type"="exists")),
                            fields=c("uuid","data.ac:accessURI"), limit=10) # good 3/4 times

Not sure if this is ahead of CRAN, but I just ran a install_github() and issue persists.

jbennettufl commented 6 months ago

I looked into it and the cause of this problem seems to be originating from the IDigBio Search API itself and we are continuing to look at that right now. I'll update this issue when we have some more information for you, thanks.

jbennettufl commented 6 months ago

A PR has been committed to the IDigBio Search API and is now passing all tests on Travis CI so it has been deployed to the beta environment. The ridigbio dev mode can be toggled to "TRUE" here: https://github.com/iDigBio/ridigbio/blob/1171bea2193ee7e26a965d8c66584a4d0ae5408c/R/base.R#L8 The results are now all tests are passing for ridigbio against beta:

> library(ridigbio)
> devtools::test()
ℹ Testing ridigbio
✔ | F W S  OK | Context
✔ |         2 | test GET                                                                                                    
✔ |         3 | test POST                                                                                                   
✔ |         4 | test idig_build_attrib [2.5s]                                                                               
✔ |         7 | test idig_count_media                                                                                       
✔ |         5 | test idig_count_records                                                                                     
✔ |        18 | test idig_meta_fields                                                                                       
✔ |        15 | test idig_search_media [8.5s]                                                                               
✔ |        28 | test idig_search_records [7.2s]                                                                             
✔ |         7 | test idig_top_media                                                                                         
✔ |        10 | test idig_top_records                                                                                       
✔ |         8 | test idig_view_media                                                                                        
✔ |         8 | test idig_view_records                                                                                      

══ Results ═════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 20.1 s

[ FAIL 0 | WARN 0 | SKIP 0 | PASS 115 ]

I also tested the R language examples which were provided in this issue against beta and all of them returned results without any errors as well. This should get pushed to production soon.

mlluciano commented 6 months ago

Hi @sagesteppe

The fix is now available in production. Please let us know if you encounter any further issues, and thanks for using our API :)