Hi again,
as you might remember I'm currently using two phones for the work with StreetComplete (1x Android 5.1, 1x Android 9.0; roughly: the new one on my bikes, the old one on foot). For a long time the quest counter has been synchronized reliably between the two devices, but this stopped to do so a few weeks ago. Since then, both devices show different numbers whatever I do: Opening and closing the _Profile_ screen (which apparently forces the quests to get uploaded), stopping SC in the Android settings and restarting it. Each device counts up separately now.
Perhaps there are not many users who use more than one phone with SC, so most users won't ever notice that as their local counters keep counting upwards and don't need to be synchronised.
(SC 26.0, but this problem has been existing for some time now, so it hasn't been introduced with v26.0. Maybe with v25.1?)
The cycling cat
I also noticed the same (single phone, StreetComplete and private fork installed) but I assumed that it is related to changes made in fork (though none were synchronization related).
2020-11-07 00:40:10.459 1354-8223/de.westnordost.streetcomplete.debug
W/StatisticsUpdater: Unable to download statistics
java.io.IOException: 500 Internal Server Error:
at
de.westnordost.streetcomplete.data.user.StatisticsDownloader.download(StatisticsDownloader.kt:30)
at
de.westnordost.streetcomplete.data.user.StatisticsUpdater.updateFromBackend(StatisticsUpdater.kt:64)
at
de.westnordost.streetcomplete.data.user.UserController$updateStatistics$1.invokeSuspend(UserController.kt:74)
at
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at
kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
And this seems to be the error that occurs on the server side:
PHP Fatal error: Uncaught Error: Call to a member function fetch_row() on bool in statistics/classes/ReverseCountryGeocoder.class.php:33
Stack trace:
#0 statistics/classes/ChangesetAnalyzer.class.php(73): ReverseCountryGeocoder->getIsoCodes(151.1807755, -33.89642105)
#1 statistics/classes/ChangesetAnalyzer.class.php(33): ChangesetAnalyzer->getCountryCode(151.1807755, -33.89642105)
#2 statistics/classes/ChangesetsWalker.class.php(112): ChangesetAnalyzer->analyze(Object(Changeset))
#3 statistics/classes/ChangesetsWalker.class.php(75): ChangesetsWalker->analyzeChangesets(Array)
#4 statistics/get_statistics.php(35): ChangesetsWalker->a in statistics/classes/ReverseCountryGeocoder.class.php on line 33
So, the error occurs when running this SQL statement:
SELECT id FROM boundaries WHERE ST_Contains(shape, Point(151.1807755, -33.89642105))
And the error is:
Binary geometry function st_contains given two geometries of different srids: 3857 and 0, which should have been identical.
So the problem is that the shapes in boundaries are defined using the coordinate reference system EPSG-3857 (= WGS 84 / projection used by OpenStreetMap) while the given Point has a coordinate reference system of 0, which would be undefined / cartesian coordinates.
This used to work without problem, something in the environment on my webspace must have changed that this is not accepted anymore. Now, the point has to use the same reference system as the shape.
SELECT id FROM boundaries WHERE ST_Contains(shape, ST_GeomFromText('POINT(151.1807755 -33.89642105)', 3857))
Hm... synchronisation still doesn't work here. Do I have to do something special in order to make it work again? (I already did the same as mentioned in the original posting.)
The cycling cat
No. I can check for you, I need your OSM name or id
For me it also seems to not synchronizing (at least, there is no indicator of anything happening). uid=1722488, username Mateusz Konieczny
I think it is just slow currently and needs to catch up with the changeset analyzing. Who knows how long this error already persisted. From the code, it looks like re-sync was broken all along - only the first sync was correctly done. I made it so that re-sync should work again now
It should appear in the logs, search for StatisticsUpdater
Hi again,
meanwhile the synchronisation has happened on my devices and both show the same number.
The cycling cat
Synchronization also completed on my tests account (during running tests in an emulator).
Most helpful comment
So the problem is that the shapes in
boundariesare defined using the coordinate reference system EPSG-3857 (= WGS 84 / projection used by OpenStreetMap) while the given Point has a coordinate reference system of 0, which would be undefined / cartesian coordinates.This used to work without problem, something in the environment on my webspace must have changed that this is not accepted anymore. Now, the point has to use the same reference system as the shape.