Closed kylepip closed 10 months ago
I have a similar API error. I tested on 2 systems. The error occurs when trying to Run a query with the plugin.
Environment 1.
Environment 2.
An error has occurred while executing Python code:
QuickOSM.core.exceptions.NetWorkErrorException: Nominatim API : Download failed: Error transferring https://nominatim.qgis.org/search?q=Veszprém&format=json&info=QgisQuickOSMPlugin - server replied: Method Not Allowed
Traceback (most recent call last):
File "C:\Users/zed90/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QuickOSM\core\api\nominatim.py", line 48, in error
raise NetWorkErrorException('Nominatim API', ', '.join(messages))
QuickOSM.core.exceptions.NetWorkErrorException: Nominatim API : Download failed: Error transferring https://nominatim.qgis.org/search?q=Veszprém&format=json&info=QgisQuickOSMPlugin - server replied: Method Not Allowed
Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.32.1-Lima Lima, 4a078ecf63
Python Path:
C:/PROGRA~1/QGIS33~1.1/apps/qgis/./python
C:/Users/zed90/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/zed90/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS33~1.1/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS33~1.1\apps\grass\grass83\etc\python
C:\Users\zed90\Documents
C:\Program Files\QGIS 3.32.1\bin\python39.zip
C:\PROGRA~1\QGIS33~1.1\apps\Python39\DLLs
C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib
C:\Program Files\QGIS 3.32.1\bin
C:\PROGRA~1\QGIS33~1.1\apps\Python39
C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib\site-packages
C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib\site-packages\win32
C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS33~1.1\apps\Python39\lib\site-packages\Pythonwin
C:/Users/zed90/AppData/Roaming/QGIS/QGIS3\profiles\default/python
I can confirm the issue.
It seems the Nominatim server has been updated by rejecting POST requests.
➜ curl -X POST 'https://nominatim.qgis.org/search?q=montpellier&format=json&info=QgisQuickOSMPlugin'
{"title": "405 Method Not Allowed"}
➜ curl -X GET 'https://nominatim.qgis.org/search?q=montpellier&format=json&info=QgisQuickOSMPlugin'
[{"place_id":361351658,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"relation","osm_id":28722,"lat":"43.6112422","lon":"3.8767337","class":"boundary","type":"administrative","place_rank":16,"importance":0.6412041870185823,"addresstype":"city","name":"Montpellier","display_name":"Montpellier, Hérault, Occitanie, France métropolitaine, France","boundingbox":["43.5667083","43.6533580","3.8070597","3.9413208"]},{"place_id":298587617,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"relation","osm_id":7362050,"lat":"45.855586","lon":"-75.163651","class":"boundary","type":"administrative","place_rank":16,"importance":0.3738687964459321,"addresstype":"village","name":"Montpellier","display_name":"Montpellier, Papineau, Outaouais, Québec, Canada","boundingbox":["45.8140214","45.9735738","-75.3946681","-75.1189169"]},{"place_id":361351046,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright","osm_type":"relation","osm_id":1686656,"lat":"43.5577224","lon":"3.8753793538384635","class":"boundary","type":"administrative","place_rank":14,"importance":0.3380411950818732,"addresstype":"municipality","name":"Montpellier","display_name":"Montpellier, Hérault, Occitanie, France métropolitaine, France","boundingbox":["43.3023828","43.8129840","3.4928290","4.1946047"]}]
Like on osm.org, the plugin was doing a request, with the searched area in the URL as a query string, but using POST instead of GET (on osm.org)
OSM nominatim servers are now rejecting POST requests.
I will update the plugin
Thanks for the fast response @Gustry, confirmed this fixes the issue.
Thanks for the feedback. It was going to be quite a major issue for a lot of users :)
What is the bug?
Attempting to download anything using QuickOSM is failing, with the Python error window showing a reply from the nominatim api: "server replied: Method Not Allowed". The QuickOSM log is pasted below, showing an attempt to download the Dallas city boundary. -->
Environment