SharePoint 2013 - Issue with Apps

Hi All,

I have just encountered a very frustrating issue;

As random as it could possibly happen, this morning all of our installed SharePoint Store apps have broken.

They still display correctly through their web\app parts, but the moment the header is clicked, we receive the following error;

Sorry, something went wrong

Accessing referenced file https://app-25d238edb9176b.**.com/_catalogs/masterpage/**MasterPage.master from https://app-25d238edb9176b.**.com/ImportantMessages/Pages/Default.aspx?SPHostUrl=https://intranet.**.com.au&SPLanguage=en-AU&SPClientTag=14&SPProductNumber=15.0.4420.1017&SPAppWebUrl=https://app-25d238edb9176b.**.com/ImportantMessages is not allowed because the reference is outside of the App Web.

Entries in the ULS Logs say much the same;

Application error when access /ImportantMessages/Pages/Default.aspx, Error=Accessing referenced file https://app-25d238edb9176b.**.com/_catalogs/masterpage/**MasterPage.master from https://app-25d238edb9176b.**.com/ImportantMessages/Pages/Default.aspx?SPHostUrl=https://intranet.**.com.au&SPLanguage=en-AU&SPClientTag=14&SPProductNumber=15.0.4420.1017&SPAppWebUrl=https://app-25d238edb9176b.**.com/ImportantMessages is not allowed because the reference is outside of the App Web.

I have done the following in an attempt to correct the issue;

  • Re-read through the steps on configuring the app domain
  • Reinstalled the Apps
  • Ran an IISReset

Any help would be much appreciated.

Pete

March 21st, 2013 12:02am

Hi Pete,

I have experienced the same issue when using a custom feature stapled branding pack.  When activating the feature, the solution recursively overwrites all masterpage references within the site collection setting the new masterpage.  By excluding the application pages checking for isAppWeb, and subsequently not overwriting the default masterpage App.master, the issue no longer occurs.  Hopefully this assists you.

Regards

  • Marked as answer by Peter10452 Friday, March 22, 2013 4:24 AM
Free Windows Admin Tool Kit Click here and download it now
March 22nd, 2013 3:18am

That's a winner!

Thank you for the solution, it worked perfectly and made total sense. I really appreciate the thoroughness and speed of the reply. I owe you a beer ...

Pete

March 22nd, 2013 4:28am

There is no way to check for isAppWeb if a site collection admin decides to change the masterpage using /_layouts/15/ChangeMasterPage.aspx and checks reset all subites.

This is scary that anyone can break apps this way. I would rate it a bug.

Free Windows Admin Tool Kit Click here and download it now
April 29th, 2013 9:52pm

Hi Pete,

I have experienced the same issue when using a custom feature stapled branding pack.  When activating the feature, the solution recursively overwrites all masterpage references within the site collection setting the new masterpage.  By excluding the application pages checking for isAppWeb, and subsequently not overwriting the default masterpage App.master, the issue no longer occurs.  Hopefully this assists you.

Regards

Hi, I have same problem. I have changed Master page by activating a feature and changing MasterUrl and CustomMasterUrl. Now when I add an app it generates same error. I don't know how you exclude the application pages?? thanks

May 6th, 2013 11:19am

Hi Pete,

I have still the same issue.

How did you fixed it? Did you some changes directly in the master page?

Thanks a lot in advance!

Marc

Free Windows Admin Tool Kit Click here and download it now
July 9th, 2013 1:08pm

Hey folks, I just posted a solution to this annoying "feature" using Powershell on my blog. It allows you to fix this issue on both on-premise farms as well as O365 tenants:

http://mctalex.blogspot.com.au/2013/07/powershell-fix-for-app-master-problem.html

Hope it helps. Saved me from disgrace for sure :-)

Alex Dean SharePoint Consultant Professional Advantage
sp2013.com.au
July 10th, 2013 10:41pm

You can exclude web that have the WebTemplate set to: APP#0

Something like:

if(!web.WebTemplate.Contains("APP#0"))

{

    //apply master page

}

However, this doesn't prevent site owners from breaking it by going in through the UI, choosing a new masterpage, and selecting 'inherit.' It will include app site webs, and break them. Bummer.

Free Windows Admin Tool Kit Click here and download it now
August 22nd, 2013 5:10pm

This whole thing makes the apps experience rather bad, poor and overall useless for normal use!!

I'm struggling for weeks now with MS SharePoint Online support engineers. One is this issue, the other that the approval workflow is you add your own App Catalog Site Collection to handle apps requests from the Public SharePoint Apps store gives this error message:

Sorry, something went wrong

The app permission request flow feature is not enabled.  Enabling this feature can only be done by
Microsoft.

Duh!

Then the other one is - working around the approval workflow by manually setting requests to approved - hoping the workflow does not contain other fancy actions....EVERY attempt to use an app, even the Yammer one from MS itself,  inside a site gives:


Sorry, there was a problem with Yammer App for SharePoint For support, please visit: http://o15.officeredir.microsoft.com/r/rlidYammerappO15?clid=1033 Accessing referenced file
https://something-de54d4b6fbdc80.sharepoint.com/teams/2/_catalogs/masterpage/seattle.master
from https://something-de54d4b6fbdc80.sharepoint.com/teams/2/Yammer App for
SharePoint/Pages/StartPage.aspx?SPHostUrl=https://something.sharepoint.com/teams/2&SPLanguage=en-US&SPClientTag=3&SPProductNumber=16.0.2016.1219&SPAppWebUrl=https://something-de54d4b6fbdc80.sharepoint.com/teams/2/Yammer
App for SharePoint is not allowed because the reference is outside of the App
Web.
Technical Details


Troubleshoot
issues with Microsoft SharePoint Foundation.

Correlation ID:
8cf5439c-ec28-2026-9c3b-3f8b9c9a9b10

Date
and Time: 9/17/2013 11:25:55 AM

September 17th, 2013 6:45pm

I wrote a script to fix this problem, posting it here for all to use, it's a lot simpler than any other solutions I found, and can recursively go through all your apps and fix them, only one line needs to be configured.

#!/bin/powershell
# This little number automatically fixes that annoying app breaking bug with themes

# configuration
$prefix = "spapp"


$allappurls = Get-SPSite | Get-SPWeb -Limit All | where {$_.url -like "http://$prefix*"}
foreach ($app in $allappurls)
{
	$name = $app.name
	$app.CustomMasterUrl = "/$name/_catalogs/masterpage/app.master"
	$app.MasterUrl = "/$name/_catalogs/masterpage/app.master"
	$app.Update()
}


Free Windows Admin Tool Kit Click here and download it now
February 11th, 2014 10:32pm

This is only a workaround. In honesty MS needs to correct this behaviour from within the product. This is a huge issue for those who want to use the apps with custom stapled designs.

I agree this does answer the question, it simply doesn't solve the problem. I wonder if this is a best practice model for MS..

March 27th, 2014 12:06am

Thank you for the script George. This fixed my issues. Microsoft please resolve this ASAP.

Free Windows Admin Tool Kit Click here and download it now
June 17th, 2014 3:44am

What do you put in instead of spapp?

September 8th, 2014 9:36am

I have been using this and normally it works fine.

I have a bunch of apps now though when I install them on a subsite that throw errors. I need help to try and fix these, maybe there is a modification I can do the script.

Here is an example. I have this application installed to http://siteroot/IT/
I get this error:

 Accessing referenced file http://app-e7e020cae49479.mydomain.local/LightningConductorApp/_catalogs/masterpage/app.master from http://app-e7e020cae49479.mydomain.local/IT/LightningConductorApp/Pages/Default.aspx?SPLanguage=en-US&SPHostUrl=http://siteroot/IT is not allowed because the reference is outside of the App Web.

I just removed my domain and siteroot name for privacy.

I am really banging my head on this. I've tried to manually set the script to $name/IT/_catalog..... but it didn't seem to take.

HELP!

Free Windows Admin Tool Kit Click here and download it now
September 25th, 2014 2:52pm

Hi All,

Thanks to Microsoft Support I have the solution.

After testing master pages, solutions, users, as you can imagine, all testing, it was simple.

Go to Site Settings -> Solutions, Deactivate all of them, and install your new app. Eureka!!!

After, reactivate solutions one by one and find out which solutions was causing troubles.

November 15th, 2014 1:58am

I am not able to apply this fix in SharePoint online. I tried converting the script in CSOM but I get an error while executing the ctx.ExecuteQuery - "File not found".

Any hints what is going wrong? Below is the code snippet.

            string siteCollectionUrl = "https://test123.sharepoint.com";
            string userName = "XXXXXXXXXXXXXXXX";
            string password = "XXXXXXX";

            // Namespace: Microsoft.SharePoint.Client  
            ClientContext ctx = new ClientContext(siteCollectionUrl);

            // Namespace: System.Security
            SecureString secureString = new SecureString();
            password.ToList().ForEach(secureString.AppendChar);

            // Namespace: Microsoft.SharePoint.Client  
            ctx.Credentials = new SharePointOnlineCredentials(userName, secureString);

            // Namespace: Microsoft.SharePoint.Client  
            Site site = ctx.Site;

            ctx.Load(site);
            ctx.ExecuteQuery(); // THIS WORKS FINE

            Web web = site.OpenWeb("https://app-70693404ae9dcc.sharepoint.com/");
            ctx.Load(web);
            ctx.ExecuteQuery(); // THROWS AN ERROR HERE - FILE NOT FOUND.

Also tried with the full app web url but get the same error.

            Web web = site.OpenWeb("https://app-70693404ae9dcc.sharepoint.com/mysimpleapp");
            ctx.Load(web);
            ctx.ExecuteQuery(); // THROWS AN ERROR HERE - FILE NOT FOUND.

Free Windows Admin Tool Kit Click here and download it now
June 8th, 2015 5:56pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics