streetcomplete / StreetComplete

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

Crash on downloading MarkCompletedHighwayConstruction quest #1041

Closed westnordost closed 6 years ago

westnordost commented 6 years ago

cc @matkoniecz

de.westnordost.osmapi.common.errors.OsmBadUserInputException: Bad Request (400) - <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" lang="en"/>
  <title>OSM3S Response</title>
</head>
<body>

<p>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</p>
<p><strong style="color:#FF0000">Error</strong>: line 1: parse error: ';' expected - '-' found. </p>
<p><strong style="color:#FF0000">Error</strong>: line 1: parse error: Unexpected end of input. </p>
<p><strong style="color:#FF0000">Error</strong>: line 1: static error: Element "print" cannot be subelement of element "union". </p>

</body>
</html>

        at de.westnordost.osmapi.OsmApiErrorFactory.createError(OsmApiErrorFactory.java:37)
        at de.westnordost.osmapi.OsmConnection.handleResponseCode(OsmConnection.java:343)
        at de.westnordost.osmapi.OsmConnection.makeRequest(OsmConnection.java:189)
        at de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao.get(OverpassMapDataDao.java:60)
        at de.westnordost.streetcomplete.data.osm.download.OverpassMapDataDao.getAndHandleQuota(OverpassMapDataDao.java:84)
        at de.westnordost.streetcomplete.quests.construction.MarkCompletedHighwayConstruction.download(MarkCompletedHighwayConstruction.java:32)
        at de.westnordost.streetcomplete.data.osm.download.OsmQuestDownload.download(OsmQuestDownload.java:76)
        at de.westnordost.streetcomplete.data.download.QuestDownload.downloadQuestTypes(QuestDownload.java:200)
        at de.westnordost.streetcomplete.data.download.QuestDownload.download(QuestDownload.java:124)
        at de.westnordost.streetcomplete.data.download.QuestDownloadService$ServiceHandler.handleMessage(QuestDownloadService.java:185)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:211)
        at android.os.HandlerThread.run(HandlerThread.java:61)
matkoniecz commented 6 years ago

I will look into it, hopefully today.

I can reproduce it, apparently overpass changed accepted syntax without backward compatibility.

So every single query in this quest will show "crash happened".

I am not sure what is your policy in that cases - but hotfix that simply disables that quest may be a good idea.

I am currently traveling and I will have access to a laptop in about 5 hours. Unfortunately I am also preparing for the next trip - so I will maybe make PR with fix from 5 to 20 hours from now and then I will be inactive until at least 4th May.-M

matkoniecz commented 6 years ago

Note - building construction quest is also likely to be affected, but it has lower priority so it will not appear often.

westnordost commented 6 years ago

I aim to release an update tomorrow, with a fix for it (and the other reported bugs). If you are not able to finish it until then, you can post your findings or other info here and I will look into it.

Am 30. April 2018 14:01:38 MESZ schrieb Mateusz Konieczny notifications@github.com:

I will look into it, hopefully today.

I can reproduce it, apparently overpass changed accepted syntax without backward compatibility.

So every single query in this quest will show "crash happened".

I am not sure what is your policy in that cases - but hotfix that simply disables that worst may be a good idea.

I am currently traveling and I will have access to a laptop in about 5 hours. Unfortunately I am also preparing for the next trip - so I will maybe make PR with fix from 5 to 20 hours from now and then I will be inactive until at least 4th May.

matkoniecz commented 6 years ago

https://wiki.openstreetmap.org/wiki/Overpass_API/versions#Overpass_API_v0.7.54 has history of versions. To my surprise it is not indicating recent updates.

LivInTheLookingGlass commented 6 years ago

I only see the error with the building quest enabled, but that may be because there are no construction roads in my area.

HolgerJeromin commented 6 years ago

The query feature on osm.org was not working, too

Ah, there is an fixed item: https://github.com/openstreetmap/openstreetmap-website/issues/1843

westnordost commented 6 years ago

So, shall I take a look?

mmd-osm commented 6 years ago

The issue is probably in this line:

https://github.com/westnordost/StreetComplete/blob/9a09d9519c6ee56cc7dc04d0cbaa2cb6d88dd3fe/app/src/main/java/de/westnordost/streetcomplete/quests/construction/MarkCompletedConstruction.java#L61

It needs to be changed to:

.construction_with_unknown_state; - .recently_edited_construction;

(two semicolons added)

I don't know how the full query really looks like, I can just try to derive it from the Java source code. So watch out for those semicolons!

BTW: This syntax was always documented this way on the wiki (https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#Difference), but those semicolons weren't really enforced in the past.

westnordost commented 6 years ago

That was it, thank you @mmd-osm ! It works now with this fix.

By the way, for your information, the full query looks like this

way[highway=construction](if:!is_date(t['opening_date']) || date(t['opening_date'])<date('2018-05-01T00:00:00Z')) -> .construction_with_unknown_state;
(
  way[highway=construction](newer: '2018-04-17T00:00:00Z');
  relation[highway=construction](newer: '2018-04-17T00:00:00Z');
) -> .recently_edited_construction;
(.construction_with_unknown_state; - .recently_edited_construction;) -> .roads_for_review;
.roads_for_review out meta geom;

I also checked for the other quests if they may have the same problem, but all others are fine.

LivInTheLookingGlass commented 6 years ago

So after the 5.1 update, I dont see any quests that actually show up for these, despite there being a half dozen buildings under construction tagged as such. Example

matkoniecz commented 6 years ago

@gappleto97 Please, link using rather https://www.openstreetmap.org/#map=19/46.55960/-87.41665 (it is easier to enable data layer and at least map on OsmAnd website is broken)

matkoniecz commented 6 years ago

Or even better - can you link a specific object like https://www.openstreetmap.org/way/525479646#map=19/46.55961/-87.41652 ? I looked quickly and nothing was building=construction.

ENT8R commented 6 years ago

I looked quickly and nothing was building=construction.

But this one is: https://www.openstreetmap.org/way/525479657

matkoniecz commented 6 years ago

I just tested, this quest appears for me

Are you sure that you have building construction quest enabled and that you never selected "hide this quest" for this building?

Can you try moving building construction quest to top in quest priority in settings and scan for more quests?

LivInTheLookingGlass commented 6 years ago

Gah. I moved it to the top priority and it showed up, even though there were no quests around it which should have hidden it. I am confused, but it works.