Force Delete an Item in Portal for ArcGIS

16145
35
03-07-2016 09:35 AM
Jay_Gregory
Occasional Contributor III

I'm having problems deleting an item in Portal for ArcGIS.  It is delete protected so I can't delete using the UI.  I am unable to change the delete protection because the edit button is also disabled.  I used ArcGIS Online Assistant and tried to change the delete protection from there but the change from true to false wouldn't actually take.  It just kept reverting back.  I tried to find the xml or json file in the item ID folder on the Portal server itself, but I couldn't find the delete protection attribute.  I'm hesitant to just outright delete the item ID folder itself because I don't know if the item ID is registered anywhere else (a user's item list for instance).  Could anyone instruct me on a thorough way to force delete an item from Portal for ArcGIS?

35 Replies
ZacharyHart
Regular Contributor

I've been having similar problems. What I've learned is that removing the service from (a federated) server does not remove it from portal. You must remove it from both locations. Not the easiest workflow but oh well.

The exact error I get in Portal is:

Unable to reach the server where the service is. Consider using calling deleteItem with options = { 'force' : true } if the server won't be available anymore.

I found i was able to delete the items using the REST API as found in this thread here. So you're not really having to format the syntax, you're working with the Portal's rest interface.

For example, if you navigate to:

https://portalname/portal/sharing/rest/content/users/<username>/  you can see all the content and their IDs. you can then click on the ID title and then simply use the 'Delete Item' interface with the 'Force Deletion' option checked on.

This works in a more interactive way IMO although not being able to delete via Portal is clunky at best.

On a side note: this interface still isn't letting me delete orphaned items. I need to connect with my IT provider to get access to the location of the portal content directory to try to do this manually (this is an azure deployment so config and storage locations are not a simple file explorer procedure).

Let us know if that helps.

DrewCover
New Contributor III

Ill go through all these threads and retry Zachary.  Thanks for the help, I will update

DrewCover
New Contributor III

Success!  But in a round about way.

So I hooked up with my REST API.  I was able to navigate to the folder and orphan item, then try the deleteitems command with my orphan ID in the box.  Its takes me to a blank page in the API with only one 'rest API' link that takes me to the esri documentation, dead end.  But very nice to access content this way.

Next, I went back to my Portal Content page where the orphan Item was located, clicked the checkbox, then the 'change owner' option.  Moved the owner to a different portal user, then was successful deleting the item through the REST API under that user name.  (maybe it would've worked through Portal Content also) 

Clean Portal!

0 Kudos
DrewCover
New Contributor III

Sorry previous reply was for online assisstant.  I tried the REST API method Simon, I think I have my urls correct, error snip below: The webadaptor is named 'Portal', The old webadaptor the item references is 'PortalWA'

0 Kudos
ClintonBallandis1
Occasional Contributor

Hi Drew,

I've got a similar issue that you we're experiencing  where I've orphaned Portal Items that point to and old webadaptor address. I can't delete them as them as the item details never loads as it is looking for a URL that no longer exists. If I use the rest to try and delete I get the message Item does not exist or is inaccessible. Can you let me know the work flow you used to remove these items?

0 Kudos
DrewCover
New Contributor III

Hi Clinton,

 I went back to my Portal Content page where the orphan Item was located, clicked its select checkbox, then used the 'change owner' option.  I moved the item owner to a different portal username, (which I think forces an update to WA url the new owner is under) then was successful deleting the item through the REST API under that user name.  (maybe the delete would've worked through Portal Content also) 

 

Clean Portal!  Yaaaay!  Hopefully works for you

0 Kudos
RoberthSanchez
New Contributor III

First check if the item is a hosted layer or a item which is hosted with ArcGIS Data Store, if is a hosted item then you need to put your federated server as hosting server and then try to delete the item, one important thing when you federate a server and try to remove a item from arcgis server manager is that it should  be removed from portal too, if that doest not happen then you have a problem with your federate process, check that the dns used in your web adaptor config and the federation config is correct.

ZacharyHart
Regular Contributor

@Roberth Sanchez

None of the items I am trying to delete are hosted in feature layers. I cannot remove any orphaned items Portal even with the site administrator in the portal content interface and using force delete.

However, you are the first person to suggest that removing items from Server will remove them from Portal. Esri Technical Services told me that the process is to remove them from both locations in a federated environment.

Further: Federation was accomplished using the Cloud Builder.

0 Kudos
RoberthSanchez
New Contributor III

They say that because is a regular problem, but in my case i check that with a wrong configuration with the federated server got that result (not removed in both sides), and with a correct configuration when i remove layers from arcgis server manager then are automatically removed from portal, even if the user logged in arcgis server manager is not the user of portal that upload or share the layer, what i don't know if that change in other versions i'm using ArcGIS 10.5.

Regards.

ZacharyHart
Regular Contributor

They say that because is a regular problem,

Oh man...I'd like to believe that is not true...but I can't rule that out.

Can you tell me a bit more about the exact DNS configuration to investigate? Even if this does work (the automatically deleting), I kind of doubt I'm going to be able to successfully delete these orphaned items.

0 Kudos