3
votes

Sharepoint Deployment : on premises with local domain address as http://sharepoint , windows server 2008 R2

In Order to deploy my app I added app URL in admin central as apps.mydomain.com

apps.mydomain.com is actually the sub domain I created on my company official website.

After compiling application and running it I am getting following error in output window

Active Deployment Configuration: Deploy App for SharePoint Skipping deployment step because a pre-deployment command is not specified. Skipping the uninstall step because the app for SharePoint is not installed on the server. Install app for SharePoint: Uploading the app for SharePoint... App failed to install, cleaning up... Successfully uninstalled the app for SharePoint. App installation encountered the following errors: 03/11/2014 07:17:19

 @"Error 1
        CorrelationId: fc4c3483-a34c-4975-a6cb-c1d84436c8f5
        ErrorDetail: The content database on the server is temporarily unavailable.
        ErrorType: Transient
        ErrorTypeName: Intermittent
        ExceptionMessage: The App domain for this site has already been assigned.
        Source: AppWeb
        SourceName: App Web Deployment
Error occurred in deployment step 'Install app for SharePoint': Failed to install app for SharePoint. Please see the output window for details.

========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ========== ========== Deploy: 0 succeeded, 1 failed, 0 skipped ========== Can you please give me an idea here I am wrong ?

4

4 Answers

1
votes

Recently I was working on configuring SharePoint hosted apps for our customer and while testing I saw this issue. After completing the configuration of Apps I uploaded an app to app catalog and added the app to a site. The app worked without any issue but there was one gotcha. I missed to replace an S in App Prefix which was set to Apps so my app url was https://apps-1234.apps.contoso.com but the orignal plan was to use “app” as prefix.

So I removed the app from the site and app catalog. Then went to CA and changed the app prefix to app from “apps”. Uploaded the test app to catalog and then tried to add to the site and it failed with error. “Unable to add the app to the site please retry”

I started ULS Viewer and started live log stream and clicked retry and saw an amazing message. SharePoint app was still using “apps” while I have updated it app. I knew something was goofy and traditionally UI is that good with me when it comes to SharePoint.

SPException thrown: Message: The App domain for this site has already been assigned.. Stack: at Microsoft.SharePoint.Utilities.SPUtility.ThrowSPExceptionWithTraceTag(UInt32 tagId, ULSCat traceCategory, String resourceId, Object[] resourceArgs)

Here is what I did. Open SharePoint Management Shell as administrator (Farm Account).

Set-SPAppDomain -AppDomain apps.contoso.com Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false

Open Command Prompt as Administrator. Run the commands below.

net stop sptimerv4, iisreset, net start sptimerv4

Repeat the above 3 on all servers in the farm.

I closed all the browsers and opened the site and click Retry from Site content page. Bingo the app was added without any problem.

https://jerryyasir.wordpress.com/2015/11/06/unable-to-add-the-app-the-app-domain-for-this-site-has-already-been-assigned/

0
votes

I restarted all services in the server for sharepoint to solve the problem namely:

AppFabric Caching,

Sharepoint serach host controller,

Sharepoint search server 15 ,

Sharepoint Timer Service,

Sharepoint user code host

Services can be restarted from Control Panel-> Administrative tools -> services

It seems one of the service is responsible for the updating configuration in DB, even when I googled people said that by restarting the server and after some time the problem automatically got served.

So I think one of the service when run solves the problem

0
votes

just restart the sharepoint server will do

0
votes

I had same issue, I resolved it by just un-provisioning, deleting and re-adding the SPDistributedCacheServiceInstance