Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on downloading MarkCompletedHighwayConstruction quest #1041

Closed
westnordost opened this issue Apr 30, 2018 · 15 comments
Closed

Crash on downloading MarkCompletedHighwayConstruction quest #1041

westnordost opened this issue Apr 30, 2018 · 15 comments
Assignees
Labels

Comments

@westnordost
Copy link
Member

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
Copy link
Member

matkoniecz commented Apr 30, 2018

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
Copy link
Member

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

@westnordost
Copy link
Member Author

westnordost commented Apr 30, 2018 via email

@matkoniecz
Copy link
Member

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
Copy link

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

@HolgerJeromin
Copy link
Contributor

HolgerJeromin commented May 1, 2018

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

Ah, there is an fixed item: openstreetmap/openstreetmap-website#1843

@westnordost
Copy link
Member Author

So, shall I take a look?

@mmd-osm
Copy link

mmd-osm commented May 1, 2018

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
Copy link
Member Author

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
Copy link

LivInTheLookingGlass commented May 7, 2018

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
Copy link
Member

@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
Copy link
Member

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
Copy link
Contributor

ENT8R commented May 7, 2018

I looked quickly and nothing was building=construction.

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

@matkoniecz
Copy link
Member

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants