Massive amounts of comments, Comment manager in 2.0rc doesn't show

Dec 2, 2010 at 1:32 AM

I recently upgraded one of my more "ignored" blogs and it all works fantastic. This is an XML-based site but I'm having one problem. When I go to the comments page to moderate comments it says in the tab that I have 23,727 to moderate but when I click on that moderate tab, it says "There are no pending comments.". This is with Chrome browser and after following instructions to upgrade... Same goes for the 48 approved (I get "There are no approved comments.") and Spam (which probably rightly says 0 at this point.

 

Any assistance would be greatly appreciated!

Coordinator
Dec 2, 2010 at 2:19 AM

Do you think there could be 23,727 comments?  Do you have a lot of posts?  Have you received a lot of comments and/or comment spam up till now?  Does 48 approved comments sound about right?

What happens if you use a different browser (i.e. not Chrome).  Is it working the same with other browsers?

The only thing I can think of now is that maybe there's some unexpected data in the comments that is causing an error to occur while trying to display the comments ... leading to no comments coming up and you seeing the "there are no comment" messages.

Dec 2, 2010 at 6:38 AM

I think the number of pending and approved comments is probably quite right (as I mentioned, this is a site that has been "ignored" for over a year in terms of moderating comments.

I've tried this in Chrome as well as IE 8 (in normal and compatibility mode) as well as the latest Firefox. All exhibit the same problem. 

There are only 38 or so posts so I suppose I could just open up each Post's xml file and blow away the comments as a way around this...

BTW - When I go to individual posts when I'm logged in I'll see all of the comments show up on the page waiting for moderation so they can't be THAT messed up.

Dec 2, 2010 at 6:38 AM

BTW Ben, CONGRATULATIONS to all the team on 2.0rc. This is a rockin' release so far!

Coordinator
Dec 2, 2010 at 7:11 AM

Yeah, thanks, it's coming along well so far.

If you have Fiddler or Firebug, you could check to see if there are any server error 500's coming back from the server when you view the comments.  The comments are loaded right after you get to the page via a separate AJAX call to retrieve them and populate the page.  Two possibilities are that an error is occurring server side ... in this case, you would see a 500 return code when "LoadComments" is called.  A 2nd possibility is that after the comments have been retrieved successfully from the server, when they are displayed on the page, an error could be occurring there (a JavaScript error).  For this 2nd case, you would probably see an error reported in the Firefox "Error Console".  Or in IE, it would show an error in the bottom left corner of the status bar.

I do see that on dotnetblogengine.net, we have a few hundred comments.  They are pulling up without an error.  But it sounds like you have a lot more comments.  It's possible that one or two bad comments could be spoiling the entire process.  By "bad", I'm thinking of unexpected data like a missing IP address or something along those lines that the new BE 2.0 code isn't prepared for.

Or you could delete the comments manually, like you brought up.

Dec 2, 2010 at 3:24 PM

You are correct, I'm getting a 500 server error on the Ajax. For example, on the approved page I get (according to Fiddler):

HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Length: 91
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
jsonerror: true
X-Powered-By: ASP.NET
Date: Thu, 02 Dec 2010 16:16:08 GMT
{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}

and I get the following from the Pending page:

HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Length: 91
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
jsonerror: true
X-Powered-By: ASP.NET
Date: Thu, 02 Dec 2010 16:19:32 GMT
{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}

Interestingly, it happens on LoadPager and not on LoadComments for calls to either Pending or Approved. If you want, I can send up sample post pages (as I said, there are only 37 of them) if you think you need to evaluate them or use them for internal testing. In the meantime, I think I'll remove them all manually from the live site.

MJG

Coordinator
Dec 2, 2010 at 6:00 PM

That's good information.  I just PM'd you.  If you still have the posts and could reply to that, attaching some or all of the post XML files, I'll put it on my system and see where the error is occurring.  This would be helpful to iron out any problems before BE 2.0 is released.

... thanks ...

Dec 2, 2010 at 6:32 PM

Forgive my ignorance, but I'm not seeing where I would get notification or pull down a PM in codeplex. I'll gladly send you the original files in a zip file just not sure how to get that to you. 

Dec 2, 2010 at 6:36 PM

NM. I see that it comes through as an email. I've replied and am sending you the files now.

On another note, to manually delete them, would I just remove all the comments from each XML file in Posts? Is there any other file that needs to be reset? I get weird behaviors in my site after doing the above. (Oh yeah, I touched the web.config to trigger the cache to reset as well).

Coordinator
Dec 2, 2010 at 7:03 PM

Yes, it's not much of a PM system here.. !  But thanks, I got the ZIP.

If I create a new post, in the XML file, the comments look like:

<comments />

Actually, the entire XML file is pasted below.  So you should be able to remove all the comments by removing the entire <comments> .... </comments> section, and leaving just <comments />

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<post>
  <author>Admin</author>
  <title>test 1asdfasfd</title>
  <description />
  <content>&lt;p&gt;aaa&lt;/p&gt;</content>
  <ispublished>True</ispublished>
  <isdeleted>False</isdeleted>
  <iscommentsenabled>True</iscommentsenabled>
  <pubDate>2010-12-02 12:59:00</pubDate>
  <lastModified>2010-12-02 12:59:46</lastModified>
  <raters>0</raters>
  <rating>0</rating>
  <slug>test-1asdfasfd</slug>
  <tags />
  <comments />
  <categories />
  <notifications />
</post>

Coordinator
Dec 2, 2010 at 7:23 PM

I put all your posts in my App_Data\posts folder, and it's actually working for me -- no errors  :)

BUT, I'm looking at the LoadPager code and see one spot that could cause the error you're getting.  What version of BE was your old version (before upgrading to 2.0 RC) ?  Since 1.6 (or maybe 1.6.1), there's a "Comments per Page" setting.  If you had an older version of BE (e.g. 1.5), that setting didn't exist, so it's probably defaulting to 0 on your blog.  One thing LoadPager does, is it divides the number of comments by the "Comments per Page".  Dividing by 0 will throw an error, and when testing by forcing it to 0, it appears to throw the same error you're seeing.

So, I will make a change so it avoids this situation (dividing by zero), by probably setting up a default.

If you were to check your settings.xml file in the App_Data folder, look for <commentsperpage>.  If it's missing, then it would be defaulting to 0.  If it is missing, you can add it easily.  Go into the control panel, Settings -> Comments, .. there will be a "Comments per Page" dropdown list.  It'll probably show "10", but this is just the default dropdown list value.  At this point, if you just click "Save" at the bottom, that will set <commentsperpage> in your settings.xml file to 10.  And then, I think the comments will start working.

If this is not the situation, please let me know.  But at any rate, I think it's best that I setup a default so a division by zero error doesn't occur.

Dec 2, 2010 at 7:40 PM

That makes sense. In this particular instance, I was coming up from 1.5.0.7 I believe so it could have been the dreaded divide by zero issue.

 

Coordinator
Dec 2, 2010 at 7:40 PM

For the record, a default for "comments per page" is now in BE 2.0.0.11.

Coordinator
Dec 2, 2010 at 7:41 PM

Ok, yeah, so if you still have all those comments, try Saving the Comments settings page so a value gets saved for "comments per page", and then (fingers crossed), you should be able to view all thousands of comments from your blog fans .. :)

Dec 2, 2010 at 10:22 PM

Doh, that worked. I was in  the middle of deleting and the resetting the pages to test one page at a time ('cause I messed things up when I did all at once) so I just tried this 25 approved and 15785 awaiting approval and they pop up in admin just like they should.

Great time Ben. Thanks!

Dec 27, 2010 at 9:53 PM

I was helping another blogger out with similar problem but the suggested change didn't seem to work for him. The 500 server error returned was:

{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}

Not very use, I know. I've tried, through the admin interface, to change the number from 5 to 10 to 15 to 20 to 50 with no affect.

Just in case you had any thoughts on the subject before I went in and started deleting comments from the posts manually...

Coordinator
Dec 27, 2010 at 11:23 PM

Before you found with Fiddler that the error was occurring with LoadPager, and not LoadComments.  Just wondering if the error is occurring with LoadPager in this case too?  Knowing this might help narrow down where to look for the problem.

Dec 28, 2010 at 3:11 PM

Of course it would, sorry 'bout that.

The error is occurring in /admin/Comments/Approved.aspx/LoadComments

Don't have similar problems in Pending or Spam, just Approved.

Is that an indication that I've got some bad XML in one of the blog entries?

Dec 29, 2010 at 5:16 PM

As I was going through the data files, one at a time, I found one that had a comment with a massive amount of links and text and it included a number of high order characters that looked like chinese or japanese characters. After deleting this one comment manually, I'm able to get into the manager again.

Thanks so much for your help and continued work on this great platform!

Coordinator
Dec 30, 2010 at 6:59 AM

Sorry, I missed your message from the other day.  But saw it now, plus your latest message.

Thanks for the report, glad you have it working.  I'll test out putting a bunch of characters like that in a comment to see if I can reproduce this type of problem.