Skip to content

Timeout issue from the settings in QGIS general properties #402

Open

Description

@tschmetzer

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

Activity

  1. added
    bug
    on May 5, 2022
  2. Gustry commented on May 5, 2022

    @Gustry
    Collaborator

    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.

  3. added
    feedbacks
    on May 5, 2022
  4. tschmetzer commented on May 5, 2022

    @tschmetzer
    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.

  5. Gustry commented on May 5, 2022

    @Gustry
    Collaborator

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

  6. tschmetzer commented on May 6, 2022

    @tschmetzer
    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.

  7. Gustry commented on May 6, 2022

    @Gustry
    Collaborator

    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
  8. removed
    feedbacks
    on May 6, 2022
  9. 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[/+] on Aug 20, 2022
  10. kannes commented on Feb 12, 2023

    @kannes
    Contributor

    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.

  11. Gustry commented on Feb 13, 2023

    @Gustry
    Collaborator

    Thanks for checking the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions