sensebox / opensensmapR

R client for opensensemap.org
https://noerw.github.io/opensensmapR/inst/doc/osem-history
8 stars 5 forks source link

Unexpected EOF #3

Closed noerw closed 7 years ago

noerw commented 7 years ago

for large requests (~1 MB and up) httr fails with

Unexpected EOF

Unshure whether this is a problem with the R implementation of curl, my (unstable) internetconnection, or if the API returns garbage..

noerw commented 7 years ago

I tested with curl with an url generated by httr, which returns the same error:

curl https://api.opensensemap.org/boxes/data\?phenomenon\=PM2.5\&bbox\=10.2956021659057%2C50.4463457692711%2C15.5111978340943%2C55.5775562902376\&from-date\=2017-07-23T14%3A18%3A35Z\&to-date\=2017-08-23T14%3A18%3A35Z\&columns\=value%2CcreatedAt%2Clon%2Clat%2CsensorId%2Cunit

sometimes results in:

...
2.70,2017-07-29T15:29:00.145Z,13.437056,52.460469,590b8480dd09cc0011aa79ce,µg/m³
2.40,2017-07-29T15:26:30.738Z,13.437056,52.460469,590b8480dd09cc0011aa79ce,µg/m³
curl: (56) Unexpected EOF                   
2.83,2017-07-29T15:24:01.358Z,13.437056,52.460469,590b8480dd09cc001%                    

This doesn't occur always and not at the same place in the response..

@ubergesundheit can you reproduce?

ubergesundheit commented 7 years ago

Yes, seems to be the api running into a timeout it seems.

After running

time curl "https://api.opensensemap.org/boxes/data?phenomenon=PM2.5&bbox=10.2956021659057,50.4463457692711,15.5111978340943,55.5775562902376&from-date=2017-07-23T14:18:35Z&to-date=2017-08-23T14:18:35Z&columns=value,createdAt,lon,lat,sensorId,unit" > /dev/null

multiple times, it seems the api just closes the connection after 10 seconds.

I will investigate where the timeout can be configured

ubergesundheit commented 7 years ago

Should work now.