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

Created on 22 August 2016, almost 9 years ago
Updated 25 April 2024, about 1 year 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 about 10 hours 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.

  • ๐Ÿ‡ฆ๐Ÿ‡ฝร…land Islands albertho425 Seattle, WA

    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.

  • ๐Ÿ‡ฆ๐Ÿ‡ฝร…land Islands albertho425 Seattle, WA

    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