Can’t Uninstall Sharepoint Application – Invalid State

Question:

Our Sharepoint 2013 Application failed to install and is stuck in a odd state. I followed the recommended approach for deleting the application using powershell commands on the hosted Sharepoint server, but it doesn’t execute properly.

Visual Studio Deployment/Retract Reports:

Skipping the uninstall step because the app for SharePoint is in an invalid state and cannot be uninstalled.

PowerShell Commands

Executing this PS command throws…

There is no option from the Sharepoint UI to remove the application, and retrying the install also fails. I’ve tried other user accounts to execute this powershell command (other than the system account), but no dice. I will have to delete the developer site collection if there is no other solution.

Answer:

I’m faced this problem before on my Office 365 SharePoint Online when deploy SharePoint Hosted App. Then I submit Microsoft Service request and work with MS Technical Support Team on this issue. This problem seem to be something error in SharePoint backend database by itself (I’m not sure to consider it is SharePoint defect).

Did you check the app details installation error report? If you get the message:

“The content database on the server is temporarily unavailable.”

Need help: Error ‘Install App for SharePoint’: An instance of this App already exists at the specified location., I’m quite not understand the answer but there is one comment from Jeremy Thake which seem to be deleted on this thread, he said that:

“…so I actually just restarted the whole environment and when Windows
came back up and I went to the SharePoint Site…the App was gone ;-)”

So here is my advice before you commit to delete your site collection:

  1. Try to deploy your to the another developer site collection and check whether this problem still occur as the same.
  2. Try to increase your app version or change app name/title/id and deploy to the same site collection and check whether this problem still occur as the same to your new app instance.
  3. For SharePoint Server, try to restart IIS/Window Server if you’re able to do that. Also install any latest SharePoint Update/CU.
  4. For Office365 – SharePoint and have you have license account, you should submit the service request, if not you should wait about several day and try to remove this app instance again through UI.

Hope you can remove your app and know the root cause exactly.

Source:

Can’t Uninstall Sharepoint Application – Invalid State by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply