<div dir="ltr"><div><div><div><div><div>Hi Paolo,<br><br></div>Thanks for the tip. However, I installed GeoNode from the APT repository and I have no idea how to upgrade GeoNode or change GeoFence store from H2 to PostgreSQL.<br><br></div>I also added time.sleep(5) in sync_geofence.py, right before the try block but I'm still getting an error: It fails with the message:<br><br>('Unexpected error:', <type 'exceptions.AttributeError'>)<br>Traceback (most recent call last):<br>  File "/usr/bin/django-admin", line 21, in <module><br>    management.execute_from_command_line()<br>  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line<br>    utility.execute()<br>  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute<br>    self.fetch_command(subcommand).run_from_argv(self.argv)<br>  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv<br>    self.execute(*args, **cmd_options)<br>  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute<br>    output = self.handle(*args, **options)<br>  File "/usr/local/lib/python2.7/dist-packages/geonode/geoserver/management/commands/sync_geofence.py", line 60, in handle<br>    print 'perm_spec is %s' % perm_spec<br>UnboundLocalError: local variable 'perm_spec' referenced before assignment<br><br></div>Any other tips on how to fix this permission mess-up?<br><br></div>Thanks<br></div>Daniel<br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 5, 2018 at 12:13 PM Paolo Corti <<a href="mailto:pcorti@gmail.com">pcorti@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Another option could be to run a time.sleep for some seconds after<br>
each layer iteration in sync_geofence command<br>
cheers<br>
Paolo<br>
<br>
On Mon, Mar 5, 2018 at 10:04 AM, Paolo Corti <<a href="mailto:pcorti@gmail.com" target="_blank">pcorti@gmail.com</a>> wrote:<br>
> Hi Daniel<br>
><br>
> You seem to have hit this bug which I reported to GeoFence team in the past:<br>
> <a href="https://github.com/geoserver/geofence/issues/98" rel="noreferrer" target="_blank">https://github.com/geoserver/geofence/issues/98</a><br>
><br>
> I didn't notice this happening in latest GeoFence version, so<br>
> upgrading to latest GeoNode could be an option.<br>
> Or you could try to use PostgreSQL instead than H2 as a GeoFence store<br>
><br>
> hope this helps<br>
><br>
> cheers<br>
> Paolo<br>
><br>
> On Mon, Mar 5, 2018 at 9:19 AM, Daniel Victoria<br>
> <<a href="mailto:daniel.victoria@gmail.com" target="_blank">daniel.victoria@gmail.com</a>> wrote:<br>
>> Update: Apparently, if I update the layer permissions in the web interface<br>
>> or if i run `geonode updatelayers -f <layer_name>`, the correct GeoFence<br>
>> permissions are created. Thus, doing so a layer at a time works. But several<br>
>> layers at once, no.<br>
>><br>
>> What should I look for in the GeoServer log to try to figure out where the<br>
>> problem is occurring? I can attach the GeoServer log if that helps.<br>
>><br>
>> Cheers<br>
>> Daniel<br>
>><br>
>> On Mon, Mar 5, 2018 at 9:52 AM Daniel Victoria <<a href="mailto:daniel.victoria@gmail.com" target="_blank">daniel.victoria@gmail.com</a>><br>
>> wrote:<br>
>>><br>
>>> Hi list,<br>
>>><br>
>>> I have GeoNode 2.6.3, installed from apt, in a Ubuntu machine. Right now i<br>
>>> have 108 registered layers, some imported using the web interface, some<br>
>>> using the `geonode importlayers` command.<br>
>>><br>
>>> Last week I noticed that some of the layers I was importing using the<br>
>>> management command had view permission problems. I realized that the cause<br>
>>> was that the GeoFence rules were not being created correctly.<br>
>>><br>
>>> Looking at the messages on the list, I saw that there were some<br>
>>> discussions about this issue and that 1) there was a patch for<br>
>>> geoserver/helper.py [1] and 2) a new `sync_geofence` management command.<br>
>>><br>
>>> I applied the patch and downloaded the `sync_geofence` command.<br>
>>><br>
>>> Now, every time I run `geonode updatelayers` I end up with a different set<br>
>>> of rules in GeoFence. Some times with 106 rules, some times with 209 rules<br>
>>> etc. And I can't run `geonode sync_geofence` since I'm getting an error:<br>
>>><br>
>>> UnboundLocalError: local variable 'perm_spec' referenced before assignment<br>
>>><br>
>>> Any idea how to fix this issue so I don't have to manually create the<br>
>>> GeoFence rules? And also, not have `geonode updatelayers` mess up the rules<br>
>>> already created?<br>
>>><br>
>>> Cheers<br>
>>> Daniel<br>
>>><br>
>>> [1] -<br>
>>> <a href="https://github.com/GeoNode/geonode/commit/94b3b6abfd1bc856be94eb58f5bf13" rel="noreferrer" target="_blank">https://github.com/GeoNode/geonode/commit/94b3b6abfd1bc856be94eb58f5bf13</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> geonode-users mailing list<br>
>> <a href="mailto:geonode-users@lists.osgeo.org" target="_blank">geonode-users@lists.osgeo.org</a><br>
>> <a href="https://lists.osgeo.org/mailman/listinfo/geonode-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/geonode-users</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Paolo Corti<br>
> Geospatial software developer<br>
> web: <a href="http://www.paolocorti.net" rel="noreferrer" target="_blank">http://www.paolocorti.net</a><br>
> twitter: @capooti<br>
> skype: capooti<br>
<br>
<br>
<br>
--<br>
Paolo Corti<br>
Geospatial software developer<br>
web: <a href="http://www.paolocorti.net" rel="noreferrer" target="_blank">http://www.paolocorti.net</a><br>
twitter: @capooti<br>
skype: capooti<br>
</blockquote></div>