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

Invalid handler type "console" given for handler "console" #46

Closed
Maxwell2022 opened this issue Jul 17, 2013 · 5 comments
Closed

Invalid handler type "console" given for handler "console" #46

Maxwell2022 opened this issue Jul 17, 2013 · 5 comments

Comments

@Maxwell2022
Copy link

After installing Symfony Standard Edition and updating it to 2.3.2 using php composer.phar update and got the following error when clearing the cache:

[InvalidArgumentException]                                  
  Invalid handler type "console" given for handler "console" 

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception

just running php app/console trigger the same error

I've tried to downgrade to 2.3.1 but have the same error.
I believe this is related to this PR: #42

The exact exception I have is the following:

InvalidArgumentException: Invalid handler type "console" given for handler "console"

in /var/www/symfony/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php line 308
at MonologExtension->buildHandler(object(ContainerBuilder), 'console', array('type' => 'console', 'bubble' => false, 'priority' => '0', 'level' => 'DEBUG', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'ident' => false, 'logopts' => '1', 'facility' => 'user', 'max_files' => '0', 'action_level' => 'WARNING', 'activation_strategy' => null, 'stop_buffering' => true, 'buffer_size' => '0', 'title' => null, 'members' => array(), 'to_email' => array(), 'content_type' => null)) in /var/www/symfony/vendor/symfony/monolog-bundle/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php line 51
at MonologExtension->load(array(array('handlers' => array('main' => array('type' => 'stream', 'path' => '/var/www/symfony/app/logs/dev.log', 'level' => 'debug'), 'console' => array('type' => 'console', 'bubble' => false)))), object(ContainerBuilder)) in /var/www/symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php line 50
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/symfony/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php line 39
at MergeExtensionConfigurationPass->process(object(ContainerBuilder)) in /var/www/symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php line 119
at Compiler->compile(object(ContainerBuilder)) in /var/www/symfony/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php line 559
at ContainerBuilder->compile() in /var/www/symfony/app/bootstrap.php.cache line 659
at Kernel->buildContainer() in /var/www/symfony/app/bootstrap.php.cache line 595
at Kernel->initializeContainer() in /var/www/symfony/app/bootstrap.php.cache line 380
at Kernel->boot() in /var/www/symfony/app/bootstrap.php.cache line 411
at Kernel->handle(object(Request)) in /var/www/symfony/web/app_dev.php line 28
@stof
Copy link
Member

stof commented Jul 17, 2013

It looks like your configuration file tries to configure the console handler, which is not available in 2.3. It is a new feature for 2.4

The SE uses it in the master branch but it does not in 2.3: https://github.com/symfony/symfony-standard/blob/2.3/app/config/config_dev.yml#L15

Are you sure that you used the config file of the 2.3 edition ?

@Maxwell2022
Copy link
Author

here is composer I've copied / paste from 2.2 branch after downgrading:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "jms/security-extra-bundle": "1.4.*",
        "jms/di-extra-bundle": "1.3.*"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.2-dev"
        }
    }
}

@stof
Copy link
Member

stof commented Jul 17, 2013

What I need is your app/config/config_dev.yml file (the monolog part) as the issue is in your config

@Maxwell2022
Copy link
Author

Yeah, got it, thanks. I don't know why but when you select a different branch of the repo the link to download the ZIP archive in Github still download the master branch. Thanks to point that out.

@nitzer
Copy link

nitzer commented Feb 3, 2014

you can avoid this problem removing the console section under the monolog parameters in the config_dev.yml

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

3 participants