DotNetNuke–Automatic Logout on Child Sites

It is a long running issue with modules, site and generally is caused by a user logging into a DotNetNuke website that then calls on a page (usually on a dotnetnuke child) website that references a separate .aspx web page.

Most often this is caused by the use of some java script that references external .aspx files in the script.

While in an ideal world this would not cause a logout issue for DNN users, especially admin users. It does and in our most recent experience with this was an updated website that used the cute soft “cute editor”.

This editor was working on dotnetnuke 4.9.5 sites, but due to it’s configuration and changes to the DotNetNuke 5x standards. No child portal would support it’s out of the box configuration after upgrading to dnn 5.6.0.

The fix was to throw it away and use the Telerik RAD editor. Not a bad option as far as the users are concerned, but disappointing that this apparent “bug” which we know could be addressed easily has never been identified and solved.

More time wasted!

DotNetNuke 5.6.0 Bug in Google Analytics Module No Hits

The Problem

We found that after updating to DNN 5.6.0 that the hits on Google Analytics dropped to 0 Page Views.

image

We looked at the reason behind the problem with 0 hits being reported. What we found was that the code that Google states we should use on the page (and was working fine in DNN 5.5.1) is now not valid in 5.6.0.

The tracking code for us looks like this:

 

<script type=”text/javascript”>

var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, ‘UA-1111111-1’]);
_gaq.push([‘_trackPageview’]);

(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

When we looked at the rendered source code on the DNN 5.6.0 website, we found that the code was different in the line:

_gaq.push([‘_setAccount’, ‘UA-1111111-1‘]);

Note the “” marks around the ID Number.

So this was someone’s buggy code from DNN Corp.   In the file: SiteAnalytics.config file.

 

The Fix

To fix the problem, is as simple as undoing the buggy code.

in the root directory of your site, is a file called:  SiteAnalytics.config

Open this file in your text editor to reveal:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<AnalyticsEngineConfig>
<Engines>
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
<ElementId>Head</ElementId>
<InjectTop>False</InjectTop>
<ScriptTemplate>
<![CDATA[

<script type=”text/javascript”>
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, [TRACKING_ID] ]);
_gaq.push([‘_trackPageview’]);

(function() {
var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

]]>
</ScriptTemplate>
</AnalyticsEngine>
</Engines>
</AnalyticsEngineConfig>

Just replace the two quotation marks highlighted above “” with single ‘’  one either side of the two [ ]and save the file. This will fix the buggy code.

So the line becomes:

_gaq.push([‘_setAccount’, [TRACKING_ID] ]);

 

Notes on DNN 5.6.1

Originally we suggested that the “” be taken out. We then found after updating the 5.6.1 that the removal of the “” broke that upgrade with regard to Google Analytics. So we have modified these notes to say to replace the “” with single ‘’.

 

Side Note

We stayed stable on DNN 4.9.5 for some time, enjoying not having DNN broken each time we updated. Finally we bit the bullet and with much pain, a Code Expert, a Server Admin Expert and the help of Hyper V rollback capability we updated to DNN 5.x.

Now we are finding ourselves back in the game of undoing crap code every time we run a DNN update. Yes there are some great shiny new features, but we just blew 2 man days working out bugs in the UrlRewriter system and now this analytics bug.

This is disappointing and annoying to again be on this roundabout!

SiteAnalytics – Download File

 

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.

Error The transaction log for database “domain.com” is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

While accessing a DotNetNuke website today, I was getting this error all the time.

Error   The transaction log for database “domain.com” is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

Event ID 3001

  • Event code: 3001
    Event message: The request has been aborted.
    Event time: 2/11/2010 12:28:32 PM
    Event time (UTC): 2/11/2010 1:28:32 AM
    Event ID: cc9168019d0b42cabde5ab8fa741927d
    Event sequence: 13
    Event occurrence: 12
    Event detail code: 0

I found this one a little perplexing. On further investigation I found that the transaction logging for the SQL server supporting this was massive. Around 980 meg when I would expect it to run around 15 meg.

Initially I tried killing all processes with active connections to the database, but that did not have the desired result. (We all know what a pain that can be in SQL). So I set the database to “Simple”, and tried to Detach the re-attach.

Still no joy!

All of this round and round ended up with an IIS server and SQL server reboot. All came good and the net result is that I cannot explain the fail or fix it.

Hope this helps someone make the reboot decision faster than I did. That’s another 2 hours of my like I will never get back!

DotNetNuke DNN An Error Has Occurred When Attempting To Save The File Forum Mdoule

When trying to add a file attachment to the DotNetNuke forum module, we received an error that looked like this.

An Error Has Occurred When Attempting To Save The File C:\webroot\site\site.com\wwwroot\Portals\0\Forums\Attachments\imge.jpg. Please Contact Your Hosting Provider To Ensure The Appropriate Security Settings Have Been Enabled On The Server.

We stuffed around for a longer than normal time looking to fix this. We played with permissions on the website host server and folders, as in most of the forum posts about this error we found, they were all blindly looking at that as the problem.

Solution

Check the folder exists – Look in the folder structure to see if the /Forums/Attachments/ folder is actually there.

Create it if is is not – In the website File Manager (ie under the Admin / File Manager DNN menu, create the Attachments folder. ensuring that you set permissions in that file manager to allow all registered users to upload.

Remove then recreate file upload permissions – In the forum administrator area, under the file Attachment Manager, uncheck, then update, then recheck and update the “Enable File Attachment” option.

image

Aldo remember to check the the Attachments Path is the one you created earlier.

For us, that did the trick.

HTML Module requires updating. Install "HTML 040802k PA.zip

Problem

You are running the InteractiveWebs DNN word editor on a website. You upgrade your DNN site (usually past an early DNN 5 release) to a later DNN 5 release.

After updating your DNN website, the word editor fails to publish and reports:

  • HTML Module requires updating. Install ‘HTML 040802k PA.zip’ or higher to your website to re-enable word editing’.

If you browse to:  www.yourwebsite.com//desktopmodules/html/publishtoweb.asmx

You will see:

The type ‘PublishToWeb’ is ambiguous: it could come from assembly ‘C:\Inetpub\vhosts\yourwebsite.com\httpdocs\bin\App_SubCode_HTMLService.DLL’ or from assembly ‘C:\Inetpub\vhosts\yourwebsite.com\httpdocs\bin\DotNetNuke.Modules.Html.DLL’. Please specify the assembly explicitly in the type name.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The type ‘PublishToWeb’ is ambiguous: it could come from assembly ‘C:\Inetpub\vhosts\arctic-it.com\httpdocs\bin\App_SubCode_HTMLService.DLL’ or from assembly ‘C:\Inetpub\vhosts\arctic-it.com\httpdocs\bin\DotNetNuke.Modules.Html.DLL’. Please specify the assembly explicitly in the type name.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The type ‘PublishToWeb’ is ambiguous: it could come from assembly ‘C:\Inetpub\vhosts\yourwebsite.com\httpdocs\bin\App_SubCode_HTMLService.DLL’ or from assembly ‘C:\Inetpub\vhosts\yourwebsite.com\httpdocs\bin\DotNetNuke.Modules.Html.DLL’. Please specify the assembly explicitly in the type name.]

   System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +325

System.Web.UI.SimpleWebHandlerParser.GetType(String typeName) +126

System.Web.UI.SimpleWebHandlerParser.GetTypeToCache(Assembly builtAssembly) +65

   System.Web.Compilation.SimpleHandlerBuildProvider.GetGeneratedType(CompilerResults results) +51

   System.Web.Compilation.BuildProvider.CreateBuildResult(CompilerResults results) +45

   System.Web.Compilation.BuildProvider.GetBuildResult(CompilerResults results) +13

   System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +8732935

   System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261

   System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101

   System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +83

   System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath) +10

   System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context) +43

   System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath) +180

   System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +47

   System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +193

   System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93

   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Solution

The solution is simple.

In the \bin directory on your DNN website is a file called: App_SubCode_HTMLService.dll

After backing up this file (just to be safe), then delete the file App_SubCode_HTMLService.dll from the website. This should fix the issue.

Digg This

DotNetNuke Performance Settings

Much has been written about the DotNetNuke performance settings, and well frankly the is a lot of bad information running around the web about what all the settings mean and do.

I’m not about to jump into a discussion, but rather tell you what we believe are the best settings for a public facing website hosted from a Windows 2008 servers without a proxy.

First of all you will need to determine if the web server IIS settings have been configured to compress data servers from your site. This is easy.

1. Login as host and look in the Performance Settings for the “Compression Setting” and ensure it is turned off.

image

2. Then visit this site: http://www.seoconsultants.com/tools/compression 

Enter your URL of the website you are playing with, and check compression. The result will look like this, if your content is uncompressed.

image

or this if it is compressed.

image

Take not of this for later.

3. Go back to your site settings and set them to look like this:

image DNN 4x

image DNN 5x

4. Depending on your compression test above set your site compression settings.

If you site reported: Uncompressed
image

If your site reported: Compressed (anyting)

image

The idea is that, if your IIS is already compressing content, you do not want your DNN compression settings on. It will only slow down performance, however if your IIS is not handling compression, you will find that performance is much improved with compression on.

Summary

These settings will give you good speed performance, but more importantly will not cause cache problems where users updated content but cannot see the changes that they have made. This is a big issued with CMS system that cache in the wrong way, and is a complaint of many DNN users.

Digg This

Site Settings is currently unavailable – Language Not Available

There are a few people around the net with this problem.

Site Settings
Error     Error: Site Settings is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Cannot insert the value NULL into column ‘DefaultLanguage’, table ‘tendollar.dbo.tdb_Portals’; column does not allow nulls. UPDATE fails. The statement has been terminated. —> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column ‘DefaultLanguage’, table ‘tendollar.dbo.tdb_Portals’; column does not allow nulls. UPDATE fails. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at

DotNetNuke Product:          DotNetNuke Community Edition

The DotNetNuke version you are running     05.01.02 (51)

We have posted a solution on our DotNetNuke Knowledge Base website. Search on “Site Settings is currently unavailable”

DotNetNuke DNN Exception Details: System.Web.HttpException: Server cannot modify cookies after HTTP headers have been sent.

We had a client with this error in their DotNetNuke Website:

Server Error in ‘/’ Application.
——————————————————————————–

Server cannot modify cookies after HTTP headers have been sent.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Server cannot modify cookies after HTTP headers have been sent.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:
[HttpException (0x80004005): Server cannot modify cookies after HTTP headers have been sent.]
   System.Web.HttpResponse.BeforeCookieCollectionChange() +8710212
   System.Web.HttpCookieCollection.Add(HttpCookie cookie) +24
   System.Web.Security.AnonymousIdentificationModule.OnEnter(Object source, EventArgs eventArgs) +1792
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

For DNN the problem turned out to be in the Event Log Purge Schedule.

Under Host Settings, login and locate the history of the scheduled item. Check to see if the history shows a fail and shows this errir.

DotNetNuke.Services.Log.EventLog.PurgeLogBuffer, DOTNETNUKE
EXCEPTION: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: Index at Microsoft.VisualBasic.Collection.FastList.get_Item(Int32 Index) at Microsoft.VisualBasic.Collection.get_Item(Int32 Index) at DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.PurgeLogBuffer() at DotNetNuke.Services.Log.EventLog.PurgeLogBuffer.DoWork()

. If it does then apply this.

Turn off this item but untickign the Yes option.

Then go to the HOST / Settings Page and restart the application.

Return to the schedule and re-enable the purge log buffer with it set to perform every 3 min. Check that the schedule process finishes.