After upgrading from core 8.3.x, I can no longer get the Drupal-icon shortcut links in the admin_toolbar to work (includes clear-cache and run cron), uninstalling the tools module results in an error:

$ drush pm-uninstall admin_toolbar_tools
The following extensions will be uninstalled: admin_toolbar_tools
Do you really want to continue? (y/n): y
admin_toolbar_tools was successfully uninstalled.                                                                                                                     [ok]
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/". in Drupal\Core\Routing\Router->matchRequest() (line 159 of                    [error]
.../docroot/core/lib/Drupal/Core/Routing/Router.php).
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/". in Drupal\Core\Routing\Router->matchRequest() (line 159 of                    [error]
.../docroot/core/lib/Drupal/Core/Routing/Router.php).

re-installing the admin_toolbar_tools does nothing, and uninstalling seems to always throw the above error.

Before upgrading to 8.4.x, I had to uninstall all of admin_toolbar for a similar reason, because without doing so and upgrading resulted in similar errors, however, these errors would kill the site with a WSOD, these are the errors if I tried to upgrade Drupal core without first uninstalling the module:

Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "admin_toolbar_tools.drupalorg" does not exist." at .../docroot/core/lib/Drupal/Core/Routing/RouteProvider.php line 190
Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "admin_toolbar_tools.flush" does not exist." at .../docroot/core/lib/Drupal/Core/Routing/RouteProvider.php line 190
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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bdanin created an issue. See original summary.

romainj’s picture

@bdanin What version of PHP do you use?

bdanin’s picture

This started with PHP 5.6, and there was no change when we upgraded to PHP 7.1
also, keep getting this error on config import:
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/". in Drupal\Core\Routing\Router->matchRequest() (line 159 of /app/docroot/core/lib/Drupal/Core/Routing/Router.php). [error]

jason_purdy’s picture

I ran into this problem, but when I did a pm-uninstall, cr, en, and cr, I was able to get the admin_toolbar back up & running.

bdanin’s picture

@purdy_nc, yes that's what I had to run in order to get the site back up and running

The admin toolbar itself is mostly working, but some of the links are no longer showing up

The main issue is that the admin_toolbar_extras (includes links to clear cache, run cron, the drupalicon links) is no longer functional (even though it's marked as turned on and active)

I also keep getting the `No routes found for "/". in Drupal\Core\Routing\Router->matchRequest()` error whenever running drush pm commands

bisonbleu’s picture

I have a similar issue when running Drupal 8.5.3 under MAMP 4.x and php 7.1.8. The only option appears to be uninstalling admin_toolbar_tools.

Spurlos’s picture

I think I have found the issue that caused this behavior. Route 'admin_toolbar_tools.drupalorg' is being loaded from route cache after core update, and cache has the record with that cid, but there is no data, thus its breaks the code down the road. A simple route rebuild helps to populate the caches with needed data about this route. I have attached a patch.

Spurlos’s picture

FileSize
392 bytes

Forgot to name the hook correctly

Spurlos’s picture

FileSize
392 bytes

And another function name fix. Looks like 8000 hook update number cannot be used.

adriancid’s picture

Title: Upgrade core 8.3.x to 8.4.x breaks admin_toolbar_tools » A non-existent route breaks the site

  • adriancid committed df74bd2 on 8.x-1.x authored by Spurlos
    Issue #2938884 by Spurlos, bdanin, romainj, purdy_nc, adriancid: A non-...
adriancid’s picture

Status: Active » Fixed

Thanks for the patch :-)

bdanin’s picture

this doens't seem to work for me, I still have the same issues, and uninstalling and re-installing admin_toolbar produces the same error I used to have before:

drush pm-uninstall admin_toolbar -y                                                                                                                                                               
The following extensions will be uninstalled: admin_toolbar, admin_toolbar_links_access_filter, admin_toolbar_tools, adminimal_admin_toolbar
Do you really want to continue? (y/n): y
admin_toolbar was successfully uninstalled.                                                                                                                                                                                                          [ok]
admin_toolbar_links_access_filter was successfully uninstalled.                                                                                                                                                                                      [ok]
admin_toolbar_tools was successfully uninstalled.                                                                                                                                                                                                    [ok]
adminimal_admin_toolbar was successfully uninstalled.                                                                                                                                                                                                [ok]
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/". in Drupal\Core\Routing\Router->matchRequest() (line 125 of /app/docroot/core/lib/Drupal/Core/Routing/Router.php).                                            [error]
Symfony\Component\Routing\Exception\ResourceNotFoundException: No routes found for "/". in Drupal\Core\Routing\Router->matchRequest() (line 125 of /app/docroot/core/lib/Drupal/Core/Routing/Router.php).   
bdanin’s picture

Status: Fixed » Needs work
webcultist’s picture

Have the same problem with the latest dev @drupal 8.5.4 @php7.1

Auf der Website ist ein unvorhergesehener Fehler aufgetreten. Bitte versuchen Sie es später nochmal.</br></br><em class="placeholder">Symfony\Component\Routing\Exception\RouteNotFoundException</em>: Route "admin_toolbar_tools.drupalorg" does not exist. in <em class="placeholder">Drupal\Core\Routing\RouteProvider->getRouteByName()</em> (line <em class="placeholder">202</em> of <em class="placeholder">core/lib/Drupal/Core/Routing/RouteProvider.php</em>). <pre class="backtrace">Drupal\Core\Routing\UrlGenerator->getRoute(&#039;admin_toolbar_tools.drupalorg&#039;) (Line: 130)
Drupal\Core\Routing\UrlGenerator->getPathFromRoute(&#039;admin_toolbar_tools.drupalorg&#039;, Array) (Line: 68)
Drupal\Core\Render\MetadataBubblingUrlGenerator->getPathFromRoute(&#039;admin_toolbar_tools.drupalorg&#039;, Array) (Line: 790)
Drupal\Core\Url->getInternalPath() (Line: 135)
adriancid’s picture

Have you tried to do drush updb?

bennybobw’s picture

Yep, same problem here. Installing the dev and running the update script doesn't fix the issue. I tried to uninstall the chosen module and I get this error from the admin toolbar:

PHP message: Uncaught PHP Exception Symfony\\Component\\Routing\\Exception\\RouteNotFoundException: "Route "chosen.admin" does not exist.

I tried uninstalling and reinstalling admin_toolbar and admin_toolbar_tools, but then the drupal drop menu with clear cache, etc. went away.

Drupal 8.5.3
PHP 5.6

adriancid’s picture

@bennybobw we don't have a route named "chosen.admin", so your problem doesn't comes from this module.

bennybobw’s picture

My bad. I thought the error was coming from admin_toolbar because it's trying rendering a link that should no longer be in the menu after uninstalling the chosen module. I turned off the admin_toolbar module and it started working, so I assumed the problem was in admin toolbar. I will open an issue in the chosen module queue.

adriancid’s picture

Status: Needs work » Fixed
bdanin’s picture

with the latest 8.5 upgrades, this was actually fixed; not sure exactly what did it, but glad everything's back to normal

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

fdefeyter@gmail.com’s picture

still the same problem...

adriancid’s picture

fdefeyter@gmail.com can you describe your problem and how to reproduce it?

nareshbw’s picture

I am also getting the same issue. But when I am trying same code base and DB on other environment I am not able to see this error. In short I want to say it is very hard to replicate the issue on other instances with same code base.

g089h515r806’s picture

the same issue still exist:
After uninstall feeds tamper module, I got :

<em class="placeholder">Symfony\Component\Routing\Exception\RouteNotFoundException</em>: Route &quot;entity.feeds_feed_type.tamper&quot; does not exist. in <em class="placeholder">Drupal\Core\Routing\RouteProvider-&gt;getRouteByName()</em> (line <em class="placeholder">201</em> of <em class="placeholder">core/lib/Drupal/Core/Routing/RouteProvider.php</em>). 

rename admin_toolbar to admin_toolbar2, I could access the website, clear the cache. fixed it.
I think this is a bug of admin_toolbar.

BeauTownsend’s picture

I think that the issue is not with admin_toolbar, but rather with broken config.

In my case, I had an orphaned Feeds Type configuration, and since there was no actual Feeds Type associated with it, a valid path in the form of /admin/structure/feeds/manage/{feeds_feed_type}/display could not be generated.

Deleting the orphaned config solved all associated issues for me.

To g089h515r806's comment, I think that your fix worked, not because of a bug in admin_toolbar, but because it temporarily prevented admin_toolbar from attempting to build broken paths, and thus not interfering with cache clear.

If you have Drupal Console installed, you can view the route information associated with your broken route with:
drupal debug:router <route name>

Admin toolbar simply expands your menu tree, so it's going to uncover broken links if they are in your menu.

berliner’s picture

That explanation makes sense. What's the options of finding broken config?
No routes found for "/" doesn't give a log of hints.

Nick Hope’s picture

I have been fighting this issue for a very long time. Earlier today I was still having to run Admin Toolbar 2.4 and Devel 1.2 with Drupal 8.9.13 because if I uninstalled Admin Toolbar Tools or changed versions of Admin Toolbar I would get this error:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "admin_toolbar_tools.flush" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 208 of core\lib\Drupal\Core\Routing\RouteProvider.php).

If I updated both Admin Toolbar to 3.0.0 and Devel to 4.1.1 then the error changed to this (same as the message described in this issue):

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "devel.execute_php" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 208 of core\lib\Drupal\Core\Routing\RouteProvider.php).

I've tried many things to resolve this, using Drush and Drupal Console to uninstall, reinstall, rebuild caches, debug routes, configs etc. etc. and nothing worked. However I have finally managed to solve the problem by manually removing entries from the database. These were the steps:

1. Uninstalled all Admin Tools and Devel modules, updated database and cleared cache, using drush because site had a WSOD when logged in as admin:

drush pmu admin_toolbar_tools
drush pmu admin_toolbar
drush pmu devel_php
drush pmu devel
drush update db
drush cr

2. Opened PHPMyAdmin. In my case I am using Acquia Dev Desktop so I did this by selecting the site in Dev Desktop > "More" > "Open database manager..."

3. Clicked on the database name in the left column corresponding with the site name then click on "Search" tab.

4. Entered %admin_toolbar_tools% in the search field > "Inside Tables" > "Select All" > "Go" (bottom right).

5. Deleted the following matches (after clicking "Browse" to see what I was deleting):

- 1 match in cachetags
- 1 match in cache_config
- 1 match in cache_menu
- 1 match in config_snapshot
- 1 match in cache_menu
- 362 matches in menu_tree (when I clicked "browse" it showed all had been added by admin_toolbar_tools)

I left 51 matches in the watchdog table, which I guess are just logs of error messages.

Then when I refreshed the site I got this message:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "devel.admin_settings" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 208 of core\lib\Drupal\Core\Routing\RouteProvider.php)

6. Repeated #4 but search for %devel.admin_settings% then deleted the following matches:

- 1 match in cache_menu
- 1 match in config_snapshot
- 2 matches in menu_tree

7. That brought my site back to life without a WSOD, but I still noticed some matches for %admin_toolbar% and I deleted these:

- 1 match in cache_dynamic_page_cache
- 1 match in cache_render
- 1 match in cachetags
- 1 match in config_snapshot
- 17 matches in menu_tree

Again I left the 20 matches in the watchdog table.

8. Finally I deleted these matches for a search for %devel%, being careful that they were matches for "devel" and not "development".

- 1 match in cachetags
- 1 match in config_snapshot

9. Then with Admin Toolbar and Devel and their traces properly nuked, I was able to install Devel 3.0.0 and Admin Toolbar 4.1.1 via Composer, and they even appeared in my /admin/reports/updates list, which they haven't in years. Then enabled the 3 extra Admin Toolbar modules too.

Hopefully this might help someone. A bit daunting deleting stuff manually in a Drupal database and I'm quite surprised it worked. Be very careful and take a good backup first!

isadra made their first commit to this issue’s fork.