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

'nomis_data_info' function times out #13

Open
ralphlsmith opened this issue Jan 14, 2019 · 8 comments
Open

'nomis_data_info' function times out #13

ralphlsmith opened this issue Jan 14, 2019 · 8 comments

Comments

@ralphlsmith
Copy link

Hi I am getting the following error when trying to use nomisr at work (Birmingham City Council)

datasets <- nomis_data_info()
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached: Connection timed out after 10000 milliseconds

My code works OK at home on my own MacBook.

Our outsourced ICT help is of little use (they dont know anything about R, and are unwilling to find out) so I was hoping you may have a clue as to how I can get this fixed?

cheers

Ralph

@evanodell
Copy link
Collaborator

What's the result of sessionInfo()?

It might be an issue with your internet, is there any throttling or firewalls or things like that? If you're on wifi, try running from a ethernet cable if that's available.

Do other 'nomisr' functions work?

@ralphlsmith
Copy link
Author

ralphlsmith commented Jan 14, 2019 via email

@evanodell
Copy link
Collaborator

What's the result of httr::GET("https://www.nomisweb.co.uk/api/v01/dataset/def.sdmx.json")?

It should look something like:

httr::GET("https://www.nomisweb.co.uk/api/v01/dataset/def.sdmx.json")
Response [https://www.nomisweb.co.uk/api/v01/dataset/def.sdmx.json]
  Date: 2019-01-14 12:32
  Status: 200
  Content-Type: application/json; charset=utf-8
  Size: 4.49 MB
{
"structure" :{
"header" :{
"id" :"none",
"prepared" :"2019-01-14T12:31:48Z",
"sender" :{
"contact" :{
"email" :"support@nomisweb.co.uk",
"name" :"Nomis",
"telephone" :"+441913342680",
...

@ralphlsmith
Copy link
Author

ralphlsmith commented Jan 14, 2019 via email

@evanodell
Copy link
Collaborator

Do other data API packages work in R?

Try:

req <- curl_fetch_memory("https://www.birmingham.gov.uk/info/20018/adult_social_care")
str(req)

If this errors, then the issue is with curl. I am not very familiar with Windows 7, but I don't believe that it comes with curl built in. You may need to install curl from here: https://curl.haxx.se/windows/

@ralphlsmith
Copy link
Author

ralphlsmith commented Jan 14, 2019 via email

@evanodell
Copy link
Collaborator

Ok, let me know if they find a solution, I'm glad to hear that it's otherwise useful for you.

@cderv
Copy link

cderv commented Jan 14, 2019

@ralphlsmith As it does not work at inside your company network but work at home, I suspect it comes from proxy you may be behing. Do you know about a proxy ? Can you ask IT for that ?
You can try this to find if there is a proxy

curl::ie_get_proxy_for_url()

If you have one, you need to get the url and credentials to pass through.
You then need to configure it using httr::use_proxy() in a httr::set_config call.
I made a WIP 📦 to help that you may try and find useful. README has some info about proxy;

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

3 participants