0

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 contribfolder 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.

  • Sounds like you need Registry Rebuild drupal.org/project/registry_rebuild – Alfred Armstrong Sep 5 '14 at 15:10
  • Also - double check you are not sharing a DB between two sites. – Alfred Armstrong Sep 5 '14 at 15:11
  • you can also try to clear the caches manually, truncating cache* tables – xurshid29 Sep 5 '14 at 15:20
  • Thanks. I manually installed registry_rebuild and ran it. It fixes the sites but only 1 will work properly. In other words, if I rr on Site1 it's fine. Then I rr on Site2 and it's fine but Site1 is now down... very weird. I am using Drush as root and cd into each site's directory... must be a setup issue. Each site is using it's own DB. – Jeremy Sep 5 '14 at 17:58
1

It sounds like a module might have been removed from the /modules directory without being properly uninstalled.

A registry rebuild usually fixes this type of issue. If you're using Drush, make sure you have the registry rebuild extension downloaded:

drush dl registry_rebuild -y

Once this is done, go ahead and run the following command from the Drupal webroot:

drush rr

As I said, that should hopefully do the trick.

  • This does semi work. It's very weird. When I fix the sites, it takes one or the other down in the process. Looking more into the setup of the sites. This may be the accepted answer once I figure out the last issue. – Jeremy Sep 5 '14 at 17:59
  • Hmm, do the other sites share the same database? If so then I guess that could be the issue. – Adam Thomason Sep 5 '14 at 18:02
  • Nope, they have separate folders and DB's. Settings files have been confirmed. Very weird. – Jeremy Sep 5 '14 at 18:02
  • Very weird indeed. Are all core theme includes all standard and not 'hacked'? – Adam Thomason Sep 5 '14 at 18:06
  • All standard. No hacking other than custom modules but these are in a custom folder for Site1. Site2 uses only drupal modules but there is no contrib folder as this was not setup to use that structure and nothing was modified. It seems that there may be an issue with Drush. I am cd into each site's public_html directory and running drush rrbut it still keeps messing up each other. Weird thing is no other sites are affected. – Jeremy Sep 5 '14 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.