Hi folks,

I run into a problem when I tried to update a module. It seems that some updating in the database cannot be made and some other problems occurred have caused my site to shut down.

My question is, if database updating fails with some major problems after updating a module with the latest version, and the problems can’t be properly fixed to make things go back to normal again, is it a good solution to remove the module folder and delete the tables for that module from the database using phpmyadmin, under the circumstance that no backup is made and the site is already shut down?

Eager to know your thoughts on this. Thanks in advance!

Comments

vm’s picture

set the module's status to 0 as well as any modules that are depdent on the one being disabled to 0 in the system table of the DB.

Doing this should disable the module then allow you to run a proper uninstall once you can get back into the site.

DrupalDan’s picture

Thank you for your quick response VM. I'd like to try that but but is it safe to do that? And can you tell me what will happen if that module is set to 0 and disabled? I mean, if that module is the cause, then after disabling it the site will run like normal again despite of the problems that have not been addressed, which allows me to uninstall the module then, correct? And is there anything else I need to do with DB after the module is uninstalled, I mean, will those tables directly related to that module itself just be automatically deleted?

Thanks again.

DrupalDan’s picture

Thank you for your quick response VM. I'd like to try that but but is it safe to do that? And can you tell me what will happen if that module is set to 0 and disabled? I mean, if that module is the cause, then after disabling it the site will run like normal again despite of the problems that have not been addressed, which allows me to uninstall the module then, correct? And is there anything else I need to do with DB after the module is uninstalled, I mean, will those tables directly related to that module itself just be automatically deleted?

Thanks again.

**********
Sorry for this deplicate post; I refreshed the page when 503 service problem occurred after I saved the post.

vm’s picture

safe is relative to the effectivness of the processes involved with incremental backups of a database before any major changes to the environment. Statistically it's likley safer to say that having a working backup of a database before changes are made would be considered significant to the alternative of no backup or a non-working backup. :)

Setting the modules status to 0 in the system table manually, effective does what disabling the module in administer -> modules when using the checkbox and saving the modules form.

With the above advice, it is hopeful that the dblog.module will discontinue causing an error so that you can further debug. Preferably in a -dev environment of some kind, so that you limit any further risk to the production database. (considernig the assumption is there is no database backup from before the updating of modules as your question states to approach.)

uninstalling the module, by using the uninstall tab in drupal, runs the necessary uninstall routine in the form of code to disable and alter the database as necessary (remove tables, row entries in other tables).

simply removing the folder and removing the tables in the DB can in some cases cause other issues, which cause drupal to throw other related errors. The object is to try to eliminate errors to find the root cause.

in finding the root cause, I'd take the backup of the DB dblog disabled.
I'd import it into a -dev environment to perform further debugging.

if you don't have a direct need for the data collected by dblog module: you can run the uninstaller and empty the watchdog table in the DB. (provides a clean slate in case of further errors.)

you can then re-enable the module and test.

DrupalDan’s picture

Thanks VM. Your response makes things very clear and easy to understand. Very helpful!

I just made the change in the module status, but the previous problems persist and the error page still prevents me from logging and doing something about it. I think dblog.module still works and gives an error.

Below is the error messages I got, before and after I change the module status. I'm not a programmer and don't quite understand what that mean. Do you think now I can proceed with disabling the dblog module, or there's something else I should do first?

Warning: PDOStatement::execute() [pdostatement.execute]: MySQL server has gone away in DatabaseStatementBase->execute() (line 2136 of C:\wamp\www\includes\database\database.inc).
Warning: PDOStatement::execute() [pdostatement.execute]: Error reading result set's header in DatabaseStatementBase->execute() (line 2136 of C:\wamp\www\includes\database\database.inc).
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT menu_links.* FROM {menu_links} menu_links WHERE (module = :db_condition_placeholder_0) AND (router_path = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => system [:db_condition_placeholder_1] => admin/config/content ) in admin_landing_page_access() (line 164 of C:\wamp\www\sites\all\modules\admin\admin.module).

Uncaught exception thrown in session handler.
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in _drupal_session_write() (line 209 of C:\wamp\www\includes\session.inc).

Many thanks!

vm’s picture

are you sure MQL server is running?

have you tried restarting mysql server?

DrupalDan’s picture

Yes. I use Wamp and after I made that change, I did "Restart All Services". Those errors are already there ever since the module updating went wrong.

vm’s picture

DrupalDan’s picture

Hi VM, my site seems to be back to normal for some reason I can't say for sure. However, as I installed DB maintenance I did try to optimize db with that module, and I noticed that someone else running into some similar problem with "MySQL server has gone away" did the same thing and it resolved the problem ( http://drupal.org/node/163145), so I guess that could be the reason.

Thank you so much for everything!

DrupalDan’s picture

I enabled the module that could be the cause of the problem, and then the same errors came, so I think there's still something wrong with my site or db. The module maintener thought it has nothing to do with the module, and told me that "MySQL server has gone away" is really very bad and usually that means mysql is actually crashing, which makes me very nervous. Anyway, I think I will make another topic specifially addressing this problem and hopefully I can get some help from some MySQL expert.