Date Published: April 18, 2025
Common Drush blockers on the RA Environment
Drush is a requirement of RA automation. This can often mean that if drush isn't set up correctly, issues can arise when attempting an update to a site. The basic Drush commands that must run against at least one multisite of a subscription are drush pm-updatestatus
and drush pm-updatecode
. So if these commands can't be run, there is likely a drush issue which must be addressed.
Some things to look for which could cause Drush to fail are:
- Broken custom modules
- Hook scripts not referencing the RA environment
- The sites.php file hasn't been configured for the RA environment
- The settings.php file hasn't been configured with database credentials
Drush could fail due to incorrectly configured hook scripts, specifically hook scripts which don't take into account the RA environment. To fix this you should wrap the hook in an if statement similar to the following:
#!/bin/sh
#
#Standard hook variables here
#
site="$1"
target_env="$2"
if [ "$target_env" != "ra" ]; then
#Execute Drush commands
drush @$site.$target_env cr
drush @$site.$target_env updatedb --yes
fi
To overcome an issue with database information in settings.php not referencing the RA environment, you should implement something similar to the following:
case 'ra':
// do something on ra - necessary if an ra environment is present
require '/var/www/site-php/example1/example1-settings.inc';
break;
A better solution to this would be to replace conditional statements with our standard database include which works on all of the environments:
if (file_exists('/var/www/site-php'))
{
require '/var/www/site-php/example1/example1-settings.inc';
}
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.