Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumA critical error has occurred. Value cannot be null. Parameter name: valueA critical error has occurred. Value cannot be null. Parameter name: value
Previous
 
Next
New Post
1/9/2008 1:44 AM
 

 

Hello good people of Dotnetnuke, am having the below problem in my forum and have no ideas what's causing it.  This is happening only on one thread and am thinking it's something to do the last post a member posted.

Any help would be much appreciated.

Thanks.  

AssemblyVersion: 04.08.00
PortalID: 0
PortalName:
UserID: -1
UserName:
ActiveTabID: 54
ActiveTabName: Forum
RawURL: /Forum/tabid/54/forumid/6/scope/threads/language/en-GB/Default.aspx
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://www.najivunia.co.uk/Forum/tabid/54/forumid/6/scope/threads/Default.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0; InfoPath.2)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 395be457-f124-42ed-b547-08d0fc4ba42b
InnerException: Value cannot be null. Parameter name: value
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.Caching.CacheEntry..ctor
StackTrace:
Message: System.ArgumentNullException: Value cannot be null. Parameter name: value at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies) at DotNetNuke.Services.Cache.FileBasedCachingProvider.FBCachingProvider.Insert(String CacheKey, Object objObject, Boolean PersistAppRestart) at DotNetNuke.Common.Utilities.DataCache.SetCache(String CacheKey, Object objObject) at DotNetNuke.Modules.Forum.ThreadInfo.GetThreadInfo(Int32 ThreadID) at DotNetNuke.Modules.Forum.Threads.RenderThreadInfo(HtmlTextWriter wr, Boolean AggregatedView)
Source:
Server Name: WEBSERVER

 
New Post
1/9/2008 4:01 AM
 

Please look at this I've tried a few things to no avail, hope someone can help.

Thanks again.

 
New Post
1/10/2008 7:55 AM
 

OK, no replies yet so... How do you go about the solution below...

Thanks...

The Exception logs on dnn.com show a number of errors from trying to cache a null object - for example

Message: System.Exception: Unhandled Error: ---> System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentNullException: Value cannot be null. Parameter name: value at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies) at DotNetNuke.Services.Cache.FileBasedCachingProvider.FBCachingProvider.Insert(String CacheKey, Object objObject, Boolean PersistAppRestart) at DotNetNuke.Common.Utilities.DataCache.SetCache(String CacheKey, Object objObject) at DotNetNuke.Modules.Forum.ForumInfo.GetForumInfo(Int32 ForumID)

and

Message: DotNetNuke.Services.Exceptions.PageLoadException: Value cannot be null. Parameter name: value ---> System.ArgumentNullException: Value cannot be null. Parameter name: value at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic) at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace) at System.Web.Caching.Cache.Insert(String key, Object value, CacheDependency dependencies) at DotNetNuke.Services.Cache.FileBasedCachingProvider.FBCachingProvider.Insert(String CacheKey, Object objObject, Boolean PersistAppRestart) at DotNetNuke.Common.Utilities.DataCache.SetCache(String CacheKey, Object objObject) at DotNetNuke.Modules.Forum.ThreadInfo.GetThreadInfo(Int32 ThreadID)

The
GetThreadInfo code looks like this:

        Public Shared Function GetThreadInfo(ByVal ThreadID As Integer) As ThreadInfo
            Dim strCacheKey As String = ThreadInfoCacheKeyPrefix & CStr(ThreadID)
            Dim objThread As ThreadInfo = CType(DataCache.GetCache(strCacheKey), ThreadInfo)

            If objThread Is Nothing Then
                Dim ctlThread As New ThreadController
                objThread = ctlThread.ThreadGet(ThreadID)
                DataCache.SetCache(strCacheKey, objThread)
            End If

            Return objThread
        End Function

and the GetForumInfo code is very similar.

There are two problems with this code:

  1. There is no check the object returned is not null before attempting to save it to the cache.
  2. The code does not respect the Host users selection for cache performance.

Thus GetThreadInfo should be changed to:

        Public Shared Function GetThreadInfo(ByVal ThreadID As Integer) As ThreadInfo
            Dim strCacheKey As String = ThreadInfoCacheKeyPrefix & CStr(ThreadID)
            Dim objThread As ThreadInfo = CType(DataCache.GetCache(strCacheKey), ThreadInfo)

            If objThread Is Nothing Then
                'thread caching settings
                Dim timeOut As Int32 = ThreadInfoCacheTimeout * Convert.ToInt32(Common.Globals.PerformanceSetting)

                Dim ctlThread As New ThreadController
                objThread = ctlThread.ThreadGet(ThreadID)

                'Cache Thread if tmeout > 0 and Thread is not null
                If timeOut > 0 And objThread IsNot Nothing Then
                    DataCache.SetCache(strCacheKey, objThread, TimeSpan.FromMinutes(timeOut), False)
                End If
            End If

            Return objThread
        End Function

Note: PostInfo has the 2nd issue (performance setting) but does not have the first issue.

 
New Post
1/10/2008 12:34 PM
 

Ok, seems like I have to get used to answering myself in here.  Here we go, after going through loads of threads, I came accross the actual problem and managed to solve the issue for the time being, which means it can happen again soon.

The error occurs when a user session expires while still writing a post, upon submiting the post, the forum changes the UserID to 0 and problem appears from then on.

I managed to change the UserID on that post to the actual users ID using Visual Studio solution explorer et voila!

I still need to sort this problem once and for all though! Maybe the solution I posted above will be able to sort this out?!?!   I Just don't know how to go about doing it.

 
New Post
1/24/2008 1:20 PM
 

Hi DNN Team,

These errors:

InnerException: Value cannot be null. Parameter name: value

and

InnerException: Unhandled Error:

make the dotnetnuke forums unreliable and unusable.

I have now spent hours deleting posts to address these errors and to get my forums up and running again.

What is the resolution for these errors?


Thanks, Bill
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumA critical error has occurred. Value cannot be null. Parameter name: valueA critical error has occurred. Value cannot be null. Parameter name: value


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out