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

Warning Issue: Error in handle_api_response(resp, TRUE) : -> DHS API Request Failed [500] -> Error Type: dhs_internal_server_error #129

Open
bpatenaude opened this issue Apr 26, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@bpatenaude
Copy link

Hello, I am getting the following error whenever I try to get a dataset (it worked yesterday and has worked for months prior so there seems to be something new going on the DHS side, perhaps? My whole team is getting the same error no matter what dataset we try to download:

get_datasets() (with any dataset we have in our account) produces:

Error in handle_api_response(resp, TRUE) :
-> DHS API Request Failed [500]
-> Error Type: dhs_internal_server_error

I have re-downloaded the package using:
devtools::install_github("ropensci/rdhs")

which didn't solve the problem.

Here is my Session Info, if helpful:

setting value
version R version 4.0.3 (2020-10-10)
os macOS Big Sur 10.16
system x86_64, darwin17.0
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/New_York
date 2022-04-26

@jeffeaton
Copy link
Collaborator

Thanks very much for flagging this. I reproduced this error just now:

> get_datasets("MWIR71FL.zip")
Error in handle_api_response(resp, TRUE) : 
   -> DHS API Request Failed [500] 
   -> Error Type: dhs_internal_server_error

I traced it to the call to dhs_surveys() API endpoint failing in the internal function available_datasets().

> dhs_surveys()
Error in handle_api_response(resp, TRUE) : 
   -> DHS API Request Failed [500] 
   -> Error Type: dhs_internal_server_error

That API endpoint is here: https://api.dhsprogram.com/rest/dhs/surveys. I get the same error when I try to browse to it via web browser:

image

Hopefully the API will be resolved in the next day or so.

@jeffeaton
Copy link
Collaborator

Hi @bpatenaude,

I've just checked this again and it looks to me that the API is back up again. Is it working for you again?

@OJWatson -- one thought I had while debugging this. Would it be easy for rdhs:::handle_api_response() to print the URL of the API call if it fails?

Thanks,
Jeff

@verhulsta
Copy link

Hi @jeffeaton,

I contacted DHS this week and showed them your message. They fixed it immediatly.

Thanks,

Andrea

@OJWatson OJWatson self-assigned this May 9, 2022
@OJWatson OJWatson added the enhancement New feature or request label May 9, 2022
@OJWatson OJWatson closed this as completed Oct 9, 2023
@OJWatson OJWatson reopened this Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants