streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.87k stars 353 forks source link

Automatically select other overpass server on non-temporary connection issue (i.e. ip block) #1523

Closed matkoniecz closed 3 years ago

matkoniecz commented 5 years ago

I tried implementing it as part of #1438 but turned out more complicated that expected.

I still think that it is worth doing and I plan to try doing it again.

This way new user in Russia will be more likely to get app in state that works.

westnordost commented 5 years ago

I prefer to not add too many hardcoded twirls in the app to bypass something that should better be solved at its source. Obviously, overpass-api.de being blocked was a mistake. Maybe it is possible to notify/appeal to the authorities about this. But then again, that should be done by a Russian.

matkoniecz commented 5 years ago

In case of Russia I would not consider this as a viable solution. Even in case of less corrupt countries I would consider such "it should be fixed upstream" as not viable.

I have my own experience (missing "except bicycles" under turn restriction signs making contraflow useless, see images) with persuading government to fix blatantly broken stuff, and even with government that is local and more sympathetic than hostile it is tricky. Even things as simple as "this traffic sign makes no sense" are quite hard to actually fix.

This particular mass block managed to take out far more important services and apparently it stayed in place. Though attempts to widen block stopped after they apparently blocked "pretty much everything but Telegram" and idea of Deep Packet Inspection was dropped as it would do the same.

And for an upstream fix - maybe it is doable on the Overpass API side? I am not sure is https://github.com/mmd-osm/Overpass-API a good place to report such operation issues.

westnordost commented 5 years ago

How would the maintainer of overpass-api.de be able to do anything about it?

westnordost commented 5 years ago

Anyway, regarding the ticket here, what I find more viable than a hardcoded message for the Russians, is to automatically select another download server from the alternatives. This behaviour is then country-agnostic. No need to follow the sad world-affairs of governments curtailing the rights of their citizens and build one exception after the next, the app will just try to do what it can automatically, and that's that.

matkoniecz commented 5 years ago

How would the maintainer of overpass-api.de be able to do anything about it?

Switch to Amazon IP range not affected by this block (not sure is it possible to do this). Add proxy server, not blocked by Russian government (this one is likely to complicated)?

automatically select another download server from the alternatives

I though about this, and I considered doing it automatically in case of connection failure. It may cause spurious changes, with connection failing because wifi is terrible rather than because government is terrible. But it also should similarly randomly switch back.

Main negative effect is that for some time users would be using service of lower quality than main overpass instance - not sure about current status but some time ago their databases had significant lag in updating.

"switch to alternative in Russia" would still require maintaining censorship index.

mmd-osm commented 5 years ago

I am not sure is https://github.com/mmd-osm/Overpass-API a good place to report such operation issues.

Definitely not, please contact Roland for any production issues.

Switch to Amazon IP range not affected by this block (not sure is it possible to do this).

Overpass-api.de is hosted by Hetzner. Switching to an "Amazon IP" range is not feasible.

Add proxy server, not blocked by Russian government (this one is likely to complicated)?

Due to rate limiting, additional changes to the Overpass code base as well as trusted proxy configuration would be required.

By the way, //overpass.openstreetmap.ru/cgi/ is back again since a few weeks! Just use that instance instead.

not sure about current status but some time ago their databases had significant lag in updating.

That's the reason why you should always analyse the contents in <meta osm_base="...">and reject any data that is too old.

matkoniecz commented 5 years ago

Overpass-api.de is hosted by Hetzner. Switching to an "Amazon IP" range is not feasible.

Whops, I somehow was sure that they were affected by part of block targeting Amazon. In that case - maybe they can switch to Hetzner IP not affected by block?

By the way, //overpass.openstreetmap.ru/cgi/ is back again since a few weeks! Just use that instance instead.

That would be great!

That's the reason why you should always analyse the contents in and reject any data that is too old.

I think that it is not done currently, I opened #1530 - thanks for the info!

westnordost commented 5 years ago

In some cases Overpass instance may return very old data, in some cases database lag may reach months or years.

So, a too old response should be treated the same as if the overpass server is (currently) not available and another be selected.

westnordost commented 3 years ago

This is obsolete now, overpass is not used anymore.