Share via


Cannot delete SharePoint web application again

Question

Tuesday, October 28, 2014 4:34 PM

While deleting web application

Central admin gives error: 

Sorry, something went wrong

An object in the SharePoint administrative framework, "SPWebApplication Name=ShareAppsUAT", could not be deleted because other objects depend on it.  Update all of these dependants to point to null or different objects and retry this operation.  The dependant objects are as follows: correlation id

ULS log shows following error

Unknown SQL Exception 547 occurred. Additional error information from SQL Server is included below.  The DELETE statement conflicted with the REFERENCE constraint "FK_SiteMap_Application". The conflict occurred in database "SharePoint2013UATEnterprise_Config", table "dbo.SiteMap", column 'ApplicationId'.  Table 'LastUpdate'. Scan count 0, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.  The statement has been terminated.

I had similar thread https://social.technet.microsoft.com/Forums/sharepoint/en-US/74e06180-f066-47e0-8895-3e909206b9e9/cannot-delete-sharepoint-web-application?forum=sharepointgeneral

The only difference is error in central admin. Before for another web application i got Object not set to a reference of an object. now i am getting An object in the SharePoint administrative framework, "SPWebApplication Name=ShareAppsUAT", could not be deleted because other objects depend on it.  Update all of these dependants to point to null or different objects and retry this operation.  The dependant objects are as follows: in both powershell and central admin. 

Solution in above thread gives following error for this case

Exception calling "Delete" with "0" argument(s): "An object in the SharePoint administrative framework, could not be deleted because other objects depend on it. Update all of these dependa nts to point to null or different objects and retry this operation. The depend ant objects are as follows: Web Application name.

How to solve it? It is like a loop. If i go to delte web appliction it says content database is dependent object and if i do for content database it says web application is dependent object

Adit

All replies (5)

Wednesday, October 29, 2014 11:45 AM

Hi Adit,

From your description, the issue might be caused by orphan items in sitemap.

Please execute command below to check IDs and site map status for all site collections and subsites in the issue content database:

stsadm -o enumallwebs -databasename <database name>

Then use the command below to delete orphan sites:

stsadm -o deletesite -force -siteid <siteid> -databaseserver <database server name> -databasename <database name>

Now run IISReset and try delete web application via:

Remove-SPWebApplication - identity http://sitename

For related information:

http://technet.microsoft.com/en-us/library/dd789634(v=office.12).aspx

http://technet.microsoft.com/en-in/library/cc288016(v=office.12).aspx

http://technet.microsoft.com/en-us/library/ff607891(v=office.15).aspx

Regards,

Rebecca Tu
TechNet Community Support


Thursday, March 5, 2015 8:38 PM

What if i do not know which database was deleted? How to solve this problem? I can see two site collection assosiated with web application even though there is no content database attached.

Adit


Thursday, March 12, 2015 11:56 AM

that's exactly my situation... i have no DB attached to the webApp :( 


Thursday, March 12, 2015 12:21 PM | 3 votes

that's exactly my situation... i have no DB attached to the webApp :( 

TWhen i execute 'get-spcontentdatabase' i get only few dbs, but if i execute:

'get-spdatabase' i get a "hidden" content database.. so i get de id of that db and then i could delete without problems by executing:

GET-SPdatabase

{copy ID of "orphan / not mounted on SQL DB"}

$db = GET-SPdatabase -id {the ID}

$db

(the output shoould show a db name, just to be sure..)

$db.delete()

Then, just go to CA and Delete the WebAPP...

hope this helps, sorry but my horrible english


Monday, May 6, 2019 12:18 PM

Using Sharepoint 2016 Management Shell

 1. Get-SPDatabase - Will give list of all databases in farm ( Name | ID | Type)

 2.$db=Get-SPDatabase | where-object {$_.id -eq 'GUID of database need to be deleted'}

 3. $db.Delete

 4. Delete Webapplication by UI 

Rajesh