-
Notifications
You must be signed in to change notification settings - Fork 19
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
bad error for gateway time out #339
Comments
Thanks for reporting this, I can adjust the function so that when this type of non-JSON HTML error response is received the error is properly trapped rather than passed on for parsing. Unfortunately its really common for total failures of APIs like this to regress to a non-JSON response, hence the lexical error. Normal error messages issued by a functioning API are already handled.
Unfortunately there is no complete alternative to the REST API endpoint. Please contact ISRIC as they are the ones responsible for the endpoint (and the response when it fails) From the SoilGrids FAQ https://www.isric.org/explore/soilgrids/faq-soilgrids
It is not clear at this time whether the above notice is indicating that the REST API has moved (or will move). A couple years ago the API was accessible via soilgrids.org and they changed to the current rest.isric.org URL. There have been significant periods of downtime in past years, not much anyone but ISRIC can do about it. Note also that there is a "Fair Use" limit of ~5 requests per minute... but this 504 error is unrelated to that. The entire rest.isric.org site appears to return the same 504 error. I will provide an option in In the meantime you could consider using the |
Thanks again for reporting, after 0a7cc90 I get: library(soilDB)
your.points <- data.frame(id = c("A", "B"),
lat = c(37.9, 38.1),
lon = c(-120.3, -121.5),
stringsAsFactors = FALSE)
x <- fetchSoilGrids(your.points, verbose=TRUE)
#> Error : lexical error: invalid char in json text.
#> <html> <head><title>504 Gatewa
#> (right here) ------^
#>
#> Error : lexical error: invalid char in json text.
#> <html> <head><title>504 Gatewa
#> (right here) ------^
#>
#> Error : SoilGrids API is not accessible
inherits(x, 'try-error')
#> [1] TRUE |
Cool! Thanks for adding that and for the detailed response! |
For fetchSoilGrids(), I'm getting the following error when the URL https://rest.isric.org/soilgrids/v2.0/properties/ can't be accessed which could be replaced with a better error message about the URL not working.
Error: lexical error: invalid char in json text.
<title>504 Gatewa
(right here) ------^
Is there a backup for when this website is down?
The text was updated successfully, but these errors were encountered: