Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tridion Profiling and Personalization error: The user cannot be null. please make sure the WAI is configured correctly

I have a ASP.NET page (index.aspx) using profiling and personalilzation published from Tridion 2011 SP1. It simply displays one dynamic component presentation and a second dynamic component presentation if the user has previously viewed 3 pages tagged (via cat+keywords) as 'golf'.

I initiated the profiling by adding the TBBs 'Target Group Personalization' and 'Activate Tracking' to my default finish actions. I republished the page and saw it create the dynamic cp's with the profiling code, all was going well:

<tridion:ComponentPresentation runat="server" PageURI="tcm:8-667-64" ComponentURI="tcm:8-668" TemplateURI="tcm:8-666-32"/>
<tridion:TargetGroup runat="server" ItemURI="tcm:8-667-64">
    <tridion:Conditions runat="server" Negate="false" Operator="AND">
        <tridion:Conditions runat="server" Negate="false" Operator="OR">
            <tridion:Conditions runat="server" Negate="false" Operator="AND">
                <tridion:Condition runat="server" Type="TrackingKey" Operator="=" Negate="false" Name="Golf" Value="3"/>
                </tridion:Conditions>
            </tridion:Conditions>
    </tridion:Conditions>
    <tridion:ComponentPresentation runat="server" PageURI="tcm:8-667-64" ComponentURI="tcm:8-663" TemplateURI="tcm:8-666-32"/>  
</tridion:TargetGroup>
<tridion:IncrementKey runat="server" ItemURI="tcm:8-667-64" Name="Golf" ComponentURI="tcm:8-663"/>

Problem: When I view index.aspx in my browser it gives me the error:

The user cannot be null. please make sure the WAI is configured correctly

I checked the broker DB and there was no data there. I believe my cm_wai_conf.xml file is configured correctly. I read this article that suggests the WAI uses the environment variable REMOTE_USER which I added to windows and still no luck. http://sdltridionworld.com/articles/UsingPandPinDistributedEnvironments.aspx

Has anyone experienced this error before and can help? I can provide my cd_wai_conf.xml file if necessary

Thanks in advance, your help is greatly appreciated, it's been driving me crazy!

EDIT: Added config file The XML would not render in StackOverflow so I've added it on PasteBin: http://pastebin.com/tHwqhwtq

like image 916
Jonathan Primmer Avatar asked Jul 26 '12 17:07

Jonathan Primmer


2 Answers

Thanks guys. You're right. The WAIModule wasn't correctly configured in the web.config of my site. My site was running under IIS7 integrated mode so I configured this as follows:

<system.webServer>
<directoryBrowse enabled="true" />
<modules>
    <add name="TridionWAIHttpModule" type="Tridion.ContentDelivery.Web.WAI.WAIModule, Tridion.ContentDelivery" preCondition="managedHandler" />
</modules>
<validation validateIntegratedModeConfiguration="false"/></system.webServer>

This gave me a new error "Object reference not set to an instance of an object". I changed my AppPool to Classic mode and added the following lines:

<httpModules>
    <add type="Tridion.ContentDelivery.Web.WAI.WAIModule, Tridion.ContentDelivery" name="TridionWAIHttpModule" /> 
</httpModules>

The page then loaded and Profiling and Personalization worked 100%

Thanks a lot for you time here guys. I hope this helps someone else in the future.

like image 138
Jonathan Primmer Avatar answered Nov 09 '22 08:11

Jonathan Primmer


I have seen this when you don't have a Presentation ID confifgured for the URL you are using to access the site in the cd_wai_conf.xml. By default I believe this uses localhost. Make sure you have a host URL defined for whatever URL you are using to access the site.

Also double check that your WAI module is added correctly in the web.config of your webb app. In IIS make sure you have the module in the correct location, this can differ depending on whether you are in IIS6 or higher, and whether your App Pool is in Classic or Integrated mode.

like image 44
Chris Summers Avatar answered Nov 09 '22 07:11

Chris Summers