Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 02-15-2008, 09:22 PM
Guest210212002
Guest
 
Posts: n/a
Default What's the best way to remove a corrupted mod?

When I upgraded from 3.6.8, I didn't uninstall the post thank you hack before going to Beta 4. The upgrade went fine, and currently my forum is happy, with the 3.6.x version of the hack installed but disabled.

When I try to uninstall the hack, my ACP times out on it. Eventually it'll just give me a proper timeout page, in which case I'll just try again. However I think the uninstall script is half executing.

If I try it a second time, I get this DB error:

Code:
Database error in vBulletin 3.7.0 Beta 4:

Invalid SQL:
SELECT * FROM vb3_post_thanks WHERE postid IN (0,868677,868679,868684,868691,868693,868694,868729,868740,868744,868766) ORDER BY username ASC;

MySQL Error   : Table 'x.vb3_post_thanks' doesn't exist
Error Number  : 1146
Date          : Wednesday, February 13th 2008 @ 08:04:33 PM
Script        : http://www.sevenstring.org/forum/showthread.php?t=48436
Referrer      : http://www.sevenstring.org/forum/site-news-support/
Username      : Chris
Classname     : vb_database
MySQL Version : 4.1.15
And then my vb3_post table gets completely corrupted, and no manner of repairing brings it back to life. The counters for the post table go to zero, my forums die, and I die a little on the inside because my DB is massive and restoring it takes ages.

My members love this hack, and so do I. More importantly, I don't want my install cluttered up with half-installed mods, and just knowing that it's there and disabled is driving me freaking crazy.

All that said, how should I go about removing the corrupted hack? I haven't checked the plugin, and I don't think I'm quite savvy enough to figure out the uninstall routine in it and step through it manually to find where it's actually dying. I think if I can get it cleanly (manually) uninstalled and drop the tables itself I should be good to go, but I assume that it makes some kind of modification to the post table as well that I don't know how to revert - otherwise, why would it kill that table every time the uninstall dies?

Any insight would really be appreciated. *If you can help me solve this, Nexialys will come to your house wearing a toga and mow your lawn, shovel your driveway, and/or change the oil in your car.

*this is a lie
Reply With Quote
  #2  
Old 02-15-2008, 09:34 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, now you are scaring me. I had the post thank you hack installed on my test board (3.6.8) and I have since upgraded the test board to 3.7 (only beta 2, this was a couple of months ago). I had disabled it prior to the upgrade because we weren't sure we wanted it and now I'm afraid to completely uninstall it.
Reply With Quote
  #3  
Old 02-15-2008, 09:40 PM
Guest210212002
Guest
 
Posts: n/a
Default

I don't want to point the finger at Abe's code, because obviously it's a very popular hack that's working well on a ton of sites. I can only say what happened to me personally when I tried to uninstall the old version after I upgraded to 3.7. I see this uninstall code in the XML:

Code:
 <installcode>
- <![CDATA[ 
$db->hide_errors();

$vbulletin->db->query_write("CREATE TABLE IF NOT EXISTS`". TABLE_PREFIX ."post_thanks` (
    `id` INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    `userid` INT(10) NOT NULL,
    `username` VARCHAR(50) NOT NULL,
    `date` INT(10) NOT NULL,
    `postid` INT(10) NOT NULL)
    ");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."post_thanks` ADD INDEX ( `postid` )");

$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."user` ADD `post_thanks_user_amount` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."post` ADD `post_thanks_amount` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."user` ADD `post_thanks_thanked_posts` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."user` ADD `post_thanks_thanked_times` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL");

$db->show_errors();

  ]]> 
  </installcode>
- <uninstallcode>
- <![CDATA[ 
$db->hide_errors();

$vbulletin->db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "post_thanks");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."user` DROP `post_thanks_user_amount`");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."post` DROP `post_thanks_amount`");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."user` DROP `post_thanks_thanked_posts`");
$vbulletin->db->query_write("ALTER TABLE `". TABLE_PREFIX ."user` DROP `post_thanks_thanked_times`");

$db->show_errors();

  ]]> 
  </uninstallcode>
And I think those alter statements are probably part of what's causing my headaches. I've tried uninstalling it cleanly, as well as just installing the new one and letting it overwrite and both yield me the same issue of a hosed post table. My only advice is to definitely back up your forums before trying it.

I'm gong to be a smart puppy this weekend and just port my entire 3.7 install over to my testbed and try to sort it out there before trying anything on my live site, but at the time I didn't expect such a big crash from something as small as uninstalling a plugin. Live and learn I guess.
Reply With Quote
  #4  
Old 02-16-2008, 06:50 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The database error you have posted in the first post does not seem to originate from the uninstall script, so not really related to your uninstall problem:

Script : http://www.sevenstring.org/forum/showthread.php?t=48436

I don't see any major errors in the uninstall script. My guess is that the only error made, is that you thought the script didn't work and canceled it halfway.

If you have large tables, then these ALTER TABLEs can take a long time. Best is to uninstall again, if an error, edit the uninstall code removing those tasks that are already completed from the top, retrying after each change until it runs till the end.
Reply With Quote
  #5  
Old 02-16-2008, 11:54 AM
Guest210212002
Guest
 
Posts: n/a
Default

Thanks Marco. I'm not cancelling the uninstall, eventually my ACP just hits a white screen and the query seems to die on it's own. I'm sure the uninstall script itself is fine, that's just the DB error that I get after I try to uninstall it and it times out.

Edit: Success! I ended up stepping through the uninstall manually in a shell. Woohoo!
Reply With Quote
  #6  
Old 02-19-2008, 10:42 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think this may have to do with what your PHP Memory Limit is.

The uninstall script must have removed the tables but got gotten upto the plug-ins.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:47 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06894 seconds
  • Memory Usage 2,207KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (3)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete