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.

Francesco Casula
  • 26,184
  • 15
  • 132
  • 131
ken
  • 399
  • 1
  • 3
  • 6
  • 1
    Yes also experiencing this... will keep debugging and see what I find. – Andre Jan 27 '16 at 08:25
  • 2
    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. – A.L Jan 28 '16 at 12:24
  • 1
    Originally tagged as Symfony 3, but appears applicable to various Symfony 2 versions as well as noted below. – ken Jan 28 '16 at 23:08

2 Answers2

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
Andre
  • 2,449
  • 25
  • 24
  • Thanks for @xabbuh, for this fix! It is not working for 3.0 (possibly 2.8 too) though. – Ilya Yarkovets Jan 27 '16 at 08:42
  • 1
    Thanks. Has worked for me. I am using Symfony 3.0.* and fosuserbundle "dev-master@dev" – ken Jan 27 '16 at 08:44
  • 1
    Worked for me on Symfony 2.7.8. Thanks! – Erik Verboom Jan 27 '16 at 10:05
  • 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 442 – Ravioli87 Jan 29 '16 at 14:53
  • It works thanks, be sure to import app/config/service.yml on app/config/config.yml, otherwise put this on your service.yml bundle – Benji_X80 Feb 01 '16 at 10:13
  • is nobody testing before to commit in symfony(fos)? ahh php bad practices :) – fpilee Feb 02 '16 at 16:20
  • 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. – tftd Feb 03 '16 at 18:45
  • I had this issue after I ran composer update on 2.6.9. This fixed the issue. Thanks a lot. – Strabek Mar 18 '16 at 10:26
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