Skip to content
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 with dataverse::get_file #58

Closed
andybega opened this issue May 6, 2020 · 2 comments
Closed

404 error with dataverse::get_file #58

andybega opened this issue May 6, 2020 · 2 comments

Comments

@andybega
Copy link
Owner

andybega commented May 6, 2020

E.g.:

library(icews)
f <- dataverse::get_file(file = 3819674, dataset = get_doi()[["historic"]])
Error in dataverse::get_file(file = file_ref, dataset = get_doi()[[repo]],  : 
  Not Found (HTTP 404).

But when I run the contained code manually it works.

file = 3819674
key = Sys.getenv("DATAVERSE_KEY")
server = Sys.getenv("DATAVERSE_SERVER")
u <- paste0(dataverse:::api_url(server), "access/datafile/", file)
r <- httr::GET(u, httr::add_headers(`X-Dataverse-key` = key))
httr::stop_for_status(r)
f <- httr::content(r, as = "raw"))
@andybega
Copy link
Owner Author

andybega commented May 6, 2020

I think the problem is with the query list that gets tacked in in get_file().

@andybega
Copy link
Owner Author

andybega commented May 8, 2020

Duplicate issue. This is already covered in 51.

@andybega andybega closed this as completed May 8, 2020
andybega added a commit that referenced this issue May 8, 2020
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant