GeoNode/QGISGeoNodePlugin

KeyError: 'url' during layer upload to GeoNode

Opened this issue · 7 comments

Uploading of the layer from QGIS is successful, however, an error is thrown showing KeyError: 'url' as shown below.

Windows

image

MacOS

image

Tested on Windows 11 and MacOS with similar outcomes.

I second that issue! on MacOS

While the layer I uploaded is supposedly now present in the datasets it does not display properly and it won't add to a map.

It seems that the new geonode importer architecture has broken this plugin. The "url" key is not present anymore, only an "execution_id" is here instead, but changing this key doesn't solve the problem.

Well I had another issue with my SLD file, once this solved and after removing the reference to the "url" key it works fine. However due to the async importer architecture, we might need to poll the uploads result and check the status before returning.

how can fix it this error?

As a quick fix you can use a notepad to open the file the plugin directory ( QGIS directory depends if you are on windows or linux or mac).
The file to open is in qgis_geonode/apiclient/geonode_v3.py, go to line 329 and comment the line with a '#'
Then on the line 330, assign 1 to the value of dataset_pk ( just to make it an int), and comment the rest of the line:

#catalogue_url = deserialized["url"]
dataset_pk = 1 #catalogue_url.rsplit("/")[-1]

It worked for me, as a quick fix, although, the upload success might not be true as we should check for the result matching the execution_id on the api.

The plugin directory is :
Linux /home/[username]/.local/share/QGIS/QGIS3/profiles/default/python/plugins/
Windows c:\Users[username\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\

Thank you! I am trying the work-around, but without luck.
By the way for MacOS my path to the QGIS plugins directory is
/Users//Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins/