Maintenance

I’m trying to diagnose a problem with my rebuild process. For some reason, the individual archive entry rebuild process isn’t working. I’m able to create a new entry fine, and I’m able to delete comments from entries fine, so it’s clear that Movable Type is able to build an individual entry archive file just fine. I have no idea why the rebuild process is failing though. I keep getting this error:

An error occurred

Can’t call method “created_on” on an undefined value at lib/MT/Template/ContextHandlers.pm line 3764.

Fun stuff, I tells ya. Hopefully, I’ll figure something out, but in the mean time, you may see some strange stuff on the individual entry pages (particularly with respect to the comments, as that seems to be where the problem is localized.)

Update: Very little progress made. The comments are definitely what’s causing the problem. When I remove the code that generates the list of comments, the individual entry archives rebuild fine. When I try to add it back in, bit by bit, I start getting http 500 errors or the original error I was getting above. Somehow, the most recent 30 entries or so have had their comments restored. Beyond that, there’s a lot of older entries that have comments, but those comments aren’t being displayed because I can’t rebuild them without manually rebuilding each entry individually. So if you’re on an old entry and you see “Testing something” where the comments would normally be, don’t worry. The comments are still in the system, but I can’t seem to publish them…

Update 12.15.07: All individual archive pages should be properly displaying comments as of Thursday afternoon. Big thanks to Chad Everett for his help in diagnosing the problem (see comments of this entry for more details). Today, I’ll be adding the CCode plugin to help deal with the spam issue. For the most part, I get around 20-30 spams a day that actually make it through the system and on the site. Every once in a while, a spammer will go nuts and submit a couple hundred on one day. So the weekly grind of having to clean up spam has finally motivated me to do something about it. CCode sounds rather clever. It basically adds a hidden field to the comment form, and populates it with javascript. The whole process is obfuscated, but not impossible to break. I kinda think of it as the pseudo-catpcha that Shamus uses (or the one Aziz uses), except it doesn’t require the commenter to enter anything. The only catch is that you need to have javascript enabled in order to submit a comment. All of which assumes that this plugin will work well. I’m installing this plugin now, so if you have any issues, feel free to drop me an email (tallman_at_kaedrin.com).

6 thoughts on “Maintenance”

  1. That particular line has to do with sorting comments by a created_on value. My best guess would be that you have a comment (perhaps more than one) that has a missing or invalid created_on field. If you have access to phpMyAdmin – or other database management tool – that might be the easiest way to diagnose the problem.

  2. Well, that’s strange. I didn’t notice anything amiss with the created_on fields… but when I went to look at the comments table, I noticed that there were 20,000 spam comments in the db (i.e. marked as spam, not published comments). Rather than page through 20,000 comments, I just deleted the spam folder through MT (which worked fine). That left me with around 2000 comments, which is a little strange, as I only have about 1000 published comments. Nevertheless, it was much easier to browse through the created_on field looking for issues…

    However, I didn’t find anything. Taking the advice of someone else, I did a “check” on my entire movable_type database, but that returned all “OK”

    Finally, I just decided I should try rebuilding – and it worked fine. No idea what was causing the problem, but it must have been one of the comments marked as spam…

    Anyway, thanks again for your help Chad.

  3. Thanks again Chad. I had the spam set to auto-delete after 60 days, so I just made that 21 days. When combined with the just installed CCode plugin, I should hopefully do much better. This is the first comment I’m submitting with CCode enabled, so hopefully it will work…

Comments are closed.