Route reported as not existing, but I'm not referring to it

in flag

Drupal 9.28; I removed some test code, and am now getting the error

Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "member.test" does not exist." at /Users/pglatz/dev/wdocs/wdocs-d9-code/www/web/core/lib/Drupal/Core/Routing/RouteProvider.php line 206

I grepped my code and there is no longer a reference to member.test in any of the yml files (or anywhere else). I cleared all cashes with drush cache-rebuild.

Using debug in phpStorm, I set a breakpoint where the error occurred and traced back, but cannot see why it is asking for this route.

Any suggestions how to get more information on where the problem is? (the error message could be a little less terse)

in flag
I'd try emptying all `cache_*` tables (or wherever your cache storage is, e.g. Redis) and see if that fixes it. Also check if your local server is actually seeing an updated version of your files (this is especially in the case of Docker, where the container stops syncing files from host to container).
pglatz avatar
in flag
Thanks Joseph. Using MAMP Pro on a Mac, no docker involved. I did empty *cache, no change. Doesn't drush cache-rebuild clear everything? I think I fixed it though; I found "member.test" in the database tables menu_tree and router, now the error is gone. The problem first surfaced when I removed the member.test route from and member.routing.yml, then cleared all caches. Apparently it didn't have enough information. I've never had this issue before, and wonder if there was another place I should have configured something, or if this was just one of those things.
4uk4 avatar
cn flag
drush cr definitely clears the router table and rebuilds it. The menu tree is more complex, it is built from a lot more different sources, for example you can edit menu items in UI and then this information is stored in config. So you could search for the route name in an exported configuration as well. BTW config encodes the ID by replacing dots with double underscores.
in flag

I removed "member.test" from the database tables menu_tree and router. Not the most elegant solution, but things are working now.

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.