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

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

Closed
jkariscodes opened this issue Jul 13, 2023 · 7 comments · Fixed by #289
Closed

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

jkariscodes opened this issue Jul 13, 2023 · 7 comments · Fixed by #289
Assignees
Milestone

Comments

@jkariscodes
Copy link

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
Copy link

vanecat commented Jul 18, 2023

I second that issue! on MacOS

@idheitmann
Copy link

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
Copy link

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
Copy link

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
Copy link

how can fix it this error?

@pchevali
Copy link

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
Copy link

vanecat commented Nov 18, 2023

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/

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

Successfully merging a pull request may close this issue.

7 participants