I enabled Mollom and set up 3 forms. I disabled but now when re-enabled I get this error message:

"DatabaseSchemaObjectExistsException: Table mollom already exists. in DatabaseSchema->createTable() (line 657 of /Users/myusername/mywebsite/docroot/includes/database/schema.inc).
The website encountered an unexpected error. Please try again later. "

I'm using the Acquia Drupal distribution (which has the Mollom module in profiles > acquia > modules directory)

I tried to replace the module, clear cache/update.php/run cron but to no avail.

Comments

SunRhythms’s picture

Its your database... The Table is the actual Table in the database. It basically means there is a mismatch in data from your original database file and the one you currently have, but unfortunately it can't overwrite it. You have to actually uninstall the module and all of its required modules, fields, and other components and then delete the table item out of the MySql database then reinstall the module if you need it (unless you know how to rewrite the sql table information that is needed yourself, I'm assuming)...

Horroshow’s picture

Thanks SunRhythms, your post helped me a lot. Drupal returned exactly the same DatabaseSchemaObjectExistsException error ja_design mentioned when trying to use the Title module. I couldn't replace the title entity for a field.

I did exactly what you suggest:
- Uninstall the module from the Drupal (in my case Title module) and removed it from my Modules folder
- Launch PhpMyAdmin, find and drop the table mentioned in the error (in my case field_data_title_field and just in case I also dropped the field_revision_title_field too)
- Install the Title module again

sun’s picture

Category: bug » support
Status: Active » Closed (cannot reproduce)
Issue tags: -Mollum

Unfortunately, I'm not able to reproduce this error.

This normally should not happen, since you state that you only disabled the module. Disabling a module does not drop the module's database tables, and re-enabling a module does not re-install the module's database tables.

Something else in your site's setup must have gone wrong, unrelated to the Mollom module.

SunRhythms’s picture

Sometimes uninstalling doesn't work. Unfortunately, in my case, there was a problem with backup-migrate holding on to tables after a new reinstall of the database.. I don't know why it happened but I knew that the tables were still there after I uninstalled the module and still had the error message after reinstall.

mexicoder’s picture

Hi @SunRhythms, glad I stumbled across your post,was running into exactly the same issue. There is more about it here On restore, delete tables that didn't exist at time of backup

mexicoder’s picture

Issue summary: View changes

For privacy concerns I replaced my name/website with generic paths

cooldeeponline’s picture

Issue summary: View changes

just clear your cache, it goes.

kerrycurtain’s picture

Confirming that #6 works perfectly, thanks cooldeeponline. May have to repeat this after every error if you have multiple modules involved.

oakulm’s picture

I also got this error when migrating db from server to server. #6 did the trick how ever.

gbrands’s picture

Clearing the entire cache never worked for me; it would always error out before the issue was resolved. However, manually emptying the 'cache_field' table solved my issue with the table already exists warning:

MySQL:

truncate table cache_field;

Drush:

drush sqlq "truncate table cache_field"