Loading...


Related Products


Date Published: January 12, 2024

How to set a unique hash_salt for an individual site

Environment

  • Multi-site
  • Acquia Cloud Site Factory

Objective

In certain scenarios, if your application is using a multisite setup (like Acquia Site Factory), non-specific "PluginNotFound" or "Module not found" errors can show up in the logs.

  • Drupal\Component\Plugin\Exception\PluginNotFoundException: "The {...} plugin does not exist. Valid plugin IDs...
  • Drupal\Core\Extension\Exception\UnknownExtensionException: The module {...} does not exist. in {...}/core/lib/Drupal/Core/Extension/ExtensionList.php {...}

This happens because Drupal keeps track of available resources (modules, plugins, etc.) in shared cache backends (like memcache or APCu) that use the hash_salt value to identify the multisite instance. If this hash_salt isn't unique for each site, it can cause one multisite's settings to "bleed" into the other site(s).

Resolution

  1. Confirm which sites are not using a unique hash: How to find out if your Application is using unique hash salts between sites
  2. Update settings for unique hash_salts
    • Acquia Cloud Multi-Site
      • ​​​​​​​Add this line to the end of all your sites' settings.php file:
        $settings['hash_salt'] = hash('sha256', $app_root . '/' . $site_path);
    • Site Factory 

 

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.

Back to Section navigation