Duplicate items in Portal after federating/setting hosted Server

2937
6
Jump to solution
03-22-2021 08:21 AM
by Anonymous User
Not applicable

This weekend I deployed Portal in our production environment, and noticed some behavior that I didn't see in our Development or Staging environments. After federating with Server and setting the Server as a hosting server, I now have duplicates of every item: 

Mary_GraceMcClellan2_0-1616426303817.png

This seems like a bug to me, but maybe there is a setting that I haven't checked? Has anyone else seen/resolved this issue? 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

I have resolved this issue, but it took some work. First, here's what I think I did wrong

1. Federated our Server site with Portal.

2. Made all items public in Portal. 

3. Set Server as hosting server. Encountered duplicate content issue described in this post. 

I believe the correct order of operations should be Federate > Set hosting Server > Make items public.

I made the items public immediately so I could minimize service downtime, without thinking about the downtime that would be incurred during the next step anyways. My current theory is that editing the sharing permissions of these items caused them to be duplicated once I set the server as the hosting server, which would be a bug or glitch of some kind but would explain the issue. (I'm open to being corrected, however!) 

 

Resolution: Remove duplicate items.

This was a little more difficult, because deleting a Portal item that is hosted on the hosting server will delete the entire service. On top of that, all of the duplicate items looked exactly the same on the surface, and there is no way to tell from Portal which items I could safely delete. I found that one item in the set was mutually dependent with the service and that one item (the one that was safe to delete) was a shell for the REST service. I used the portal item ID from the service properties to find out which of the two Portal items was interdependent with the service. 

The Portal item ID for an item can be found in the Server administrative directory by navigating to https://{your server URL}/admin/services/{folder}/{service name}.MapServer.  

Example:

Mary_GraceMcClellan2_0-1617024466271.png

I wrote a script using the REST API that pulled out all of these IDs and the service names, then got to work deleting the duplicate items in Portal. It took some time because we have around 200 services, but I thought it was more prudent to delete by hand rather than scripting it. After that, I marked all items as authoritative and delete-protected them. 

I hope this helps someone out there! 

View solution in original post

6 Replies
nita14
by
Occasional Contributor III

Hi,

Have you re-indexed the portal content?

BR,
Adam

by Anonymous User
Not applicable

Hi Adam - I should have mentioned that yes, I have re-indexed a few times since discovering the problem. 

0 Kudos
nita14
by
Occasional Contributor III

ok, great. Any relevant details in ArcGIS Portal logs folder? No issues with portal internal db?

Br,

Adam

0 Kudos
by Anonymous User
Not applicable

Unfortunately because I had so many trial and errors yesterday when setting up Portal, it's hard to tell if any of these messages are still relevant now that Portal is up and running: 

Mary_GraceMcClellan2_0-1616437990334.png

At any rate, the hosting server is now validated and the last messages I have are that the Index service, Database Server, and Web Server were all restarted and it's been several hours without a recurrence of the warning messages. 

0 Kudos
by Anonymous User
Not applicable

I have resolved this issue, but it took some work. First, here's what I think I did wrong

1. Federated our Server site with Portal.

2. Made all items public in Portal. 

3. Set Server as hosting server. Encountered duplicate content issue described in this post. 

I believe the correct order of operations should be Federate > Set hosting Server > Make items public.

I made the items public immediately so I could minimize service downtime, without thinking about the downtime that would be incurred during the next step anyways. My current theory is that editing the sharing permissions of these items caused them to be duplicated once I set the server as the hosting server, which would be a bug or glitch of some kind but would explain the issue. (I'm open to being corrected, however!) 

 

Resolution: Remove duplicate items.

This was a little more difficult, because deleting a Portal item that is hosted on the hosting server will delete the entire service. On top of that, all of the duplicate items looked exactly the same on the surface, and there is no way to tell from Portal which items I could safely delete. I found that one item in the set was mutually dependent with the service and that one item (the one that was safe to delete) was a shell for the REST service. I used the portal item ID from the service properties to find out which of the two Portal items was interdependent with the service. 

The Portal item ID for an item can be found in the Server administrative directory by navigating to https://{your server URL}/admin/services/{folder}/{service name}.MapServer.  

Example:

Mary_GraceMcClellan2_0-1617024466271.png

I wrote a script using the REST API that pulled out all of these IDs and the service names, then got to work deleting the duplicate items in Portal. It took some time because we have around 200 services, but I thought it was more prudent to delete by hand rather than scripting it. After that, I marked all items as authoritative and delete-protected them. 

I hope this helps someone out there! 

LindseyDanforth_Boulder
New Contributor II

I also had this issue of duplicates because I was impatient and didn't wait for the index to update after I federated a server and went to the AdminURL and ran the federation again. This resulted in duplicate items in Portal. However, for each set of duplicates, only one item was was the 'real' service and other was a pointer. The 'real' federated service would have an item ID in Portal with a matching ServiceItemID listed in the REST endpoint. The duplicates would have a separate item ID in Portal and the ServiceItemID would point to the other service.

LindseyDanforth_Boulder_1-1677873270985.png

 

 

Below is the code I used to clean it up....

LindseyDanforth_Boulder_0-1677873026748.png