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

Timeout issue from the settings in QGIS general properties #402

Open
tschmetzer opened this issue May 5, 2022 · 7 comments
Open

Timeout issue from the settings in QGIS general properties #402

tschmetzer opened this issue May 5, 2022 · 7 comments
Labels
bug An identified bug

Comments

@tschmetzer
Copy link

tschmetzer commented May 5, 2022

What is the bug?

Even though I set a timeout of 120 or even 900 seconds the operation is aborted after about 1 minute and I receive an error message as shown in the screenshot. This server timeout does not seem to be considered by QuickOSM. The server operator kumi.systems tested the request without any problems and confirmed their server should be able to process requests with timeouts of up to 24 hrs.
It seems like QucikOSM aborts the server connection after 1 minute without response from the interpreter.

This is my request:

[out:xml] [timeout:120];
(
    wr["amenity"="university"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="research_institute"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="social_facility"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="school"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="kindergarten"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="kindergarden"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="exhibition centre"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="student_accommodation"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="library"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="clinic"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="hospital"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="public_building"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="concert_hall"]( 48.88329,4.61158,53.39111,14.59051);
	wr["aeroway"="terminal"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="prison"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="theatre"]( 48.88329,4.61158,53.39111,14.59051);
    wr["amenity"="courthouse"]( 48.88329,4.61158,53.39111,14.59051);
    wr["building"="hangar"]( 48.88329,4.61158,53.39111,14.59051);
    wr["shop"="mall"]( 48.88329,4.61158,53.39111,14.59051);
//    wr[""=""]( 48.88329,4.61158,53.39111,14.59051);
    wr["landuse"="education"]( 48.88329,4.61158,53.39111,14.59051);
    wr["landuse"="commercial"]( 48.88329,4.61158,53.39111,14.59051);
    wr["landuse"="industrial"]( 48.88329,4.61158,53.39111,14.59051);
);

(._;>;);
out body;

image

The problem persists even if I reduce the keys to be checked to only one. Only when I reduce the bbox to a smaller area an output is successfully generated.

QGIS Messages panel:

2022-05-05T16:03:18     CRITICAL    OverpassAPI timeout, try again later or a smaller query.

QGIS QuickOSM Logs panel:

2022-05-05T16:02:18     INFO    Encoded URL: https://overpass.kumi.systems/api/interpreter?data=[out:xml] [timeout:120];%0A(%0A wr[%22amenity%22%3D%22university%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22research_institute%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22social_facility%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22school%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22kindergarten%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22kindergarden%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22exhibition centre%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22student_accommodation%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22library%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22clinic%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22hospital%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22public_building%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22concert_hall%22]( 48.88329,4.61158,53.39111,14.59051);%0A%09wr[%22aeroway%22%3D%22terminal%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22prison%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22theatre%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22amenity%22%3D%22courthouse%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22building%22%3D%22hangar%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22shop%22%3D%22mall%22]( 48.88329,4.61158,53.39111,14.59051);%0A// wr[%22%22%3D%22%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22landuse%22%3D%22education%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22landuse%22%3D%22commercial%22]( 48.88329,4.61158,53.39111,14.59051);%0A wr[%22landuse%22%3D%22industrial%22]( 48.88329,4.61158,53.39111,14.59051);%0A);%0A%0A(._;%3E;);%0Aout body;&info=QgisQuickOSMPlugin
2022-05-05T16:03:18     CRITICAL    Download failed: Operation canceled

Environment

  • QuickOSM version: 2.0.1
  • QGIS version: 3.22
  • OS: LInux
@tschmetzer tschmetzer added the bug An identified bug label May 5, 2022
@Gustry
Copy link
Member

Gustry commented May 5, 2022

I just copy/paste your query in my webbrowser (so not using QuickOSM), the server is aborting my request as well.

The URL is in your logs at 16:02:18.

Answer from the server :

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.57.1 74a55df1">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2022-05-05T13:37:15Z"/>

<remark> runtime error: Query timed out in "query" at line 3 after 121 seconds. </remark>

</osm>

So it's not linked to QuickOSM.

@Gustry Gustry added the feedbacks The bug is unclear and feedbacks are needed label May 5, 2022
@tschmetzer
Copy link
Author

Thanks for checking! So the http request times out after 120 s as defined wheras the QuickOSM error message is risen after 60 s.

@Gustry
Copy link
Member

Gustry commented May 5, 2022

The 60 seconds might come from your QGIS Settings -> Network -> First value ? Do you have 60000ms ? Try to increase ?

@tschmetzer
Copy link
Author

I changed it and there we go!

Is it possible to distinguish between a network timeout due to a presetting and a cancellation by the server (server timeout)?
In this case maybe a note like "Network timeout after xx s as defined in the application settings" instead of the misleading message "OverpassAPI timeout, try again later or a smaller query." could be more helpful to the user to find the root cause of the problem.

@Gustry
Copy link
Member

Gustry commented May 6, 2022

Indeed, a few improvements can be done :

  • check timeout in the query against the value in QGIS settings and raise a warning if the timeout is higher than the settings in QGIS
  • check if the value can be overridden per request, but I doubt in the QGIS API ...
  • Intercept better the "cancelled operation" raised by QGIS core about a timeout

@Gustry Gustry removed the feedbacks The bug is unclear and feedbacks are needed label May 6, 2022
@Gustry Gustry changed the title Large data requests time out with an error message way before data timeout Timeout issue from the settings in QGIS general properties Aug 20, 2022
@kannes
Copy link
Contributor

kannes commented Feb 12, 2023

I was just confused by this too. It would be really nice to raise a warning to the user if there is a mismatch.

check if the value can be overridden per request, but I doubt in the QGIS API ...

https://qgis.org/pyqgis/master/core/QgsNetworkAccessManager.html#qgis.core.QgsNetworkAccessManager.setTimeout might be worth a try, no idea if it overrides the global setting though.

@Gustry
Copy link
Member

Gustry commented Feb 13, 2023

Thanks for checking the API.

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

No branches or pull requests

3 participants