Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MonologBundle error on install #30

Closed
Dragonrun1 opened this issue Jan 18, 2013 · 12 comments
Closed

MonologBundle error on install #30

Dragonrun1 opened this issue Jan 18, 2013 · 12 comments

Comments

@Dragonrun1
Copy link

I was doing: php composer.phar update and got

  • Updating monolog/monolog (dev-master 52b454f => 1.2.1)
    Checking out 1.2.1

  • Updating symfony/monolog-bundle (dev-master v2.1.5 => 2.1.x-dev v2.2.0-BETA1)
    Checking out v2.2.0-BETA1
    ...
    PHP Fatal error: Class 'Symfony\Bundle\MonologBundle\MonologBundle' not found in /srv/www/htdocs/icms/app/AppKernel.php on line 10
    PHP Stack trace:
    ...
    Fatal error: Class 'Symfony\Bundle\MonologBundle\MonologBundle' not found in /srv/www/htdocs/icms/app/AppKernel.php on line 10
    ...
    Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

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

Now every time I run php app/console cache:clear now I get the error as well.

@Seldaek
Copy link
Member

Seldaek commented Jan 19, 2013

Sounds like it didn't install correctly. Try: rm -rf vendor/symfony/monolog-bundle && php composer.phar install

@Dragonrun1
Copy link
Author

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
There is no extension able to load the configuration for "monolog" (in /srv/www/htdocs/icms/app/config/config_dev.yml). Looked for namespace "monolog", found "framework", "security", "twig", "swiftmailer", "assetic", "doctrine", "doctrine_migrations", "sensio_framework_extra", "jms_aop", "jms_di_extra", "jms_security_extra", "icms_base_manager", "web_profiler", "sensio_distribution"
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.

Also tried to use update and not working.

@Seldaek
Copy link
Member

Seldaek commented Jan 19, 2013

OK something looks very wrong. Did it not install the monolog bundle when you ran install? Are you sure you have symfony/monolog-bundle required in your composer.json?

@Dragonrun1
Copy link
Author

I deleted the monolog stuff out of config_dev.yml and ran update again and now it put the info into config_prod.yml instead and seems happy :P
It didn't add a line to AppKernal.php for it but when I added it back manually it seems to not give any errors so seem to have got it fixed I'd still like to know why it happened to start with through.

@Seldaek
Copy link
Member

Seldaek commented Jan 19, 2013

Well it shouldn't add the appkernel line automatically so that's alright, but the rest sounds quite strange indeed. That said unless you can reproduce the problem reliably it's a bit hard to fix anything. I will close this for now since it seems to be resolved.

@Seldaek Seldaek closed this as completed Jan 19, 2013
@Tocacar
Copy link

Tocacar commented Jan 28, 2013

I am also having the problem described about re; monolog-bundle:

PHP Fatal error: Class 'Symfony\Bundle\MonologBundle\MonologBundle' not found in /Library/WebServer/Documents/myProject/app/AppKernel.php on line 14

I also get the error re; cache:clear --no-warm-up command

I most definitely have vendor/symfony-monolog-bundle installed and everything was fine until I ran composer install (monolog was installed a while ago, so shouldn't have been affected by composer).

@Seldaek I am going to do as you suggested and delete the bundle then re-install. I will post here to say whether or not it worked.

@Tocacar
Copy link

Tocacar commented Jan 28, 2013

OK, it didn't fix it. Commenting out the reference to MonologBundle() in AppKernel.php and running composer install (where Monolog Bundle is required) gave me this error:

There is no extension able to load the configuration for "monolog" (in /Library/WebServer/Documents/myProject/app/config/config_dev.yml). Looked for namespace "monolog", {found ...big long list of things}

So, I removed all references to monolog from the config_dev.yml and config_prof.yml files and tried composer install again, which gave me this:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "sonata.cache.invalidation.simple" has a dependency on a non-existent service "logger".

So, I rolled back all deletetions/ commenting out and I'm back to square one. Any ideas why this is happening?

@Seldaek
Copy link
Member

Seldaek commented Jan 28, 2013

@Tocacar no idea which versions of what you have now, but I would recommend just removing vendor/symfony and vendor/monolog then running composer update to get the latest versions of everything in compatible ways.

@Tocacar
Copy link

Tocacar commented Jan 28, 2013

@Seldaek Thanks for your quick response. I tried that and it has fixed the problem - thank you.

@didulis
Copy link

didulis commented Mar 4, 2013

I had the same problem. I removed vendor/symfony/monolog-bundle as suggested, but before running "composer.phar update" for second time, I executed "composer.phar self-update", because on first update, it told "Warning: This development build of composer is over 30 days old...." After that everything was fine.
Other thing what I have noticed, I had too update from dev-master v2.1.5 => 2.1.x-dev v2.1.8 on first run of "composer.phar update".

And after running "composer.phar self-update", "composer.phar update" made extra update for symfony/swiftmailer-bundle. So, I think cause of problem could be outdated composer.phar.

@netmikey
Copy link

I just ran into the same problem. What fixed it for me was just running composer.phar update again. On the second update, it went Updating symfony/swiftmailer-bundle and Installing symfony/monolog-bundle, after which everything went back to normal.

There was some composer.phar self-update involved too earlier today, so make sure you're up-to-date ;)

@hexmode
Copy link

hexmode commented Jun 6, 2013

I ran into this problem:

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]

The service "sonata.cache.invalidation.simple" has a dependency on a non-existent service "logger".

and tried all the solutions tried here. I could only fix this by patching Resources/config/cache.xml in sonata-project/cache-bundle:

remove <argument type="service" id="logger" /> and add <argument type="service" id="mailer" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants