GeoNode / QGISGeoNodePlugin

A QGIS plugin that provides integration with GeoNode
https://geonode.org/QGISGeoNodePlugin/
GNU General Public License v3.0
11 stars 10 forks source link

KeyError: 'url' during layer upload to GeoNode #263

Open jkariscodes opened 11 months ago

jkariscodes commented 11 months ago

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.

vanecat commented 11 months ago

I second that issue! on MacOS

idheitmann commented 11 months ago

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.

pchevali commented 8 months ago

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.

pchevali commented 8 months ago

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.

abrahamphar1 commented 7 months ago

how can fix it this error?

pchevali commented 7 months ago

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\

vanecat commented 7 months ago

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/