Hello,
Since I upgraded from Portal for ArcGIS 11.0 to Portal for ArcGIS 11.1, I can no longer share items with the groups I own... I guess it's a regression as it used to work with 11.0.
I debug a little bit and noticed the following: if you own more than 29 groups configured with "isViewOnly" set to True (Who can contribute content ? => Group owner and managers"), I can no longer share.
Indeed, to retrieve the list of groups that can be shared with, it makes a POST to:
/sharing/rest/community/groups
with the following 'q' parameter:
q: (isviewonly:false OR 0108318c3d144cf5be12837022f7049c OR 0171609ba0ba480fa2cfb40a9a70635f OR 0934e513266d4ddb80e342cd658937bf OR 0c4a52980b94405ca7ac853fd938ca31 OR 15620fa67eac4973818f7789653b66b4 OR ... OR fce1af7d980144999b28c968c4439232)
If you have less than 30 groups, request works if you have 30 or more, it returns:
{"total":0,"start":0,"num":0,"nextStart":0,"results":[]}
At Portal for ArcGIS 11.0, this request was made differently as the groups were not specified in 'q' parameter but the user was specified:
q: (owner:myusername OR isviewonly:false)
Could you please help ?
Thanks,
Nicolas
Solved! Go to Solution.
KaitlynPurcell thank you for the update, that is great news.
Apologies for the rant. I had just upgraded a rather large customer to 11.1 and this was one of the first things they found when testing.
Nice ! Many thanks for the great follow-up @MarleyGeddes .
Indeed, you are right. I can both share and unshare with this workflow.
Will be able to survive with these workarounds while waiting for the fix.
Thanks !
@MarleyGeddes What's the best way for this community to elevate the priority of an esri software bug such as this one?
BUG-000158232: In ArcGIS Enterprise Portal, sharing items with groups does not work, when owning more than 29 groups with 'isViewOnly' property set to True.
@BillFox - thanks for commenting.
The development team is aware of and looking into BUG-000158232. I highly recommend that those running into this issue at 11.1 and that have Esri Support available, call support to be added to BUG-000158232.
@NicolasGIS - do you have the ability to edit this post title to mention the viewOnly aspect to this issue? For example "Portal for ArcGIS 11.1: can no longer share items with groups when user owns or manages over 30 view only groups".
This update may help others running into this find this post.
Hmm, thanks for pursuing this @NicolasGIS - @MarleyGeddes , do you (or anyone else @BillFox ) know if sharing items to groups through the ArcGIS Api for Python or, in the case of feature layer writes and overwrites via sddraft + sd files via the ArcPy sharing module is impacted at 11.1 - or is it just through the Content or item details pages?
For example, using the api I update sharing all the time:
try:
portItems = gis.content.search(query="owner:myusername_portal", item_type="Feature Layer", sort_field="title", sort_order="asc", max_items=5000)
for portItem in portItems:
if (portItem.title == "CPBoundary"):
portFL = FeatureLayerCollection.fromitem(portItem)
print (portItem.title)
portFL.manager.update_definition(updateDict)
#portItem.update(item_properties=itemProperties) #,data=None, thumbnail=None, metadata=None)
portItem.share(everyone=False,org=False,groups="mylonggroupid")
print(portFL.properties)
message = message + "\n" + "1. " + (portItem.title) + " Sync Enabled: " + str(portFL.properties.syncEnabled)
except Exception:
# If an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()[2]
e = sys.exc_info()[1]
print(e.args[0])
print ("Line %i" % tb.tb_lineno)
message = message + "\n" + "Line %i" % tb.tb_lineno
message = message + "\n" + str(e)
or use the sharing module for overwrites:
try:
portal = arcpy.SignInToPortal("https://host.org.net/portal", "myusername_portal", "mypassword")
aprx = arcpy.mp.ArcGISProject('C:/ArcProProjects3x/PortalUpdates/PortalUpdates.aprx')
for m in aprx.listMaps("Facility Layers"):
print("Map: " + m.name)
for lyr in m.listLayers():
if lyr.name == 'CurrentCodeViolationPoint':
lyrList = []
lyrList.append(m.listLayers(lyr.name)[0])
print(lyr.name)
stageSDDraft(m, lyr.name, "The Code Violation Point layer contains various types of property, building, zoning, resource protection and other code compliance issues for . . .",
lyrList,"The Code Violation Point layer contains various types of property, building, zoning, resource protection and other code compliance issues for. . . ",
"ServiceSafetyLayers","Planning,Services","FacilitySafety")
print(lyr.name + " Draft Created")
arcpy.StageService_server('C:/ArcProProjects3x/PortalUpdates/FacilitySafety/' + lyr.name + '.sddraft', 'C:/ArcProProjects3x/PortalUpdates/FacilitySafety/' + lyr.name + '.sd')
print(lyr.name + " Service Staged")
arcpy.UploadServiceDefinition_server('C:/ArcProProjects3x/PortalUpdates/FacilitySafety/' + lyr.name + '.sd', 'My Hosted Services', "","","","","","OVERRIDE_DEFINITION","SHARE_ONLINE","PRIVATE",
"NO_SHARE_ORGANIZATION","MyGroup") #Code Enforcement and Planning Group
print(lyr.name + " Service Uploaded")
message = message + "\n" + "2. " + (lyr.name) + " Service Uploaded"
except Exception:
# if an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()[2]
e = sys.exc_info()[1]
print(e.args[0])
print ("Line %i" % tb.tb_lineno)
message = message + "\n" + "Line %i" % tb.tb_lineno
message = message + "\n" + str(e)#e.message
I can't test this because I'm not at 11.1 yet obviously....
@DavidColey - the development team is looking into BUG-000158232 now. However, it does appear that this is an issue in the frontend only when attempting to share items through the Enterprise portal. I do not expect sharing through the ArcGIS Api for Python or through the sharing api to be impacted.
Ok thanks for the feedback on this @MarleyGeddes - I plan to keep an eye on this and other issues as well through the next week or so . . .
Happy to report that there are no issues sharing items with groups via that pro arcpy sharing module or via the arcgis api for python item.share method. I too show 'no groups to share with' via the items' page.
I may move ownership of some groups from my portal admin login to the portal admin account, depending how long this goes
Actually, turns out I was wrong on this for BUG-000158232. When I try to share an existing item via the api to a group that I own, nothing happens.
So this:
try:
portItems = gis.content.search(query="owner:myusername_portal", item_type="Feature Layer", sort_field="title", sort_order="asc", max_items=5000)
for portItem in portItems:
if (portItem.title == "CPBoundary"):
portFL = FeatureLayerCollection.fromitem(portItem)
print (portItem.title)
portFL.manager.update_definition(updateDict)
#portItem.update(item_properties=itemProperties) #,data=None, thumbnail=None, metadata=None)
portItem.share(everyone=False,org=False,groups="mylonggroupid")
print(portFL.properties)
message = message + "\n" + "1. " + (portItem.title) + " Sync Enabled: " + str(portFL.properties.syncEnabled)
except Exception:
# If an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()[2]
e = sys.exc_info()[1]
print(e.args[0])
print ("Line %i" % tb.tb_lineno)
message = message + "\n" + "Line %i" % tb.tb_lineno
message = message + "\n" + str(e)
works fine in AGOL, but as I own more than 29 groups in our Portal as the portal admin, nothing happens. For the share method params 'everyone' and 'org', the api works for Portal . . . but not for the groups param.
It would be super-helpful if we could get this addressed as a patch at this release. Like everyone, we have few hundred or more layers to move around and having to go into each group whenever I need to re-share an item gets to be cumbersome.
Changing group owner to another admin account for say a subset of our existing groups and then making my admin account a 'Group Manager' on any owner-changed accounts would maybe a work-around, but with so many of my groups participating in distributed collaborations that is tricky and risky . . .
Has the BUG-000158232 been fixed?. Putting on hold the upgrade for this bug and the web-adaptor App Pool freezing up: ArcGIS Web Adaptor 11.1 App Pool freezes
Thanks for any info in regards to this.