Recovering from a broken state
My Drupal site is saying a file doesn't exist, but it does!¶
First, make sure the file truly does exist by SSH'ing into the server and checking.
If the file is present, two things can fix this.
- Add a deployment identifier.
This will ensure the OPcache cache key changes, which will allow Drupal to pick up new files.Add the above to your settings.php file, changing the release as needed.$settings['deployment_identifier'] = \Drupal::VERSION . "__release_xx.yy__";
- Clear the PHP-FPM pool via Platform
This will clear OPcache itself, which will also allow Drupal to pick up new files.
My Drupal site is saying a service doesn't exist, but it does!¶
This can be caused when the Drupal Container isn't rebuilt. If you can't clear caches, because that command also fails then the only solution is:
Add a deployment identifier. This is also used as part of the cache key for the Drupal Container. Changing the identifier causes Drupal to build a new Container, which will then register the new services.
$settings['deployment_identifier'] = \Drupal::VERSION . "__release_xx.yy__";
Add the above to your settings.php file, changing the release as needed.
If a cache clear via CLI works, but the error persists it is possible your site is setting a different deployment identifier for just CLI. This was a workaround used to support two drush versions a long time ago, and is no longer required. Remove that logic, or expand it to also set a new deployment identifier for non-CLI processes.