Score:0

Content and content type fields intermittently disappear after cache rebuild

de flag

I have an issue on a Drupal 9 website where sometimes (but not every time), if I run drush cr the content of pages disappears (the header and footer are all that remain), and in Structure > Content Types all of the fields are missing from the page content type.

A second cache rebuild, or even a standard Drupal cache clear, always solves the problem.

I don't want to go into production until this issue resolved. I've never seen this before after working on many Drupal 7 and 8 websites, and wonder if it's related to Drupal 9, or something specific about this website's infrastructure.

Any insight would be appreciated.

The server is running on CentOS Stream 8, MariaDB 10.5.x and PHP (FPM) 7.4.x.

cn flag
Information about your server, PHP version, and so on might be helpful. This is definitely very strange behavior.
cn flag
It will be related to the specific website's infrastructure, many other Drupal 9 sites are live without this problem. As it's a cache issue, check your caching first (are you using redis/memcache, is it configured correctly, does it all start working if you turn the memory cache off, etc)
Geat avatar
de flag
@Clive - the website just uses the standard Internal Page Cache.
Geat avatar
de flag
@Patrick Kenny - I've updated the post.
4uk4 avatar
cn flag
If this is not a bug in code then it seems like the first run crashes because of PHP or database limits and so some vital parts of the cache rebuilt, like the field plugin discovery, is missing. The second pass is then able to finish the task within the limits. drush uses a different environment than the Web UI (CLI vs FPM). Check the PHP settings for both environments and of course the error logs.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.