Symfony 2.7 / 3 - Doctrine: You have requested a non-existent service "fos_user.doctrine_registry"
Asked Answered
S

2

27

Doing a composer update today suddenly getting the following error:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] You have requested a non-existent service "fos_user.doctrine_registry".

when composer is executing the cache:clear --no-warmup command.

Search found an answer related to converting from doctrine to MongoDB but the solutions are not working for me. I am using Doctrine. I've tried Fosuserbundle dev-master, dev-master@dev, 2.0.0-alpha1 and 2.0.0-alpha3.

Any other suggestions? Composer update was working fine a couple of days ago.

Shaggy answered 27/1, 2016 at 7:41 Comment(3)
Yes also experiencing this... will keep debugging and see what I find.Reinke
While this question is tagged as symfony2, according to the comments below the answer the problem exists with Symfony 2.7 and 2.8 too.Flashgun
Originally tagged as Symfony 3, but appears applicable to various Symfony 2 versions as well as noted below.Shaggy
R
65

Issue created here: https://github.com/FriendsOfSymfony/FOSUserBundle/issues/2048

Short term fix (worked for me Symfony 3.0.* ) :

services:
    fos_user.doctrine_registry:
        alias: doctrine
Reinke answered 27/1, 2016 at 8:24 Comment(7)
Thanks for @xabbuh, for this fix! It is not working for 3.0 (possibly 2.8 too) though.Saxtuba
Thanks. Has worked for me. I am using Symfony 3.0.* and fosuserbundle "dev-master@dev"Shaggy
This works but my production cache won't clear following this update either. I get the error: Class 'FOS\UserBundle\Doctrine\Orm\UserListener' not found in ../app/cache/prod/appProdProjectContainer.php on line 442Doubleness
It works thanks, be sure to import app/config/service.yml on app/config/config.yml, otherwise put this on your service.yml bundleHeimlich
is nobody testing before to commit in symfony(fos)? ahh php bad practices :)Topical
I had this problem as well with Symfony 3.0.1. After upgrading to Symfony 3.0.2 everything worked flawlessly - creating a service alias wasn't necessary.Upbraid
I had this issue after I ran composer update on 2.6.9. This fixed the issue. Thanks a lot.Item
P
2

My solution work like a charm... All works with huge mongo dataset

FIX For MongoDB using ODM:

# FIX doctrine registry service for 3.0 and 2.8 sf version
fos_user.doctrine_registry:
    alias: doctrine_mongodb
Posner answered 31/1, 2016 at 10:17 Comment(1)
great work. only post I've seen about mongodb doctrine aliasPhlebotomy

© 2022 - 2024 — McMap. All rights reserved.