3liz / QuickOSM

QGIS plugin to fetch OSM data with the Overpass API
GNU General Public License v2.0
184 stars 55 forks source link

"Bad request OverpassAPI" #358

Open ismaelnnunez opened 2 years ago

ismaelnnunez commented 2 years ago

What is the bug?

When attempting to make a Quick Query, I get the error message:

Bad request OverpassAPI.

This happens no matter what kind of query I make. An example of one is:

[out:xml] [timeout:25];
 {{geocodeArea:White Plains, NY}} -> .area_0;
(
    node["building"](area.area_0);
    way["building"](area.area_0);
    relation["building"](area.area_0);
);
(._;>;);
out body;

I had an older version of QuickOSM installed before, and I got the same error, which is what prompted me to upgrade the plug-in. Having done that, I'm still getting the same issue.

Environment

Gustry commented 2 years ago

In the small comic strip bubble in the bottom right corner of QGIS, can you copy/paste all logs from the QuickOSM tab ?

ismaelnnunez commented 2 years ago

Thank you for getting back to me!

Running it today, I'm getting a different error actually. Here is the log:

2021-10-06T10:24:18     INFO    Request completed
2021-10-06T10:24:18     INFO    Encoded URL: https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3600174495) -%3E .area_0;%0A(%0A node[%22building%22](area.area_0);%0A way[%22building%22](area.area_0);%0A relation[%22building%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2021-10-06T10:25:18     CRITICAL    Download failed: Operation canceled

I haven't attempted increasing the timeout time, but before these problems arose, a query like this never took more than a few seconds, and I'm on a stable internet connection.

ismaelnnunez commented 2 years ago

Adding onto the previous comment, QuickOSM gives the following error message:

Overpass API : Download failed: Connection timed out

With the log:

2021-10-06T10:31:31     INFO    All OSM objects with the key 'building' in White Plains, NY are going to be downloaded.
2021-10-06T10:31:31     INFO    Query: building_White Plains, NY
2021-10-06T10:31:31     INFO    Request completed
2021-10-06T10:31:31     INFO    Encoded URL: https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3600174495) -%3E .area_0;%0A(%0A node[%22building%22](area.area_0);%0A way[%22building%22](area.area_0);%0A relation[%22building%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2021-10-06T10:32:13     CRITICAL    Download failed: Connection timed out
kannes commented 2 years ago

That sounds like a huge area to download data from, does it work if you restrict the query to a much smaller extent?

Try to set a higher timeout so that the API has time to get the data to you, see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#timeout: which you can set in QuickOSM too.

If you can, use data extracts for big general queries like that. Eg. http://download.geofabrik.de/north-america.html or via https://extract.bbbike.org/

ismaelnnunez commented 2 years ago

Before this issue appeared, I had extracted much larger data before with no problem. The White Plains, NY area doesn't have many features to pull from. Nevertheless, I chose a much smaller extent from which to pull "building" features from, and I got a different error this time. I also extended the timeout time to 60 instead of the default 25:

Overpass API : Download failed: Error transferring https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:60];%0A(%0A node[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A way[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A relation[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin - server replied: Gateway Timeout

And this is the log:

2021-10-07T12:50:03     INFO    Encoded URL: https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:60];%0A(%0A node[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A way[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A relation[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2021-10-07T12:50:20     CRITICAL    Download failed: Error transferring https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:60];%0A(%0A node[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A way[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A relation[%22building%22]( 40.56543,-74.41254,40.58295,-74.37735);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin - server replied: Gateway Timeout
kannes commented 2 years ago

Please try it even smaller with an even longer timeout value. Is there a firewall or proxy between you and the API server?

Gustry commented 2 years ago

I'm also experiencing issue, with very small query.

This query returns nothing :

https://lz4.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3602307203) -%3E .area_0;%0A(%0A node[%22shop%22%3D%22bakery%22](area.area_0);%0A way[%22shop%22%3D%22bakery%22](area.area_0);%0A relation[%22shop%22%3D%22bakery%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin

while this one works :

https://z.overpass-api.de/api/interpreter?data=[out:xml] [timeout:25];%0A area(3602307203) -%3E .area_0;%0A(%0A node[%22shop%22%3D%22bakery%22](area.area_0);%0A way[%22shop%22%3D%22bakery%22](area.area_0);%0A relation[%22shop%22%3D%22bakery%22](area.area_0);%0A);%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin

The only difference is lz4.overpass-api.de -> z.overpass-api.de. Can you change this settings ? (last tab in QuickOSM).

Gustry commented 2 years ago

I also saw it here as well : https://gis.stackexchange.com/questions/413264/quick-osm-is-giving-bad-request/413265#413265

ismaelnnunez commented 2 years ago

Changing lz4.overpass-api.de to z.overpass-api.de seems to have worked. Thank you so much for the help!

Gustry commented 2 years ago

We should keep the ticket open. It's an issue. It must be reported upstream on overpass and maybe change the default server in QuickOSM.

stephan75 commented 2 years ago

Maybe it is worth checking api status at https://wiki.openstreetmap.org/wiki/Overpass_API/status

Gustry commented 2 years ago

Thanks for the link @stephan75 So it seems the default server set in QuickOSM is having issues these days. I will add the link in the plugin.

NikoMolecule commented 3 weeks ago

Hello i experience the same problem, is there any way to resolve this problem?