vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What's the best way to remove a corrupted mod? (https://vborg.vbsupport.ru/showthread.php?t=170607)

Guest210212002 02-15-2008 09:22 PM

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

Lynne 02-15-2008 09:34 PM

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.

Guest210212002 02-15-2008 09:40 PM

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. :)

Marco van Herwaarden 02-16-2008 06:50 AM

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.

Guest210212002 02-16-2008 11:54 AM

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!

Abe1 02-19-2008 10:42 PM

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.


All times are GMT. The time now is 07:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01132 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete