microg / IchnaeaNlpBackend

Backend for UnifiedNlp that uses Mozilla Location Service for geolocation.
116 stars 28 forks source link

Exceptions in log #13

Closed RalfJung closed 8 years ago

RalfJung commented 8 years ago

I am seeing these errors in the log. Doesn't look all correct to me...

W/IchnaeaBackendService( 1929): Error: {"error":{"code":404,"message":"Not found","errors":[{"domain":"geolocation","message":"Not found","reason":"notFound"}]}}
W/IchnaeaBackendService( 1929): java.io.FileNotFoundException: https://location.services.mozilla.com/v1/geolocate?key=068ab754-c06b-473d-a1e5-60e7b1a2eb77
W/IchnaeaBackendService( 1929):         at com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:206)
W/IchnaeaBackendService( 1929):         at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
W/IchnaeaBackendService( 1929):         at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
W/IchnaeaBackendService( 1929):         at org.microg.nlp.backend.ichnaea.BackendService$1.run(BackendService.java:141)
W/IchnaeaBackendService( 1929):         at java.lang.Thread.run(Thread.java:818)
mar-v-in commented 8 years ago

Logging the exception is not necassary here (as the server error message is already shown), but it also does not harm.

The message is shown in the rare case that mozilla has no idea where you are. Run MozStumbler where this happened to avoid it next time :smile:

RalfJung commented 8 years ago

:lol: 404 Not Found for geolocation? ;-)

The message appeared in the log very ~5-10 seconds. If every occurrence correspond to my phone talking with the Mozilla server, I'm happy I disabled that backend - that sounds like way too much background traffic to be battery friendly...

mar-v-in commented 8 years ago

404: yes, according to https://mozilla.github.io/ichnaea/api/geolocate.html#response

The actual request interval is defined by the requesting application. The backend contains a fixed minimum interval of 5 seconds, which is the same as the original Google location provider. I created an issue to allow the user to define his own upper limit (#14), but this should be fixed in the application requesting the location (as it will affect all users, not only those using this backend).