Ok, so I ran into an issue today that completely baffles me...
I have a staging server that I have about 30 sites on. Most are WordPress and about 5 are Drupal. Yesterday I worked on a Drupal site that stores modules in contrib
and custom
directories. The other Drupal installs use the default setup for modules (no contrib
or custom
folders). Everything worked for all sites yesterday with no issues.
I came into my office today and noticed that 2 of the Drupal sites are all messed up. When I visit Site1 I get an error page stating:
Notice: Undefined index: olympusat in _drupal_maintenance_theme() (line 74 of /var/www/vhosts/parables.stage/public_html/includes/theme.maintenance.inc).
Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd_parables.languages' doesn't exist: SELECT * FROM {languages} ORDER BY weight ASC, name ASC; Array ( ) in language_list() (line 2651 of /var/www/vhosts/parables.stage/public_html/includes/bootstrap.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 710 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 710 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 710 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Undefined index: olympusat in theme_get_setting() (line 1414 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in theme_get_setting() (line 1451 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in theme_get_setting() (line 1461 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Undefined index: olympusat in template_preprocess_maintenance_page() (line 2702 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in template_preprocess_maintenance_page() (line 2702 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Warning: array_keys() expects parameter 1 to be array, null given in template_preprocess_maintenance_page() (line 2705 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Warning: Invalid argument supplied for foreach() in template_preprocess_maintenance_page() (line 2705 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
So first thing I did was try to flush the cache... output is below.
[root@StagingServer public_html]# drush cc all
Drush command terminated abnormally due to an unrecoverable error. [error]
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd_parables.languages' doesn't exist: SELECT * FROM {languages} ORDER BY weight ASC, name ASC; Array
(
)
in language_list() (line 2651 of /var/www/vhosts/parables.stage/public_html/includes/bootstrap.inc).
So I decided the DB was somehow corrupted. I dumped a fresh version of the DB from PRODuction and tried to visit the page. Same error as above... So I ran drush cc all again and I got the exact same error...
Confirmed I was in the correct folder and still the same issues.
Ok, I'll just try to fix Site2 first then...
Site2 just has a blank page. Checking the error log shows:
PHP Fatal error: require_once(): Failed opening required '/var/www/vhosts/olympusat.stage/public_html/sites/all/modules/contrib/entity/includes/entity.inc' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/olympusat.stage/public_html/includes/bootstrap.inc on line 3146
The problem with this error is that there is no contrib
folder for modules. This is setup on Site1 only. SO next I wanted to confirm that each site was pointing to the correct DB. I verified both settings.php files were correct... they are.
I am lost on what to do next... Site2 is using a default setup and all modules are in the sites/all/modules
directory. I cannot understand why it's looking in the contrib folder for a module. The module does exist in the modules directory... Not really sure how to fix this issue.
So I decided to check permissions and ownership for the sites in question. Everything seems correct...
Any suggestions or insight on this is appreciated.
Thanks
More Info
So this is what is happening after I use registry_rebuild
(drush rr
)
Site1: Command Line:
cd /var/www/vhosts/parables.stage/public_html
cd sites/all/modules/contrib/registry_rebuild
php registry_rebuild.php
ouput:
DRUPAL_ROOT is /var/www/vhosts/parables.stage/public_html.<br/>
Bootstrapping to DRUPAL_BOOTSTRAP_SESSION<br/>
Bootstrap caches have been cleared in DRUPAL_BOOTSTRAP_SESSION<br/>
Doing registry_rebuild() in DRUPAL_BOOTSTRAP_SESSION<br/>
Bootstrapping to DRUPAL_BOOTSTRAP_FULL<br/>
Rebuilding registry via registry_rebuild_cc_all in DRUPAL_BOOTSTRAP_FULL<br/>
All caches have been cleared with registry_rebuild_cc_all.<br/>
There were 711 files in the registry before and 711 files now.<br/>
All caches have been cleared with registry_rebuild_cc_all.<br/>
If you don't see any crazy fatal errors, your registry has been rebuilt.<br/>
Site works as expected.
Site2 Command Line:
cd /var/www/vhosts/olympusat.stage/public_html
cd sites/all/modules/registry_rebuild
php registry_rebuild.php
ouput:
DRUPAL_ROOT is /var/www/vhosts/olympusat.stage/public_html.<br/>
Bootstrapping to DRUPAL_BOOTSTRAP_SESSION<br/>
Bootstrap caches have been cleared in DRUPAL_BOOTSTRAP_SESSION<br/>
Doing registry_rebuild() in DRUPAL_BOOTSTRAP_SESSION<br/>
Bootstrapping to DRUPAL_BOOTSTRAP_FULL<br/>
Rebuilding registry via registry_rebuild_cc_all in DRUPAL_BOOTSTRAP_FULL<br/>
All caches have been cleared with registry_rebuild_cc_all.<br/>
There were 734 files in the registry before and 734 files now.<br/>
All caches have been cleared with registry_rebuild_cc_all.<br/>
If you don't see any crazy fatal errors, your registry has been rebuilt.<br/>
Site works as expected.
Now when I check Site2 (parables.stage)
I see the error:
Fatal error: require_once(): Failed opening required '/var/www/vhosts/parables.stage/public_html/sites/all/modules/entity/includes/entity.inc' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/parables.stage/public_html/includes/bootstrap.inc on line 3062
Notice there is no contirb
folder in the path as this site is setup to use...
So I clear the cache:
cd /var/www/vhosts/olympusat.stage/public_html
drush cc all
Now I get the error:
Notice: Undefined index: olympusat in _drupal_maintenance_theme() (line 74 of /var/www/vhosts/parables.stage/public_html/includes/theme.maintenance.inc).
Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 145 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd_parables.languages' doesn't exist: SELECT * FROM {languages} ORDER BY weight ASC, name ASC; Array ( ) in language_list() (line 2651 of /var/www/vhosts/parables.stage/public_html/includes/bootstrap.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 710 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 710 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in _theme_build_registry() (line 710 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Undefined index: olympusat in theme_get_setting() (line 1414 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in theme_get_setting() (line 1451 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in theme_get_setting() (line 1461 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Undefined index: olympusat in template_preprocess_maintenance_page() (line 2702 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Notice: Trying to get property of non-object in template_preprocess_maintenance_page() (line 2702 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Warning: array_keys() expects parameter 1 to be array, null given in template_preprocess_maintenance_page() (line 2705 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Warning: Invalid argument supplied for foreach() in template_preprocess_maintenance_page() (line 2705 of /var/www/vhosts/parables.stage/public_html/includes/theme.inc).
Also, the title says Olympusat Media... not parables... So I start this loop over...
I'm deciding to delete these sites and set them back up... Hopefully this will cause this to go away.