Error "Rule context is not detected" trying to add an Audience rule

I'm trying to create an Audience (or edit an existing Audience).

When I add a rule and change the "Select one of the following" from User to Property, I get a red box at the top that says:

Rule context is not detected. This page needs to be loaded from Audience page.

The page cannot be displayed because the URL is missing a parameter. Please access this page through the management pages of the portal site.

An error has occurred while accessing SQL database or system resources. If this is the first time you have seen this message, please try again later. If this problem persists, please contact your administrator.

What is going on with this? It is occurring on our production system and our staging server. The production server has SP1 with the June 2014 CU installed, but the staging server has the September 2014 CU installed. Both have the same problem.

November 5th, 2014 3:32pm

Hi Stoonad,

I understand that the error occurs when you add rules to the audience.

First, I recommend to check if your account has permission to manage audience in the User Profile Service Application.

Highlight the user profile service application, and then click Administrators on the ribbon.

Second, please change another account to do the same test to see how it works.

As a workaround, you can create the audience by using PowerShell instead.

Please refer to the following link:

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

Thanks,

Victoria

Forum Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

Free Windows Admin Tool Kit Click here and download it now
November 6th, 2014 4:27am

Thanks for responding.

It does not appear to be a security issue. I was not in as a User Profile Administrator, but I am a farm admin, and I was able to do it before we upgraded from SP 2010.  I added myself as an admin under User Profiles, and I also logged in as the farm account and tried it and the same thing occurred.

This is what the screen looks like:

November 6th, 2014 8:56pm

I too have had the same problem for a couple of months running as a farm admin and cannot find an answer!
Free Windows Admin Tool Kit Click here and download it now
November 7th, 2014 1:20am

Hi Stoonad,

It seems that the Audience GUID is not passed when you click the Add rule button in the viewing audience page.

Please go to the view audience page, use F12 tool in IE to check the Add rule button to see if the javascript function is correct.

Thanks,

Victoria

Forum Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

November 7th, 2014 5:36am

It appears to have a GUID.

<a id="ctl00_PlaceHolderMain_lnkCreateRule" accesskey="G" href="javascript:if (CanCallNew()) GoToEdit('008f4cf7-decf-47d5-9895-b39e0bbc3005', 0);">Add rule</a

But the error does not occur immediately after the Add Rule button.  On the Add Rule page, it occurs when I change the Operator to "Member Of" (when the "Operand" User radio button is selected) or when I change the Operand radio button to "Property".  The page refreshes and that's when the error appears.

The URL does not change when it refreshes:

http://spapp01:30000/_layouts/15/Audience_DefRuleEdit.aspx?ApplicationID=b903b8aa%2D6618%2D4641%2D9fb6%2D463b7d359f47

I am using IE 11, and I found that I need Compatibility View on the View Audiences page - otherwise I do not get the drop down menu that appears when moving the mouse over an Audience name to get to the Edit page.

If I change the URL to add the Audience GUID, it still doesn't work, but I only get the first line of the error message, not the second two lines.

  • Edited by Stoonad Friday, November 07, 2014 2:49 PM Added info
Free Windows Admin Tool Kit Click here and download it now
November 7th, 2014 5:43pm

It appears to have a GUID.

<a id="ctl00_PlaceHolderMain_lnkCreateRule" accesskey="G" href="javascript:if (CanCallNew()) GoToEdit('008f4cf7-decf-47d5-9895-b39e0bbc3005', 0);">Add rule</a

But the error does not occur immediately after the Add Rule button.  On the Add Rule page, it occurs when I change the Operator to "Member Of" (when the "Operand" User radio button is selected) or when I change the Operand radio button to "Property".  The page refreshes and that's when the error appears.

The URL does not change when it refreshes:

http://spapp01:30000/_layouts/15/Audience_DefRuleEdit.aspx?ApplicationID=b903b8aa%2D6618%2D4641%2D9fb6%2D463b7d359f47

I am using IE 11, and I found that I need Compatibility View on the View Audiences page - otherwise I do not get the drop down menu that appears when moving the mouse over an Audience name to get to the Edit page.

If I change the URL to add the Audience GUID, it still doesn't work, but I only get the first line of the error message, not the second two lines.

  • Edited by Stoonad Friday, November 07, 2014 2:49 PM Added info
November 7th, 2014 5:43pm

I am having the exact same problem.  Once I click the Operand radio button to "Property" then I get the same errors that Stoonad is getting.  I don't see anything in the event viewer, and I see very little in the ULS logs.  In the ULS logs I see that it was clicked and then later on it says Object reference not set to an instance of an object.

AudienceDefRuleNewEdit.UserValue_SelectedIndexChanged(): System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.Portal.Audience.AdminUI.DefRuleNewEdit.UserValue_SelectedIndexChanged(Object sender, EventArgs e). c678cb9c-ec76-a0fd-6513-af184b7d40df

I am currently configuring 4 production farms (we're a global company).  3 of the farms work perfectly fine and the 4th is having this audience problem.  Everything else seems to be working fine on this farm.  I have compared all of the windows services and the running SharePoint services (System Settings -> Manage services on server) to see if anything is different.  Nothing is different between the SharePoint services and very little is different between the windows services (just some vmware vs. hyper-v differences).

The last thing I have checked is the installed updates.  Here is were there are some differences.  For some reason all 3 of the working farms have the update from KB2883068 only, which I installed.  The 4th farm has some updates from KB28830368 and some additional updates, KB2889943, KB2881034, KB2889937, and KB2889930.  These updates I did not install, it appears windows update got these in somehow.  I am thinking these updates might have something to do with it, but guess what, they can't be un-installed.  I suppose by best bet for testing my theory is to un-install SharePoint and start over.

Free Windows Admin Tool Kit Click here and download it now
November 12th, 2014 10:16pm

On the systems where it works, is there any difference in the URL's from when you change the operand to Property vs. the systems where it does not work?

November 12th, 2014 11:22pm

Well my other farms have different GUID's of course, so if you consider that then they were different.  Otherwise they were not different, no additional parameters were added or anything.  That actually made me think at first that it was something blocking javascript from running.  I added the central admin site to the local intranet zone (instead of changing compatability view like you did, but I also tried that later on).  Adding the site to the local intranet zone did help me get the drop down for the Synchronization Connections, but it didn't help our particular problem.  I also tried from my desktop browser, still hoping it was an IE security setting, but that didn't work either.

Free Windows Admin Tool Kit Click here and download it now
November 12th, 2014 11:38pm

I'm more likely to believe it was an update that broke it.

I didn't think it was the browser because I tried it in IE 9 and IE 11, compat view and not, and in Chrome.  All did the same thing.

We recently migrated from SP 2010, and I honestly can't say if I tried to create an Audience until now since the migration.

We are now pushing out IE 11, and editing SP 2013 sites was not working in IE 11 unless in compat view, so I installed all Windows Updates on the SP servers, including the optional updates to .NET, which was supposed to update the browser config files.  Doing this made IE 11 work with SP 2013 without compat view being required... EXCEPT when using the Manage Audience page.  To get the drop down context (ECB) menu to drop down on an audience name to edit it in Manage Audiences, I have to put IE 11 in compat view. Strange that only that page needs it.

On our staging farm, we have the Sep 2014 CU installed, but in our prod farm, it has SP1 installed with no CU's, and it doesn't work in either. So I'm starting to suspect one of the .NET or SharePoint updates that came down through Windows Update.

November 12th, 2014 11:50pm

Do you have the SharePoint updates with the KB #s I mentioned above?  They appear to be language packs.  Possibly some field missing from a language pack is causing the null object reference I mentioned.
Free Windows Admin Tool Kit Click here and download it now
November 13th, 2014 12:20am

I have all those updates except KB2883068 (which I think is the September 2014 CU). Turns out I was mistaken and I have the August 2014 CU, not September, on my staging server.
November 13th, 2014 12:59am

Well, now I am really sure it was one of those updates.  As I mentioned before, I couldn't un-install the updates, so I had to remove the whole SharePoint application from each server where it was installed.  While re-installing I still added the September 2014 CU, since it is there on all of my other farms.  Of course I made sure not to install anything from windows updates.  I rejoined the farm and my main web application and "My Site" web application were automatically re-configured.  I had to delete my user profile service though, and I had to re-configure all of that.  I didn't have any other service applications configured before uninstalling so I don't know what else might have to be repaired if you go this route.

Once I got my user profiles configured and working again then I checked if I can select the "Property" radio button on the audience and it finally worked.

If you go this route then you will need these PowerShell (SP13 Management Shell) commands.

Get-SPServiceApplicationPool

Get-SPServiceApplicationPool -Identity "SharePoint - User Profile" (or whatever your user profile was called)

Remove-SPServiceApplicationPool -Identity "SharePoint - User Profile"

Really the first Get and the Remove are what you really need, that's just how I step through it to make sure I'm typing stuff right.  Since I only had the user profile service application configured then that was the only one I had to remove.

In my case I was fortunate that I was in the process of configuring this farm, so I didn't really have concerns about content (no content exists yet).  However, I have to have audiences.  That is how we ensure that people have only one personal site instead of one at each farm.  In any other environment it would probably be a bit risky to just go uninstalling stuff, so proceed with caution (and preferably on a test system first).  I hope an easier solution comes around soon.

If you need me to look at some resx files then I will be glad to help if I can.  It appears those updates were language pack updates so it might be that a field was removed from a language resx file.  email me at eric.sammannATxfab.com.  Maybe we can find an easier solution for you.

Free Windows Admin Tool Kit Click here and download it now
November 13th, 2014 2:10am

Ugh... Removing and reinstalling SharePoint is not an option for me. Maybe a good first shot is to compare resx files and see what the differences are.  Let me check my dev system and see if the updates were not installed there and I can use them for comparison. If it has been updated, maybe we can work out some way to do a compare with your files and mine.

November 13th, 2014 8:07pm

I'm having the same issue...

Worked fine prior to installing SharePoint updates 3-4 weeks back...

Free Windows Admin Tool Kit Click here and download it now
November 14th, 2014 3:39pm

Hi Stoonad and mholme01,

I have noticed that there are three new windows updates that came out November 11th.  KB2899494, KB2889845, and KB2883055 are newer updates for SharePoint coming from windows update.  Have you tried these updates to see if it fixes your audiences?


November 21st, 2014 4:39pm

Eric,

I applied those updates to my staging environment and it seems to fix the problem! Thanks for pointing that out!

I'm going to apply them to my production environment, and hopefully we have the same result.

Thanks!

Free Windows Admin Tool Kit Click here and download it now
November 21st, 2014 8:43pm

Hi Stoonad and mholme01,

I have noticed that there are three new windows updates that came out November 11th.  KB2899494, KB2889845, and KB2883055 are newer updates for SharePoint coming from windows update.  Have you tried these updates to see if it fixes your audiences?


November 22nd, 2014 12:35am

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

Other recent topics Other recent topics