Hi,
I just updated my CS 2.1 site from SP2 to SP3.All seemed to work perfectly until I tried to view a forum post from a search result.
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.
[NullReferenceException: Object reference not set to an instance of an object.] CommunityServer.Discussions.Controls.SinglePostView.AttachChildControls() +2034 CommunityServer.Controls.TemplatedWebControl.CreateChildControls() +90 System.Web.UI.Control.EnsureChildControls() +87 CommunityServer.Controls.TemplatedWebControl.DataBind() +7 CommunityServer.Discussions.Controls.SinglePostView.DataBind() +39 CommunityServer.Discussions.Controls.SinglePostView.OnLoad(EventArgs e) +65 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
It finally turned out to be a general behaviour when a user tries to access a forum post via ShowPost.
It's obviously a bug in SP3.And I think I found the cause of the problem:In SinglePostView.cs, line 215, InitializeChildControls is called whether all countrols are found in the calling page or not.The problem is that when a post is displayed in a non-threaded view via View-SinglePostView.ascx, the StatusRepeater control doesn't exist, which causes the exception since InitializeChildControls assumes StatusRepeater always exists.
Unfortunately, I don't have VS2005 to try to fix it and compile a version of CommunityServer.Discussions.dll.
Could anyone have a look at that issue? It's a bug that affects a very frequently used functionnality of CS and thus can be considered as critical.I hope it will be fixed quickly, it's pretty annoying.
Thanks.
Cheers
I believe that this was resolved yesterday, and the binaries updated in the SP3 download. Could you please download the update and reapply the contents of the bin folder.
Thanks
Dave
Hi Dave,
The bug is only partially solved: it now works but only with registered users.Anonymous users clicking on a single post link are still having a NullReferenceException.
Since search engines bots are anonymous, sites are being bombed with exceptions for each linked post.
Hope it's gonna be fixed soon.
I have asked a Telligent team member to have a look at this for you.
Regards
I am unable to reproduce this issue with a local SP3 install. Can you give me an example of a url that does not work for an anonymous user. Also, is your site live somewhere where I can view it. Is this the same exception that anonymous users get or is it different?
Thanks,
Wyatt Preul
Server Error in '/portal' Application. Object reference not set to an instance of an object. 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.NullReferenceException: Object reference not set to an instance of an object.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: [NullReferenceException: Object reference not set to an instance of an object.] CommunityServer.Discussions.Controls.SinglePostView.DataBind() +2902 CommunityServer.Discussions.Controls.SinglePostView.OnLoad(EventArgs e) +66 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
[NullReferenceException: Object reference not set to an instance of an object.] CommunityServer.Discussions.Controls.SinglePostView.DataBind() +2902 CommunityServer.Discussions.Controls.SinglePostView.OnLoad(EventArgs e) +66 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
My site is http://www.guwiv.com/portal
I set up my customErrors parameter to "off" so that you can see by yourself.
As my website has about 1500 single visitors a day, while waiting for a fix I had to use a workaround to avoid using URLs in the form of mysite/forums/post/xxxx.aspx by modifying the post_Single url rule in the siteurls.config file to behave the same as the post url rule (which creates other problems which are less serious for the time I wait for the fix).For the moment I undid that workaround so that you can see the bug by yourself.
Examples of urls that throw the exception for anonymous users:
http://www.guwiv.com/portal/forums/post/1118.aspxhttp://www.guwiv.com/portal/forums/post/1577.aspxhttp://www.guwiv.com/portal/forums/post/1008.aspx
Of course the posts exists, if you replace /post/ by /thread/ you will actually see them within the thread they belong to.
Let me know if I can do anything else to help to fix that bug.
Thanks for your help.
Hi Wyatt,
Did you have the chance to test the bug on my site?CustomErrors is still set to "off" so that you can see for yourself.
Yes I did get a chance to look at it over the weekend. Have you made any changes to your SiteUrls.config file?
From the look of the URL it appears that it is incorrect if changing "post" to "thread" resolves the issue and it is apparently passing the thread ID. You may try changing your SiteUrls.config entry for "post_Single" so that it looks like the following if it currently doesn't
<url name="post_Single" location = "forums" path = "post/{0}.aspx" pattern = "post/(\d+).aspx" vanity="ShowPost.aspx?PostID=$1" />
Please check your SiteUrls.config changes and make sure that the Forums URLs are all correct and that you do not have another entry with the pattern of "post/(\d+).aspx"
Let me know if you have any questions,
I had made a change to my SiteUrls.config file but that change was reverted to its standard default when the SP3 was released again after the first fix.
During the whole week-end and still now, the SiteUrls.config file is still the default one. The change I had made before was just an attempt to avoid exceptions for my users. If you tested my site that week-end, it wasn't the "modified" version, it was with the standard default SiteUrls.config.
So, the current post_Single entry in my SiteUrls.config file is still the default one and it has been so during the whole week-end:
And it's the only entry with the "post/(\d+).aspx" pattern. And as you can see, with that configuration, the links are still crashing.
I made a test account available for you so that you can see by yourself teh different behaviour for registered users. I sent you a PM with the username and password for that account.
Any other idea?
Whenever I tried the test account I saw the same error message. The issue appears to be that the URL is incorrect, as changing post to thread fixes this issue. Also, what pages are creating these links? I was unable to find a page that was creating these URLs, perhaps that could be part of the issue, maybe the skin that you are using is using the incorrect URL to link to posts.
Also, you may want to make sure that you updated all of the files that were contained in the SP3 packages Web folder, just to be sure. You might try changing the above url entry in the SiteUrls.config to say thread instead of post in the path and pattern. But first try and track down the pages that are generating these incorrect links and make sure that they are indeed using the correct URL entry. My bet is that they should be using a different entry, such as one for showing a thread since they are passing in a Thread ID.
This is weird, I don't have any message when using the Test account, the posts appear correctly. (see the screenshot linked, note the URL displayed in the IE address bar)I asked some registered users and they never have the problem, only anonymous users seem to have the exception message, which makes me think that it's not an URL entry issue.
These links are taken from simple search queries or browsing by tags using the tag cloud on the main page. You can try to browse the tag cloud until you reach a forum post, try it logged in with Test and as anonymous, you should see what I'm talking about. Any link in the form of http://www.guwiv.com/portal/forums/post/xxxx.aspx throws an exception for anonymous users and works for registered ones.With the exactly same configuration, all was working fine with SP2.
The exceptions log as well contains a lot of these links triggered by the google bot since I updated to SP3. I already checked that all files from the SP3 folder were updated, but I will double check.
Hi again,
Moreover, to be sure that url substitution is not interfering you can try to access the posts using ShowPost.aspx.
For example:http://www.guwiv.com/portal/forums/ShowPost.aspx?PostID=1118http://www.guwiv.com/portal/forums/ShowPost.aspx?PostID=1577http://www.guwiv.com/portal/forums/ShowPost.aspx?PostID=1008
I think the exception thrown when using these links as anonymous clearly show that the problem is in SinglePostView.cs.
I found something new that may help you identify the problem: the exception occurs for registered users too, but only with certain roles.After a few tries with different roles, I found that users with at least Moderator role don't have the exception.
I added the Moderator role to the Test user so that you can see it by yourself.
Hope that helps.
Any news?
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com