Reda Hazmi A-nwo
Reda Hazmi A-nwo

Reputation: 1

symfony fatal error after removing bundle

I created a bundle named UserBundle and when I needed to remove it I did this exacly :

  1. Unregister the Bundle in the AppKernel
  2. Remove Bundle Configuration 2.1 Remove Bundle Routing 2.2 Remove Bundle Configuration
  3. Remove the Bundle from the Filesystem 3.1 Remove Bundle Assets
  4. Remove Integration in other Bundles

but when I try to exec soms command this is what I Get :

[Symfony\Component\Config\Exception\FileLoaderLoadException] Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? in @UserBundle/Resources/config/s ervices.yml (which is being imported from "C:\xampp\htdocs\MT\app/config\config.yml"). Make sure the "UserBundle/Resources/config/services.yml" bundle is correctly registered an d loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@UserBundle/Resources/config/services.yml" is not empty.

[InvalidArgumentException] Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the symfony-scripts event terminated with an exception

[RuntimeException] An error occurred when executing the ""cache:clear --no-warmup"" command:

[Symfony\Component\Config\Exception\FileLoaderLoadException] Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? in @UserBundle/Resources/config/services.yml (which is being imported from "C:\xampp\htdocs\MT\app/config\config.yml"). Make sure the "UserBundle/Resources/config/services.yml" bundle is correctly registered and loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@UserBundle/Resources/config/services.yml" is not empty.

When I Refresh the server 'http://127.0.0.1/mt/web/' I get :

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Bundle "UserBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?' in C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:198 Stack trace: #0 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php(232): Symfony\Component\HttpKernel\Kernel->getBundle('UserBundle', false) #1 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Config\FileLocator.php(51): Symfony\Component\HttpKernel\Kernel->locateResource('@UserBundle/Res...', NULL, false) #2 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php(147): Symfony\Component\HttpKernel\Config\FileLocator->locate('@UserBundle/Res...', 'C:\xampp\htdocs...', false) #3 C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php(101): Symfony\Component\Config\Loader\FileLoader-> in C:\xampp\htdocs\MT\vendor\symfony\symfony\src\Symfony\Component\Config\Loader\FileLoader.php on line 179

Upvotes: 0

Views: 1818

Answers (3)

Francesco Abeni
Francesco Abeni

Reputation: 4265

In C:\xampp\htdocs\MT\app\config\config.yml you may have something like:

imports:
    - { resource: @UserBundle/Resources/config/services.yml }

and possibly a configuration section related to the user bundle, i.e.

user_bundle:
    ...

You have to manually remove both to make everything working again.

Upvotes: 1

FAROUK BLALOU
FAROUK BLALOU

Reputation: 728

Try to clear cache manually by removing those folders : "var\cache\dev" and "var\cache\prod" for Symfony 3.x or "app\cache\dev" and "app\cache\prod" for Symfony 2.x .

Upvotes: 0

Fasco
Fasco

Reputation: 243

  1. Can you check if you use this bundle in app/config/service.yml

  2. If it's not working, try to search with your IDE (integrated development environment) your bundle inside your project. If you find some results, just remove them.

  3. Clear the cache

Upvotes: 0

Related Questions