-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Error in updatelayers when no default style selected #869
Comments
The same error occurs if the default style is in a namespace (although this is more of an issue with gsconfig.py I think which should needs to query all workspaces for styles I guess) |
Hi, thanks for pointing this out, I have noticed this as well (I think there is already an issue mentioning this). |
@capooti this should be closed by the work on styles you did some time ago right? |
@simod no, I think this is a different problem. Cannot figure out, though, under which circumstances a layer in GeoServer does not have a default style. |
As suggested by @matthewhanson the problem raises when a layer has a style that has been assigned to a workspace. Moving the style out of the workspace fix the problems. |
There is some work in gsconfig that @volaya is workign on ... we should verify these fixes in a new gsconfig release. |
I made a new gsconfig release. This is ready to be tested again. |
I just tested this with updatelayers against an OpenGeo Suite 3.1 GeoServer containing >100 layers and styles with and without workspaces. Not a single error during updatelayers so far. |
this is related to #1212, we need to figure out why sometimes the default style is not assigned. |
Bumping this to critical as the default style ends up generating other kinds of errors and should be dealt with before releasing. |
@ingenieroariel let's do some more tests but I think that this is solved by our work on local connections between geonode and geoserver. |
I tried deleting the style on a GeoServer layer and it automatically got a new default style based on the GeoServer built in ones instead of an empty value. Since I am not sure how to replicate I will remove the 2.0 milestone, but @simod it would be great if you can verify we are not doing the wrong thing by punting this instead of letting it be a blocker. |
@ingenieroariel I tried it after the geoserver connections rework and I was not able to reproduce it anymore. Thanks |
Closing as it has not been reproduced. |
Hi, |
If a layer has no default style specified in GeoServer, the following error occurs when running updatelayers.
(geonode)behaim:geonode ortelius$ python manage.py updatelayers
Stopping process because --ignore-errors was not set and an error was found.
Traceback (most recent call last):
File "manage.py", line 28, in
execute_from_command_line(sys.argv)
File "/Users/ortelius/.virtualenvs/geonode/lib/python2.7/site-packages/django/core/management/init.py", line 443, in execute_from_command_line
utility.execute()
File "/Users/ortelius/.virtualenvs/geonode/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/ortelius/.virtualenvs/geonode/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(_args, *_options.dict)
File "/Users/ortelius/.virtualenvs/geonode/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(_args, *_options)
File "/Users/ortelius/projects/geonode-dev/geonode/geonode/layers/management/commands/updatelayers.py", line 57, in handle
owner=owner, console=console, workspace=workspace)
File "/Users/ortelius/projects/geonode-dev/geonode/geonode/geoserver/helpers.py", line 269, in gs_slurp
layer.save()
File "/Users/ortelius/.virtualenvs/geonode/lib/python2.7/site-packages/django/db/models/base.py", line 463, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/Users/ortelius/.virtualenvs/geonode/lib/python2.7/site-packages/django/db/models/base.py", line 565, in save_base
created=(not record_exists), raw=raw, using=using)
File "/Users/ortelius/.virtualenvs/geonode/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/Users/ortelius/projects/geonode-dev/geonode/geonode/layers/models.py", line 550, in geoserver_post_save
set_styles(instance, gs_catalog)
File "/Users/ortelius/projects/geonode-dev/geonode/geonode/layers/models.py", line 557, in set_styles
layer.default_style = save_style(default_style)
File "/Users/ortelius/projects/geonode-dev/geonode/geonode/layers/models.py", line 568, in save_style
style, created = Style.objects.get_or_create(name = gs_style.sld_name)
Exception: ('Failed to process test', AttributeError("'NoneType' object has no attribute 'sld_name'",))
The text was updated successfully, but these errors were encountered: