Tag Archives: Outlook Sync

DotNetNuke PortalAliasInfo objPortalAliasInfo) at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest

Problem with Outlook Sync

clip_image002

Task ‘SharePoint’ reported error 0x80040102 Outlook cannot connect to the SharePoint List.

We experienced some errors with our DNN website recently. The errors were and interesting one and a combination of a few things. Actually took some work to understand.

The problem we noticed was that in the Log Viewer, we found many General Exception Errors:

AssemblyVersion: 5.6.0
PortalID: -1
PortalName:
UserID: -1
UserName:
ActiveTabID: -1
ActiveTabName:
RawURL: /_vti_bin/lists.asmx
AbsoluteURL: /_vti_bin/lists.asmx
AbsoluteURLReferrer:
UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: bla
InnerException: Unhandled Error:
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: DotNetNuke.Entities.Portals.PortalSettings..ctor
StackTrace:
Message: System.Exception: Unhandled Error: —> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabID, PortalAliasInfo objPortalAliasInfo) at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) — End of inner exception stack trace —
Source: SERVER NAME

In the server Event Log, we found

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/24/2010 11:43:47 PM
Event time (UTC): 11/24/2010 12:43:47 PM
Event ID: 6c188de9427b4941aa187a2ee4e7b173
Event sequence: 388
Event occurrence: 5
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/3/ROOT-1-129350748043347324
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\inetpub\wwwroot\localpath
    Machine name: SERVER
 
Process information:
    Process ID: 3460
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Exception information:
    Exception type: NullReferenceException
    Exception message: Object reference not set to an instance of an object.
 
Request information:
    Request URL: http://www.interactivewebs.com.au/_vti_bin/lists.asmx
    Request path: /_vti_bin/lists.asmx
    User host address: 66.34.204.111
    User: 
    Is authenticated: False
    Authentication Type: 
    Thread account name: NT AUTHORITY\NETWORK SERVICE
 
Thread information:
    Thread ID: 12
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabID, PortalAliasInfo objPortalAliasInfo)
   at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 
 
Custom event details:

The common thread here

This URL http://www.interactivewebs.com.au/_vti_bin/lists.asmx

was failing with an error looking like this.

image

Now we realised that this URL to hit the lists.asmx file, is something that should relate to an Outlook Service Contact Web Service Extension. This we know to be associated with one of our own DotNetNuke modules called, Outlook Sync.

This outlook sync (cool module) takes reference to the Outlook Web Service Extension to make a SharePoint style connection of DotNetNuke Contacts into outlook. Allowing you to make a contact list in outlook of your DotNetNuke clients.

The issue is that DotNetNuke is not allowing (under some of the new URL handling technology) for the URL of the web service to be hit.

We found that when testing the install of the module on a new DNN 5.6.0 website, that a portal alias was automatically added to the primary portal that included this path. i.e.

domain.com/_vti_bin/lists.asmx

or

www.domain.com/_vti_bin/lists.asmx

This turned out to be the solution for our site too. By adding the alias to the Admin / Other Settings / Portal Aliases – list of alias addresses.

This then allowed the web url /_vti_bin/lists.asmx to be hit and return the default page for this url:

image

After providing this, the errors were all gone, and the Outlook Sync module worked again!

It turns out that there is a better solution

 

Because the error is actually caused by some bugs in the URL rewriter in DNN.  In the Web.config. There is a reference to the URL rewriter. It is responsible for generating the error above.

This line is found in the web.config under the system.webserver section of the config file.

<add name="UrlRewrite" type="DotNetNuke.HttpModules.UrlRewriteModule, DotNetNuke.HttpModules" preCondition="managedHandler" />

 

We have a line relating to the outlook sync

<add name="OutlookSync" type="iwebs.HttpModules.OutlookSyncHttpModule, App_SubCode_OutlookSyncHttpModule" preCondition="managedHandler"/>

If you ensure that the outlook sync line appears before the URLReweite line in the web.config. Then this will fix the error too, and make it not necessary to use the alias.

We believe this is a bug in the later version of the DNN URLRewriter.