Problem/Motivation
How to resolve "You have requested a non-existent service cache.backend.permanent_database"
Steps to reproduce
Install the PCB module
create a module.services.yml e.g. tea_voting.yml
services:
cache.voting:
class: Drupal\Core\Cache\CacheBackendInterface
tags:
- { name: cache.bin, default_backend: cache.backend.permanent_database }
# - { name: cache.bin}
factory: cache_factory:get
arguments: [voting]
Clear Drupal caches
Change the module.services.yml e.g. tea_voting.yml by removing the cache.backend.permanent_database so it looks like:
services:
cache.voting:
class: Drupal\Core\Cache\CacheBackendInterface
tags:
# - { name: cache.bin, default_backend: cache.backend.permanent_database }
- { name: cache.bin}
factory: cache_factory:get
arguments: [voting]
This effectively makes your cache.voting service a "normal" cache. i.e. it can be cleared with a Drupal cache clear.
Clear Drupal cache
notices the WSOD and error message:
You have requested a non-existent service "cache.backend.permanent_database". Did you mean this: "cache.backend.database"?
Now the Drupal database does not recover and the site has a WSOD.
Proposed resolution
To fix this truncate the cache_container table
Remaining tasks
Update the documentation to reflect this. Other solutions welcome