-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 error at download attempt #51
Comments
This is a simpler example: This should download one of the documentation PDFs: library("icews")
#> Options not set, consider running 'setup_icews()'
#> data_dir: NULL
#> use_db: NULL
#> keep_files: NULL
dataverse::get_file(2711073, dataset = get_doi()$historic)
#> Error in dataverse::get_file(2711073, dataset = get_doi()$historic): Not Found (HTTP 404). Created on 2020-01-06 by the reprex package (v0.3.0) |
Looks like the problem is with either the R dataverse client or the dataverse API itself. The direct URL for the PDF file above is https://dataverse.harvard.edu/api/access/datafile/2711073, and it works. However, in This is the essential bit from the library("dataverse")
library("httr")
key <- Sys.getenv("DATAVERSE_KEY")
u <- "https://dataverse.harvard.edu/api/access/datafile/2711073"
query <- list(format = "original")
r <- httr::GET(u, httr::add_headers(`X-Dataverse-key` = key))
# works
status_code(r)
#> [1] 200
# with format argument it does not work
r <- httr::GET(u, httr::add_headers(`X-Dataverse-key` = key), query = query)
status_code(r)
#> [1] 404 Created on 2020-01-06 by the reprex package (v0.3.0) This looks like a relevant issue in the R dataverse client repo: IQSS/dataverse-client-r#33 |
Hi, I have the same issue.
|
Here is a workaround and a blueprint for a fix:
as per IQSS/dataverse-client-r#33 (comment) Hope it helps! Cheers |
Hey @mayeulk, thanks! This works for me now as well: devtools::install_github("IQSS/dataverse-client-r")
# restart R
library("icews")
library("dataverse")
Sys.setenv("DATAVERSE_SERVER" = "dataverse.harvard.edu")
# works now
foo = dataverse::get_file(2711073, dataset = get_doi()$historic) I will keep this issue open until dataverse is updated on CRAN.
ICEWS has stopped updating. I heard they managed to regain funding but I have no idea when they will resume. |
- The manual fix for the get_file issue (#51, #58) breaks R check. Don't do that. - Instead, I added check to .onLoad that produces a warning if the dataverse version is below the one that has the get_file fix not on CRAN yet. This should prevent a repeat of me re-discovering this issue (closes #58) - also check to make sure the DATAVERSE_SERVER environment variable is set
The text was updated successfully, but these errors were encountered: