Score:0

How can I debug cache tags not invalidated as expected?

cn flag

Up unto last week my Drupal site and varnish_purge worked together fine with Varnish. After updating the modules to the latest versions, cache tag invalidation seemed to stop. Nothing else really changed in the meantime. In /var/log/varnish/varnishncsa.log I get messages like the following.

127.0.0.1 - - [16/Nov/2021:09:04:13 +0100] "BAN http://127.0.0.1:6081/ HTTP/1.1" 200 254 "-" "varnish_purger module for Drupal 8."

In the syslog there are no messages from Varnish or Drupal.

After changing something on a page, drush p:queue-work should give a notice like the following.

Processed 5 objects...

It instead shows the following.

The queue is empty or has only locked items!

How should I debug this?

Edit I tested on an old site when the problem started, it looked like that, as soon as module "typed data" was updated, the problem started.

What I tried without solving the problem:

  • reinstall typed data
  • reinstall purge modules
  • reinstall Varnish
  • installed another module for purging (advanced_varnish)
  • removed all modules
  • removed the vendor folder and composer.lock file, cleaned the composer cache and did a composer install
  • used a views block in the layout builder to show the text
  • removed everything from the layout in the layout builder but the body text, then when placing a certain views block, the problem starts. But, when doing that in a clean install, the problem doesn't appear.
  • build a clean install trying to introduce the problem
  • increase nginx body buffer size

Edit: to get an idea of the installed modules, this is the composer.json:

{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0-or-later",
"authors": [
    {
        "name": "",
        "role": ""
    }
],
"repositories": [
    {
        "type": "composer",
        "url": "https://packages.drupal.org/8"
    },
    {
        "type": "composer",
        "url": "https://asset-packagist.org"
    },
    {
        "type": "package",
        "package": {
            "name": "slick/slick",
            "version": "v1.8.1",
            "type": "drupal-library",
            "dist": {
                "url": "https://github.com/kenwheeler/slick/archive/master.zip",
                "type": "zip"
            }
        }
    }
],
"require": {
    "php": ">=5.6",
    "bower-asset/blazy": "^1.8",
    "bower-asset/jquery-mousewheel": "^3.1",
    "bower-asset/jquery.easing": "^1.3",
    "bower-asset/jquery.pause": "^0.1",
    "bower-asset/lazysizes": "^5.1",
    "bower-asset/slick-carousel": "^1.8",
    "composer/installers": "^1.7",
    "cweagans/composer-patches": "^1.6.5",
    "drupal/admin_toolbar": "^3.1",
    "drupal/antibot": "^1.4",
    "drupal/better_exposed_filters": "^5.0@beta",
    "drupal/bg_image_formatter": "^1.11",
    "drupal/blazy": "^2.4",
    "drupal/bootstrap": "^3.20",
    "drupal/contact_block": "^1.4",
    "drupal/core-composer-scaffold": "^9",
    "drupal/core-project-message": "^9",
    "drupal/core-recommended": "^9",
    "drupal/csv_serialization": "^2.0",
    "drupal/ctools": "^3.6",
    "drupal/easy_breadcrumb": "^2.0",
    "drupal/editor_advanced_link": "^2.0",
    "drupal/email_registration": "^1.0@RC",
    "drupal/entity_clone": "^1.0@beta",
    "drupal/field_group": "^3.2",
    "drupal/honeypot": "^2.0",
    "drupal/image_effects": "^3.1",
    "drupal/image_style_warmer": "^1.0@beta",
    "drupal/image_widget_crop": "^2.3",
    "drupal/imagemagick": "^3.3",
    "drupal/imagick": "^1.5",
    "drupal/imce": "^2.3",
    "drupal/jquery_ui_datepicker": "^1.2",
    "drupal/layout_builder_styles": "^1.0@beta",
    "drupal/lazy": "^3.4",
    "drupal/mautic": "^1.1",
    "drupal/menu_link_attributes": "^1.0",
    "drupal/metatag": "^1.10",
    "drupal/migrate_file": "^2.0",
    "drupal/migrate_plus": "^5.1",
    "drupal/migrate_tools": "^5.0",
    "drupal/module_filter": "^3.1",
    "drupal/pathauto": "^1.4",
    "drupal/poll": "^1.4",
    "drupal/publication_date": "^2.0@beta",
    "drupal/purge": "^3.0@beta",
    "drupal/purge_purger_http": "^1.0",
    "drupal/redirect": "^1.4",
    "drupal/robots_noindex_nofollow": "2.0.x-dev@dev",
    "drupal/rules": "3.x-dev@dev",
    "drupal/scheduler": "^1.1",
    "drupal/scroll_progress": "9.1.x-dev@dev",
    "drupal/search_autocomplete": "^2.0",
    "drupal/simple_sitemap": "^4.1",
    "drupal/slick": "^2.3",
    "drupal/slick_extras": "^1.0@RC",
    "drupal/slick_views": "^2.4",
    "drupal/social_media": "^1.9@RC",
    "drupal/svg_image": "^1.9",
    "drupal/taxonomy_menu": "3.x-dev@dev",
    "drupal/twitter_block": "^3.0@alpha",
    "drupal/typed_data": "^1.0@dev",
    "drupal/varnish_purge": "^2.0",
    "drupal/views_infinite_scroll": "^2.0",
    "drupal/views_slideshow": "^4.6",
    "drush/drush": "^10.3",
    "league/csv": "^9.1@dev",
    "oomphinc/composer-installers-extender": "^2.0",
    "vlucas/phpdotenv": "^2.4",
    "webflo/drupal-finder": "^1.0.0",
    "webmozart/path-util": "^2.3",
    "wikimedia/composer-merge-plugin": "^2.0",
    "zaporylie/composer-drupal-optimizations": "^1.0"
},
"conflict": {
    "drupal/drupal": "*"
},
"minimum-stability": "stable",
"prefer-stable": true,
"config": {
    "sort-packages": true,
    "fxp-asset": {
        "installer-paths": {
            "npm-asset-library": "web/libraries",
            "bower-asset-library": "web/libraries"
        }
    },
    "allow-plugins": {
        "composer/installers": true,
        "cweagans/composer-patches": true,
        "drupal/core-composer-scaffold": true,
        "drupal/core-project-message": true,
        "oomphinc/composer-installers-extender": true,
        "wikimedia/composer-merge-plugin": true,
        "zaporylie/composer-drupal-optimizations": true
    }
},
"autoload": {
    "classmap": [
        "scripts/composer/ScriptHandler.php"
    ],
    "files": ["load.environment.php"]
},
"scripts": {
    "pre-install-cmd": [
        "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "pre-update-cmd": [
        "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "post-install-cmd": [
        "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ],
    "post-update-cmd": [
        "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ]
},
"extra": {
    "installer-types": ["bower-asset", "npm-asset"],
    "composer-exit-on-patch-failure": true,
    "patchLevel": {
        "drupal/core": "-p2"
    },
    "installer-paths": {
        "web/libraries/{$name}": ["type:drupal-library", "type:bower-asset", "type:npm-asset"],
        "web/core": ["type:drupal-core"],
        "web/modules/contrib/{$name}": ["type:drupal-module"],
        "web/modules/{$name}": ["type:unity-module"],
        "web/profiles/contrib/{$name}": ["type:drupal-profile"],
        "web/themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/Commands/{$name}": ["type:drupal-drush"],
        "drush/contrib/{$name}": ["type:drupal-drush"]
    },
    "drupal-scaffold": {
        "initial": {
            ".editorconfig": "../.editorconfig",
            ".gitattributes": "../.gitattributes"
        }
    },
    "merge-plugin": {
        "include": [
            "web/modules/contrib/webform/composer.libraries.json"
        ]
    },
    "patches": {
        "drupal/content_sync": {
            "repareer": "https://www.drupal.org/files/issues/2019-05-06/content_sync-entity_manager_refs.patch"
        },
        "drupal/search_autocomplete": {
            "fix Uncaught TypeError: value.autocomplete is not a function": "https://www.drupal.org/files/issues/2021-06-24/value-autocomplete-not-function-3220334-3.patch"
        }
    },
    "enable-patching": true
}

}

id flag
What are the precise version changes that broke the feature?
vg flag
If a clean install helps, I would try to reset the purge modules settings, saving that config newly may fix your problems. For debugging I can recommend xdebug - the question is where to set the breakpoints ;)
C.A. Vuyk avatar
cn flag
thanks remy, I already deinstalled and reinstalled Varnish and purge modules, and tried all kind of new settings (but, then again: the old settings were fine). Because I don't have experience with debugging Drupal modules themselves, xdebug would be a step too far.
C.A. Vuyk avatar
cn flag
@cilefen I made an edit in the question about when the site broke
sonfd avatar
in flag
Which purge plugins are enabled? Do you have the core cache tags queuer enabled? Do you have a queue processor enabled?
C.A. Vuyk avatar
cn flag
The purge module is enabled and I tried varnish_purge, later advanced-varnish. Yes, together with core cache tags queuer enabled, and queue processors.
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.