Hi, I tried today to install OG for the first time.

First I installed version 7.x-1.0, but very soon I came to an issue: Body fields disappeared on all my site. I found the following topic http://drupal.org/node/973562 #37 advising me to install the dev version.

Now, when I installed OG 7.x 1.x-dev (2011-May-04), I have this message:
PDOException : SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.og_membership_type' doesn't exist : SELECT base.id AS id, base.name AS name, base.description AS description, base.status AS status, base.module AS module FROM {og_membership_type} base; Array ( ) dans EntityAPIController->query()

...and my site is down (thank god Backup and migrate exists).

Any idea? Thx

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

Did u run update.php?

lahode’s picture

Normally, I would not need if the installation is not an update of module, but yes I tried.

I tried as well to install OG on 2 different sites (2 different servers) and with only Organic Group module without the extensions of OG. Same message.

Then I would not have any access to module setting page, nor to my standard content. I only have access to my "overlay" configuration page.

amitaibu’s picture

Can you attach a db dump so i'll check on my local?

lahode’s picture

Hi problem solved,

The solution was indeed in de DB, I had still few tables related to the previous OG version.

After having deleted them, another none blocking message appeared so I found 4 others tables to delete:
temet_field_data_group_audience
temet_field_data_group_group
temet_field_revision_group_audience
temet_field_revision_group_group

However one question remains: Why did it block me completely? Should the admin not be able to use the update.php function.

Nevertheless, it's ok for me. Thank you again Amitaibu for your prompt replies.

eglobal’s picture

I upgraded from 7.x-1.0 to 7.x-1.1-rc1, I am getting the same error. I did run the database upgrade script; 1 update was successful, the second update #7001 is where I get this error. My entire site is not accessible now.

I see lahode figured out the solution, but I don't understand? Am I supposed to go into mySQL database and directly delete tables? This does not seem right to me? If so, which tables? I see lahode listed 4 tables, but seems like he deleted more than those four. How do I know which tables were old tables?

amitaibu’s picture

Assigned: lahode » Unassigned

@eglobal ,

Is it a dev site -- can you attach the DB dump here so i'll check it?

eglobal’s picture

FileSize
478.63 KB

Yes dev site. Is this what you wanted?

eglobal’s picture

FileSize
316.58 KB

This should be easier to read. Thanks.

amitaibu’s picture

Something is wrong with the export, please export the only tables -- not including the information schema.

eglobal’s picture

FileSize
33.68 KB

I reverted back to before the upgrade. My entire dev site was not accessible and I develop mostly on the weekends. I could not waste the weekend without working.

I did take the last file I attached and deleted what I think is all the unnecessary information (I just left the table names, until the end of the og tables). Can you use this?

eglobal’s picture

My last post attachment contains every table name in my upgraded db. If this does not help for some reason, could I just get a list of group / og tables that my db is supposed to contain (then I will just delete all the others that either have a group or og in table name?)?

Or can I just delete (from phpmyadmin ui) the four listed above in 'lohodes' post? But if I do this, what are the tables 'lohodes' referrers to when he writes "de" DB. What does "de" stand for?
field_data_group_audience
field_data_group_group
field_revision_group_audience
field_revision_group_group

Another option at last resort: If it is not possible to upgrade from the 7.x-1.0 version to the dev version. Could I just remove the groups module altogether, then start from scratch with the group dev module (then just recreate all my content as well)? or is this also going to leave unwanted tables as well?

I am sorry to be such a pain, but all I did was a straight upgrade from the only released version to the dev version and my entire site becomes not accessible. I can't imagine what I did wrong in this simple process?

eglobal’s picture

Attempted upgrade again today with latest dev module. Again failed. When preforming database update, it tells me:
Table 'drupal.og_membership_type' doesn't exist

According to the txt file I posted above the missing tables are:
og_membership' doesn't exist
og_membership_type' doesn't exist
og_migrate' doesn't exist

amitaibu’s picture

Your installation has something wrong, you should re-run og_update_7001(). If you can't change via {system} table og to be 7000, and re-run update.php

eglobal’s picture

I tried many times to re-run og_update_7001. I did not attempt to change to 7000. But yeah, something was definitely wrong. I had other problems with my og installation. Anyway, I started with a clean Drupal install with new database. I am new to Drupal so the practice does not hurt. Now running the dev version of og. Looks like everything is working well. All field_data_group tables are gone, and og_membership tables are there. Thanks for your help and a very useful module.

amitaibu’s picture

Status: Active » Fixed

I think this is fixed. Otherwise, please re-open.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

BrightBold’s picture

I think this is related to the following Drupal core issue: #943772: field_delete_field() and others fail for inactive fields

For people who need to solve similar problems related to OG not uninstalling completely, and who don't have the luxury of starting over from scratch with a clean database, I was eventually able to resolve this by manually deleting all OG-related tables and rows from the database as described in #1182966: Cannot fully uninstall or reinstall OG and then reinstalling OG.

groovyart’s picture

Status: Closed (fixed) » Active

I have the same problem... Can somebody please explain to me HOW to do what you're saying is the solution? Because I'm not very good at this kind of thing, and I've tried everything I can think of and nothing works... And unfortunately I don't understand half of what you all are saying.

Please?

Thanks

BrightBold’s picture

@groovyart -
I wouldn't recommend doing what I did unless you're comfortable using phpMyAdmin or directly messing with your database in some other way, because you could make your problems much worse (and irrevocably break your entire site) if you delete the wrong thing. So definitely make a backup of your database before you try anything! But that said, here's what I did, if I remember correctly:

  1. Disable (uncheck on the Modules page) and then uninstall any modules dependent on Organic Groups from the Uninstall tab found at /admin/modules/uninstall.
  2. If you can similarly disable and then uninstall Organic Groups, do that. Otherwise manually delete the OG module folder (using your FTP program or cpanel or however you do those things.)
  3. Using phpMyAdmin, I deleted (or "dropped") the following tables from the database by clicking the red X in its row:
    • og
    • any other row starting with og_
    • all rows starting with "field_data_group_", "field_data_og_", "field_revision_group_", and/or "field_revision_og_"
  4. Then I scrolled down to the "system" table row and clicked the "browse" icon. I scrolled through the results until I found the "og" row and other rows starting with "og_" and deleted (dropped) those rows.
  5. Then I went back to browsing all tables in the database (by clicking on the name of the database at the top of the left-hand column) and browsed the field_config table and the field_config_instance table, found rows in each of those containing "group_" or "og_" and deleted those rows.

Once I had done this I was able to successfully reinstall OG. Good luck!

groovyart’s picture

Thank you SO much! I actually understand that, and I'll be sure to back it up... My only problem now, is that I cannot access my modules page to disable it, because I am locked, so to speak, out of my website completely. I can access Cpanel, but that's absolutely it.

Thank you SO MUCH for taking the time to help me, I know it's better to work on big problem than simply explaining an already solved problem.

BrightBold’s picture

@groovyart — If you delete the module files and database tables/rows, that should effectively disable it (I believe it's the System table that tells Drupal which modules are enabled, so getting rid of that OG row is key!), so if you can't get to the modules page you should be able to just go ahead with the rest of the steps. I just figured that any parts that could be done through the UI should be.

You are welcome for the help. I came to Drupal without much knowledge of mySQL or PHP, and I have learned a lot with the help of the community, so I like to pass it on and help other people grow their knowledge as well!

groovyart’s picture

Okay, I did everything you told me to. Unfortunately, there's STILL more issues.

I've got to my site, but after I logged in I got this error:

"Fatal error: Call to undefined function og_membership_type_access() in /home/groovyar/public_html/sites/all/modules/entity/entity.module on line 418"

Sorry it took so long to reply, it's been a really busy week.

Thank you again for your help... This is VERY confusing to me.

---------------------------------------

UPDATE:

I think I made it worse. Goes to show, if you don't really understand something, DON'T try to fix it.

Because it was the entity module that was causing the issue, I did what you kind of told me to do with the OG module. However, upon removing that I got this error:
Fatal error: require_once() [function.require]: Failed opening required '/home/groovyar/public_html/sites/all/modules/entity/includes/entity.inc' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/groovyar/public_html/includes/bootstrap.inc on line 2701

So, I added entity again and got the same error as before the update. So, I added og again and it said my site couldn't be found.

Server error
The website encountered an error while retrieving http://groovyart.net/. It may be down for maintenance or configured incorrectly...

 HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

My site didn't say that per say, but my browser did.

Then I reinstated Fusion (which is why I had to enable og which caused the problem in the first place), and it went back to the beginning. and all it says is that there's an "unexpected error please try again later." Doesn't say what error it is.

So yeah, I messed with it and made it worse.

litzastark’s picture

I've been attempting an upgrade from D6 to D7, and kept getting the error described here NOT when running update.php, but just when trying to enable the module.

My solution was to remove the "og" entry from the "system" table (e.g., "DELETE FROM system WHERE name='og';"). After doing this, I was able both to install the module and update the database.

jaesperanza’s picture

Issue summary: View changes

I don't understand but after 3 years this issue seems to be active still, and the error PDOException : SQLSTATE[42S02]: Base table or view not found still persists on a clean install (I've used Drush installing the module).

In my case, issue rears its ugly head after running update.php (drush and web backend) after og module installation. What worked though for me is, instead of uninstalling the module (and doing a nasty cleanup of tables referenced), I simply disabled then re-enabled the module, cleared the cache, tested update.php and the error went away.

An additional simple note for those stuck with this issue.

krishnaveni.t’s picture

Thank you amitaibu.
#1 worked for my case.