Monday, 3 September 2007
MT comment/plugin problem fixed
Fixed the Movable Type comments problem.
Short version: a MySQL table needed repair. Don't know why it went bad, but fixing that part made everything work. Long version/gorier details below the fold, in hopes of helping out anyone afflicted with similar.
In other tool talk, I'll definitely be waiting to upgrade to MT4 'round here. Glen's had a mostly good experience but still randomly has to re-run the upgrade (which is ... unusual), and Scalzi had a very rough go. That doesn't necessarily mean that I would too, but his report that you can paste rich text into MT's editor and have it CRASH the application really convinces me to wait until the next dot-release. Really not confidence-inspiring.
On top of that, I'm really not sure about staying with a tool from the company that undertook such a bizarre orgy of account suspensions recently (at LiveJournal) and has had major trouble undoing a number of inappropriate suspensions, let alone explaining itself in a timely or persuasive fashion during the whole affair.
But, given that the activation energy required to migrate to a new platform is so high (WordPress? eh.), inertia wins for now. MT3, I tolerate you.
The error message when trying to load the comment form was:
Statement has no result columns to bind (perhaps you need to successfully call execute first)
at lib/MT/ObjectDriver/DBI.pm line 108. at lib/MT/Plugin.pm line 332
Based on a hint in the MT change history, I added the line to mt.cfg:
DebugMode 1
That made the error much more verbose:
Statement has no result columns to bind (perhaps you need to successfully call execute first) at lib/MT/ObjectDriver/DBI.pm line 108.
MT::Object::__ANON__('MT::PluginData','HASH(0x8b2b598)') called at lib/MT/Plugin.pm line 332
MT::Plugin::get\_config\_obj('MT::Plugin=HASH(0x8ab43d8)','system') called at lib/MT/App/CMS.pm line 5731
MT::App::CMS::build_plugin_table('MT::App::CMS=HASH(0x87a1e40)','param','HASH(0x86fab90)','scope','system') called at lib/MT/App/CMS.pm line 5641
MT::App::CMS::list_plugins('MT::App::CMS=HASH(0x87a1e40)') called at lib/MT/App.pm line 667
eval {...} called at lib/MT/App.pm line 620
MT::App::run('MT::App::CMS=HASH(0x87a1e40)') called at lib/MT/Bootstrap.pm line 71
eval {...} called at lib/MT/Bootstrap.pm line 56
MT::Bootstrap::import('MT::Bootstrap','App','MT::App::CMS') called at /usr/www/users/bogart/1/mt.cgi line 11
main::BEGIN() called at lib/MT/PluginData.pm line 11
eval {...} called at lib/MT/PluginData.pm line 11
Looking through the code behind those functions led me on a wild goose chase through: ObjectDriver.pm, ConfigMgr.pm, Plugin.pm, ObjectDriver/DBI.pm, ObjectDriver/DBI/mysql.pm, PluginData.pm, ErrorHandler.pm, Object.pm, App/CMS.pm, and Log.pm.
But the main thrust of what I found was, the table it would likely be trying to query was mt_plugindata
.
Logged into mysql
and looked over the contents of the table. Thought the Blacklist plugin's data field might be the problem since it's so comparatively huge, but that was a false lead. Finally this gave me an error (when select * from mt_plugindata
hadn't, minutes before):
mysql> select plugindata_id from mt_plugindata;
ERROR 1034 (HY000): Incorrect key file for table 'mt_plugindata'; try to repair it
Finally, an actual error message about an underlying problem... this command is what fixed everything:
mysql> repair table mt_plugindata;
After that one fix, everything came back. Running queries on the table worked with no error messages, putting the plugins back didn't trigger a single error, etc.
Hope this helps someone else out there. If you're getting the 'no result columns to bind' error, check the state of your tables; something may be in need of repair.
P.S. After fixing that, I've left DebugMode turned on -- not much visible difference during normal operation, but I did see a warning out of the commchallenge plugin:
Use of uninitialized value in concatenation (.) or string at /usr/www/users/bogart/1/plugins/commchallenge/lib/commchallenge.pm line 63.
Haven't submitted a patch (it's a minor error), but one way to fix it is to change the line:
my $preview_val;
to:
my $preview_val = '';
So it's not undefined in the concatenation. Or a better way to fix might be to change it to an sprintf
with a map { defined $_ ? $_ : '' }
before the list of params, but I'm only going to twiddle this plugin so much...
2 comment(s)
test
Just a note that MT 4.01 seems to have fixed my last issue with MT (the constant re-running of the upgrade script). I'm handling less than 2 spam trackbacks a week now (that never go live) and haven't had a spam that I had to delete personally in a month.
Add a comment...