I'm not sure why this would happen, but apparently some layer ended up in GeoNode and GeoServer and it didn't have a default style. I didn't upload the layer so I'm not sure if there were issues when it was uploaded. Will come back and update this with more information. This is version 1.2 btw.
It's triggered by calling layer.delete() on a Geonode layer that for which it's GeoServer layer doesn't have a default style. I could submit a pull request for this, but I'm not sure how to do this against the 1.2 release?
Traceback (most recent call last):
File "", line 1, in
File "/var/lib/geonode/local/lib/python2.7/site-packages/django/db/models/base.py", line 576, in delete
collector.delete()
File "/var/lib/geonode/local/lib/python2.7/site-packages/django/db/models/deletion.py", line 61, in decorated
func(self, _args, *_kwargs)
File "/var/lib/geonode/local/lib/python2.7/site-packages/django/db/models/deletion.py", line 239, in delete
sender=model, instance=obj, using=self.using
File "/var/lib/geonode/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/var/lib/geonode/src/GeoNodePy/geonode/maps/models.py", line 1625, in delete_layer
instance.delete_from_geoserver()
File "/var/lib/geonode/src/GeoNodePy/geonode/maps/models.py", line 961, in delete_from_geoserver
cascading_delete(Layer.objects.gs_catalog, self.resource)
File "/var/lib/geonode/src/GeoNodePy/geonode/maps/gs_helpers.py", line 148, in cascading_delete
styles = lyr.styles #+ [lyr.default_style]
File "/var/lib/geonode/local/lib/python2.7/site-packages/geoserver/layer.py", line 89, in _get_default_style
name = self.dom.find("defaultStyle/name").text
AttributeError: 'NoneType' object has no attribute 'text'
Let's try to reproduce in 2.0
I cannot reproduce this, I think we can close it safely.
Steps I did to reproduce the problem (please check if I am understanding correctly the problem):
- upload a layer with GN
- go to the GS and remove the default style created for the uploaded layer
- go to GN and remove the layer
- the layer is correctly removed from GS and GN database