GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.44k stars 1.12k forks source link

Stores with Spaces in the name cause problems #303

Closed smaranh closed 11 years ago

smaranh commented 12 years ago

smaranh@ignatius:~$ geonode updatelayers Inspecting the available layers in GeoServer ... Traceback (most recent call last): File "/var/lib/geonode/bin/django-admin.py", line 5, in management.execute_from_command_line() File "/var/lib/geonode/local/lib/python2.7/site-packages/django/core/management/init.py", line 429, in execute_from_command_line utility.execute() File "/var/lib/geonode/local/lib/python2.7/site-packages/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/var/lib/geonode/local/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(_args, _options.dict) File "/var/lib/geonode/local/lib/python2.7/site-packages/django/core/management/base.py", line 218, in execute output = self.handle(_args, _options) File "/var/lib/geonode/src/GeoNodePy/geonode/maps/management/commands/updatelayers.py", line 21, in handle output = Layer.objects.slurp(ignore_errors, verbosity) File "/var/lib/geonode/src/GeoNodePy/geonode/maps/models.py", line 607, in slurp resources = cat.get_resources() File "/var/lib/geonode/src/gsconfig.py/src/geoserver/catalog.py", line 353, in get_resources resources.extend(self.get_resources(workspace=ws)) File "/var/lib/geonode/src/gsconfig.py/src/geoserver/catalog.py", line 349, in get_resources resources.extend(self.get_resources(store)) File "/var/lib/geonode/src/gsconfig.py/src/geoserver/catalog.py", line 345, in get_resources return store.get_resources() File "/var/lib/geonode/src/gsconfig.py/src/geoserver/store.py", line 46, in get_resources xml = self.catalog.get_xml(res_url) File "/var/lib/geonode/src/gsconfig.py/src/geoserver/catalog.py", line 120, in get_xml raise FailedRequestError("Tried to make a GET request to %s but got a %d status code: \n%s" % (url, response.status, content)) geoserver.catalog.FailedRequestError: Tried to make a GET request to http://ignatius.iplantcollaborative.org/geoserver/rest/workspaces/geonode/datastores/Davis Species/featuretypes.xml but got a 404 status code: No such datastore: geonode,Davis

drwelby commented 12 years ago

What was the original data that was uploaded?

smaranh commented 12 years ago

Hi Marc,

It was a shapefile, with the name Davis Species.

Thanks, Smaran Harihar On Jun 23, 2012 2:19 PM, "Marc Pfister" < reply@reply.github.com> wrote:

What was the original data that was uploaded?


Reply to this email directly or view it on GitHub: https://github.com/GeoNode/geonode/issues/303#issuecomment-6528406

drwelby commented 12 years ago

What version of GeoNode? I just tried uploading a shapefile with a space in the name (TM BORDERS.shp) and during the upload process the space seemed to be escaped with an underscore. Did that happen in you layer url and SLD?

What do you get if you request http://ignatius.iplantcollaborative.org/geoserver/rest/workspaces/geonode/datastores.xml?

smaranh commented 12 years ago

Oh, the shapefile name was davis_species but in the Geoserver, when you create a new Data Source you add the shapefile and then you are asked to enter the Datasoure Name which is above the Description text box. Over there I entered Davis Species.

My Geonode Version is 1.1

Thanks, Smaran Harihar On Jun 23, 2012 2:42 PM, "Marc Pfister" < reply@reply.github.com> wrote:

What version of GeoNode? I just tried uploading a shapefile with a space in the name (TM BORDERS.shp) and during the upload process the space seemed to be escaped with an underscore. Did that happen in you layer url and SLD?


Reply to this email directly or view it on GitHub: https://github.com/GeoNode/geonode/issues/303#issuecomment-6528578

drwelby commented 12 years ago

So the shapefile was loaded through GeoServer, not GeoNode? And then you're running updatelayers to sync it up to GeoNode? Am I following your workflow correctly?

smaranh commented 12 years ago

Yes that is true. The error that I have given appears when I run the command,

geonode updatelayers

On Sat, Jun 23, 2012 at 3:51 PM, Marc Pfister < reply@reply.github.com

wrote:

So the shapefile was loaded through GeoServer, not GeoNode? And then you're running updatelayers to sync it up to GeoNode? Am I following your workflow correctly?


Reply to this email directly or view it on GitHub: https://github.com/GeoNode/geonode/issues/303#issuecomment-6528995

Thanks & Regards, Smaran Harihar

drwelby commented 12 years ago

It's a problem in gsconfig, see:

https://github.com/dwins/gsconfig.py/pull/26

There's two fixes there.

smaranh commented 12 years ago

if i install Geonode 1.2 would this patch be auto installed?

On Sat, Jun 23, 2012 at 4:32 PM, Marc Pfister < reply@reply.github.com

wrote:

It's a problem in gsconfig, see:

https://github.com/dwins/gsconfig.py/pull/26

There's two fixes there.


Reply to this email directly or view it on GitHub: https://github.com/GeoNode/geonode/issues/303#issuecomment-6529227

Thanks & Regards, Smaran Harihar

drwelby commented 12 years ago

No, it won't be included until a fix is pulled into gsconfig and then that is merged into GeoNode.

smaranh commented 12 years ago

ok, I am new to Git so could you give me the commands for the pull and then merging it with the gsconfig?

On Sat, Jun 23, 2012 at 4:41 PM, Marc Pfister < reply@reply.github.com

wrote:

No, it won't be included until a fix is pulled into gsconfig and then that is merged into GeoNode.


Reply to this email directly or view it on GitHub: https://github.com/GeoNode/geonode/issues/303#issuecomment-6529266

Thanks & Regards, Smaran Harihar

drwelby commented 12 years ago

The pull has to be done by the project owners. I'd just patch the file for now, it's a two-line fix.

smaranh commented 12 years ago

Ok thanks Marc

On Sat, Jun 23, 2012 at 5:08 PM, Marc Pfister < reply@reply.github.com

wrote:

The pull has to be done by the project owners. I'd just patch the file for now, it's a two-line fix.


Reply to this email directly or view it on GitHub: https://github.com/GeoNode/geonode/issues/303#issuecomment-6529381

Thanks & Regards, Smaran Harihar

vdeparday commented 12 years ago

I had this issue too. It is also an issue with Geoserver layer name that contains spaces as it is using the same get_xml function in catalog.py I am using Geonode 1.2Beta1 Is there some testing needed or can the fix be pulled for the 1.2 release?

jj0hns0n commented 12 years ago

Is this fixed now with the latest gsconfig release?

dwins commented 12 years ago

Should be. Someone still needs to update the dependency on master and kick the tires.

jj0hns0n commented 12 years ago

Doesnt appear to be working. Im using gsconfig 0.6. I have a shapefile named Zip Codes.shp (with a space). I can configure the store/layer in GeoServer. If I let it, GeoServer will convert the space to a %20 in the layer name, so it comes out as Zip%20Codes. If I do an updatelayers with it left that way, It gets converted to a layer in GeoNode that also has the %20 in it, but when trying to visit the layer info page, I get a 404 for that layer.

If I override GeoServers attempt to rename the layer, and make it "Zip Codes" with the space, and then do an updatelayers, GeoNode seems to still rename the layer to Zip%20Codes, and I can get to the layer info page now, but the layer does not render, and if I try to get get the legend graphic, I get the error below. Strangely enough, I AM able to get data from the WFS (GeoJSON etc), but not the WMS at all.

java.lang.NullPointerException null

On Fri, Jul 27, 2012 at 11:13 AM, David Winslow < reply@reply.github.com

wrote:

Should be. Someone still needs to update the dependency on master and kick the tires.


Reply to this email directly or view it on GitHub: https://github.com/GeoNode/geonode/issues/303#issuecomment-7312202

ingenieroariel commented 12 years ago

This can be downgraded as it has an easy workaround (rename the layer in the geoserver admin) and it is for people who are using the geoserver admin anyways (since they use updatelayers to configure them).

simod commented 11 years ago

Is this still a bug?

ingenieroariel commented 11 years ago

This was fixed in gsconfig and is not a problem anymore.