Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When using a custom installation profile, the installation fails with the following error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.media_type' doesn't exist .
Have tried versions 7.x-2.x and get the same error.
Had no problem before media-7.x-1.0 .
This issue is similar to http://drupal.org/node/1311828 which has been closed. The provided patch works, would it be possible to add it to a future version?
Thanks
Comments
Comment #1
Dave ReidSee http://drupal.org/node/1311828#comment-5691576. You'll have to do some debugging and backtracing as to what the cause of the error coming back is.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks for your answer.
However, could you kindly indicate how I should proceed for debugging?
I've tried installing via drush with debug option and get this:
Also, I've tried to remove some of the modules activated in the profile and noticed that the installation succeeds when the linkit module is not activated.
TIA for further help
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedIs there a chance that the change that brought this error will be reverted?
Comment #4
Dave ReidSeeing as you've been one of the only people that has reported this issue, we are still not sure of how exactly this is caused. We'll need to know which functions are in the backtrace when this happens so we can figure out the root cause of it.
Comment #5
Bob123 CreditAttribution: Bob123 commentedI got the same issue during media module installation:
New install:
- drupal-7.19.zip
- ctools-7.x-1.2.zip
- job_scheduler-7.x-2.0-alpha3.zip
- feeds-7.x-2.0-alpha7.zip
- entity-7.x-1.0.zip
- linkit-7.x-2.5.zip
- views-7.x-3.5.zip
- media-7.x-1.2.zip --> Error message during installation "PDOException: SQLSTATE[42S02] ..."
Now my test site is no more accessible: It only shows the very same "PDOException: SQLSTATE[42S02] ..." error!
There is indeed no table named "media_type" in the database.
Do the media module needs it? Who (which module) should create this table?
Please Help...
Comment #6
Bob123 CreditAttribution: Bob123 commented- Replace \sites\all\modules\media\includes\media.types.inc temporary by an empty file to re-gain access to the site.
- Unable media module.
- Unable linkit module.
- Replace the empty \sites\all\modules\media\includes\media.types.inc by the original file.
- Enable media module --> Seems OK, 3 media_ Tables has been created: media_filter_usage; media_list_type; Media_type.
- Enable linkit module --> Seems OK.
So this seems to be an incompatibility problem between the linkit module and the media module... : Enabling first the media module and afterwards the linkit modules seems to be OK.
Comment #7
mo3.mo3 CreditAttribution: mo3.mo3 commentedi had similar errors and i got everything to work after i ran /update.php
give it a try!
Comment #8
cwebster CreditAttribution: cwebster commented@Bob123: Thanks so much that saved my site.
Comment #9
genebobmiller CreditAttribution: genebobmiller commentedI've got the same error on install but I don't use the linkit module. I'll investigate further
Comment #10
wxman CreditAttribution: wxman commentedSame here. I had to use the empty media.types.inc solution to fix, and I don't have linkit.
Comment #11
jcallanan CreditAttribution: jcallanan commentedI am getting the same error with an install of the Open Atrium 2 distribution and can't figure out how to resolve it. The error message is:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'stagnito_intranet.media_type' doesn't exist: SELECT mt.* FROM {media_type} mt ORDER BY weight ASC; Array ( ) in media_type_get_types() (line 134 of /home/stagnito/public_html/intranet/profiles/openatrium/modules/contrib/media/includes/media.types.inc).
I've tried removing the Media module and the Linkit module, then added them back, and run update.php but still getting the error. Any ideas?
Comment #12
aken.niels@gmail.comWe've got the same error with our installation profile. Removing dependency of Linkit also resolved the problem here.
Comment #13
kendouglass CreditAttribution: kendouglass commentedSimilar to others above. I install any recent version of media. Then I uninstall it. Even with the module uninstalled I'm getting these errors"
Comment #14
lucasfazzi CreditAttribution: lucasfazzi commentedI don`t know if i will say something wrong but i will try...
Acces directly yoursite.com.br/install.php , i think it`ll works !! But it not resolve the problem completely, in this way you can get a lack to pass for the installation module.
Sorry if am i wrong.
Good code !! cya
Comment #15
Elijah LynnThis can result when you did an install without doing an sql-drop. And if you did and are using memcache, it could be memcache messing stuff up. Try a sql-drop first and then toggling memcache off if you have it on.
Comment #16
azovsky CreditAttribution: azovsky commentedduplicate of #1311828: Installation fails with SQLSTATE[42S02]: Base table or view not found: 1146 Table 'database.media_type' doesn't exist.