Select to view content in your preferred language

Corrupt Portal Item - How to delete?

1699
21
04-21-2025 05:40 AM
JonM32
by
Frequent Contributor

How do you delete a corrupt portal item?

Our Enterprise Portal is federated and what happen was an item was deleted from the server's ArcGIS Server Manager. This was a mistake since the linked item in portal did not get deleted when the service was deleted from Server Manager. Is there any way to get rid of the portal item? All that happens when you try to open it is you get to watch the loading screen but nothing ever loads. To add to this, the item has delete protection on preventing it from being deleted from the Contents page.

Enterprise Portal version 10.9 - Federated

 

Any input is appreciated!!

-Jon

2025-04-21 08_38_21-Settings.png

Jon
0 Kudos
21 Replies
JonM32
by
Frequent Contributor

No luck. When I try to overwrite the service, it states "Unable to retrieve information for existing item"

Jon
0 Kudos
BlakeTerhune
MVP Frequent Contributor

Sorry, I meant to recreate it (new), not overwrite it.

0 Kudos
MikeVolz
Frequent Contributor

Wouldn't publishing a new service just create a new Portal item as well?

0 Kudos
JonM32
by
Frequent Contributor

@BlakeTerhune @MikeVolz 

That's actually how this all happen. I messed up the first service and did the delete in the wrong order - which caused this stuck, corrupt item. Then to fix it, I ended up making a brand-new service, but it's completely separate from the corrupt one.

Jon
0 Kudos
BlakeTerhune
MVP Frequent Contributor

Okay, sorry for the confusion. I was thinking it was a web map or something using the service that was messed up. Please disregard this line of questioning.

RyanUthoff
MVP Regular Contributor

Are you able to see the Portal item in the Portal REST endpoint? You can try and attempt to delete the item directly from the REST endpoint, although I'm not sure if it will let you with delete protection enabled.

Also, this could be something to look into: https://community.esri.com/t5/arcgis-enterprise-portal-questions/remove-items-of-type-null/td-p/1115...

Edit: Also this could be useful: https://support.esri.com/en-us/knowledge-base/problem-unable-to-delete-a-detached-item-in-portal-for...

JonM32
by
Frequent Contributor

It doesn't show up in the rest endpoint. However, it shows up on the portal website.

I will look into these options. If I have no luck, I'll likely connect with a support specialist for further assistance.

Jon
0 Kudos
RyanUthoff
MVP Regular Contributor

I'd look into the second link I posted if it doesn't show up in the rest endpoint. You can try taking the ItemID of your corrupted Portal item and see if it exists in your content directory on your Portal server machine. There should be a folder that is named with the ItemID of every item in Portal. But if it's not there, then you might be able to follow the instructions from the second link I posted and fix it that way. 

DavidColey
MVP Frequent Contributor

Hello @JonM32  - Yes the second link that @RyanUthoff posted may work.  I ran into a similar situation in 2023 when we were at 11.1 where a federated map service and a federated geocode service were deleted from our federated site, leaving behind the orphaned items in the Enterprise portal gwdb.

Esri reached out to me after I tried everything in this post, force delete, etc etc.  Nothing worked. 

However, I don't see the solution they suggest below as any more or less risky than copy-paste method from the second link in the .../items directory.  This worked for me:

From esri:

****

We don't encourage poking around in the internals of Portal for ArcGIS. My suspicion here is that the records exist in the database and index, but not the content directory, causing the item corruption from Sharing/REST.

Using the initial administrator account (used to originally create the site), you can run the following commands using the PostgreSQL binaries:

cd C:\arcgisportal\pg_sqlX.Y\bin

psql -h localhost -U <username> -p 7654 -d gwdb -c "DELETE FROM gw_items WHERE id='<itemID>'"

 

 Once complete, you'll need to run a search reindex as well at minimum which will take some downtime for the search capability.

****

Hope this helps.

 

GrahamWood-HWC
Regular Contributor

Great trick.

I used @DavidColey 's method but modified somewhat..

I exported the whole table to a CSV 

GrahamWoodHWC_0-1746417117889.jpeg

and then found the cuplrit in notepad to get it's itemid and deleted in portal rest
https://YourGIS.com.xy/portal/sharing/rest/content/users/OWNERNAME/items/PlaceItemIDHere/delete

0 Kudos