In #2938884: A non-existent route breaks the site, an update hook was introduced to clear the router cache.

I do not recommend doing this. It has led to exceptions being thrown on a site I am working on. In general, you do not want to clear caches prior to running updb and entup operations. In a scenario like this, caches are cleared and the attempt to regenerate them is failing because pending update hooks and entity definition changes have not been executed yet. I don't think it's a rare situation to be in.

What I also find strange is that updb clears all caches after execution is complete. Why is this hook even needed?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    1 hidden branch
  • 3046604-update-cc Comparecompare

Comments

mstef created an issue. See original summary.

chris matthews’s picture

@mstef, do you experience this issue on the latest 8.x-2.x-dev?

romainj’s picture

This was introduced because it was not obvious that you'd have to clear the router cache when updating the module. Still I agree that it should be part of any module/drupal update.

adriancid’s picture

Status: Active » Closed (works as designed)