Drupal 8: You have requested a non-existent service "router.route_provider.old"

Created on 22 August 2016, over 8 years ago
Updated 25 April 2024, 8 months ago

I am creating two custom content type with reference to these pages:

https://www.drupal.org/node/2629550

https://www.drupal.org/node/2693979

Everything works fine. Content type with fields is created. But While installing, it throws an exception and as a result hook_install is not executing, i think. The error is as follows:

Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "router.route_provider.old". Did you mean one of these: "router.route_provider", "router.route_preloader"?" at ...\\core\\lib\\Drupal\\Component\\DependencyInjection\\Container.php line 157

Could anyone please help me, why this is happening and how to fix it ?

I am using Drupal 8.1.8 version.

🐛 Bug report
Status

Fixed

Version

8.5 ⚰️

Component
Extension 

Last updated 10 days ago

No maintainer
Created by

🇧🇩Bangladesh shafiqhossain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India Kumar Ashutosh

    I used to upgrade core from 10.2.4 to 10.2.5 and getting this error.

    You have requested a non-existent service "token.module_provider". Did you mean this: "router.route_provider"? in Drupal\Component\DependencyInjection\Container->get() (line 157 of core\lib\Drupal\Component\DependencyInjection\Container.php).
    

    So, I have downgraded the core version from 10.2.5 to 10.2.4 and it works like a charm for me.

  • 🇺🇸United States albertho425

    I updated token to 1.14.0, diff to 1.3.0, search_api to 1.34.0, and search_api_solr to 4.3.3 on my main site which is working normally. On all my multisites, I see this message in Terminal.

    ID Date Type Severity Message
    ------- -------------- -------------------- ---------- -------------------------------------------------------------------------------
    18676 16/Apr 07:54 php Error Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You
    have requested a non-existent service "token.module_provider". Did you mean
    this: "router.route_provider"? in
    18675 16/Apr 07:54 access denied Warning Path: /cehe/admin/reports/dblog?severity%5B%5D=3&severity%5B%5D=4.
    Drupal\Core\Http\Exception\CacheableAccessDeniedHttpException: The 'access
    site reports' permission is required. in Drupa
    18674 15/Apr 18:56 php Error Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You
    have requested a non-existent service "token.module_provider". Did you mean
    this: "router.route_provider"? in

    I tried rolling back to the previous version of the modules as well as restoring the database and nothing is working yet.

  • 🇺🇸United States albertho425

    Re-importing the database for each multisite resolves the issue.

  • 🇺🇸United States natefollmer

    @kumar-ashutosh I had the same error. You may want to check if you have any database updates pending. Search API had a pending DB update. After I ran drush updb, then the error you are seeing was resolved.

  • 🇦🇪United Arab Emirates ThirstySix

    Yeah it's working after database updates.

    • drush cr
    • drush updb
    • drush cr
Production build 0.71.5 2024