<div dir="ltr"><div><div>Update: Apparently, if I update the layer permissions in the web interface or if i run `geonode updatelayers -f <layer_name>`, the correct GeoFence permissions are created. Thus, doing so a layer at a time works. But several layers at once, no. <br><br>What should I look for in the GeoServer log to try to figure out where the problem is occurring? I can attach the GeoServer log if that helps.<br><br></div>Cheers<br></div>Daniel<br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 5, 2018 at 9:52 AM Daniel Victoria <<a href="mailto:daniel.victoria@gmail.com">daniel.victoria@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi list,<br><br></div>I have GeoNode 2.6.3, installed from apt, in a Ubuntu machine. Right now i have 108 registered layers, some imported using the web interface, some using the `geonode importlayers` command.<br><br></div>Last week I noticed that some of the layers I was importing using the management command had view permission problems. I realized that the cause was that the GeoFence rules were not being created correctly. <br><br></div>Looking at the messages on the list, I saw that there were some 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></div>I applied the patch and downloaded the `sync_geofence` command.<br><br></div>Now, every time I run `geonode updatelayers` I end up with a different set of rules in GeoFence. Some times with 106 rules, some times with 209 rules 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><div><div><br></div><div>Any idea how to fix this issue so I don't have to manually create the GeoFence rules? And also, not have `geonode updatelayers` mess up the rules already created?<br><br></div><div>Cheers<br></div><div>Daniel<br></div><div><br>[1] - <a href="https://github.com/GeoNode/geonode/commit/94b3b6abfd1bc856be94eb58f5bf13" target="_blank">https://github.com/GeoNode/geonode/commit/94b3b6abfd1bc856be94eb58f5bf13</a><br></div></div></div></blockquote></div>