Site offline - Need HELP! DOException: SQLSTATE[42S02].......

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jggarley's picture

I need help with this error I'm getting that resulted to my site being offline. I can only access Admin section but when I try to view it (even in maintenance mode) I get the following error.

We are currently offline for maintenance
The website encountered an unexpected error. Please try again later.

I looked at the recent log entries and I see the followings:

Notice: Undefined variable: body_classes in include() (line 25 of /home4/dubura/public_html/sites/all/themes/cms_base/templates/maintenance-page.tpl.php).

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dubura_bsa.node_access_test' doesn't exist: SELECT nid, private FROM {node_access_test} WHERE nid IN(:nids_0, :nids_1, :nids_2); Array ( [:nids_0] => 30 [:nids_1] => 31 [:nids_2] => 33 ) in node_access_test_node_load() (line 188 of /home4/dubura/public_html/modules/node/tests/node_access_test.module).

Comments

Try reinstalling node access

gdbwb05's picture

It has to do with the database table 'dubura_bsa.node_access_test' not being in the database, something is calling it but it's not there. Try reinstalling node access.

Not node access module but node_access_test.module

vwX's picture

This is a module used for testing node access features and is normally hidden from being enabled.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dubura_bsa.node_access_test' doesn't exist: SELECT nid, private FROM {node_access_test} WHERE nid IN(:nids_0, :nids_1, :nids_2); Array ( [:nids_0] => 30 [:nids_1] => 31 [:nids_2] => 33 ) in node_access_test_node_load() (line 188 of /home4/dubura/public_html/modules/node/tests/node_access_test.module).

Question is how did it get enabled in the first place?

Do you have drush installed on the server? You may be able to disable it that way.

I don't have Drush and I have

jggarley's picture

I don't have Drush and I have no idea how it got enabled.

If you don't have Drush, you

Jamie Holly's picture

If you don't have Drush, you can go into the system table in the database and search for node_access_test in the name column of the system table. Edit that row and set status to 0, then truncate all the cache_* tables.

The other option is to create the table manually in the database. Just look at the schema in node_access_test.install. After that, disable the module and then uninstall it and that will reset everything.


HollyIT - Grab the Netbeans Drupal Development Tool at GitHub.

Thanks guys. I followed your

jggarley's picture

Thanks guys. I followed your step by going to the system table and setting its status to 0 and I cleared the cache and everything seems to be fine now.