3

I installed fresh Symfony (with "symfony new test") on a fresh LAMP system. I'm trying to generate a bundle but it fails. The output is:

tugrul@tugrul-mint ~/tmp/test2 $ php app/console generate:bundle --namespace NV/TestdBundle --bundle-name=NVTestdBundle --dir=/home/tugrul/tmp/test2/src --format yml --structure

Welcome to the Symfony2 bundle generator  
BLABLABLA
Do you confirm generation [yes]? 

 Bundle generation  

[Twig_Error_Syntax]                                                                                                                                                                      
An exception has been thrown during the compilation of a template ("Level "info" is not defined, use one of: 100, 200, 250, 300, 400, 500, 550, 600") in "bundle/index.html.twig.twig".  

[Psr\Log\InvalidArgumentException]                                               
Level "info" is not defined, use one of: 100, 200, 250, 300, 400, 500, 550, 600  

PHP version:

$ php -v
PHP 5.5.9-1ubuntu4.13 (cli) (built: Sep 29 2015 15:24:49) 

On the production server with exact same version of PHP, Symfony are successfully create a bundle, but not on the local development box.

Am I missing something? Or is there anything to be installed first to run symfony that not mentioned on the documentation?

Regards.

6
  • check into your ./app/config/config_dev.yml. I think level "info" not defined for monolog Commented Oct 20, 2015 at 10:28
  • whats it i'm looking for? my local config has no difference with the one on the server. one is running fine and other isn't. and the really weird thing is i cant find my error on google. link Commented Oct 20, 2015 at 10:49
  • well, i had a dirty fix but its not a real solution. i added a new item to monolog level definitions array. /vendor/monolog/monolog/src/Monolog/Logger.php, added 'info'=>'INFO', line to $levels variable. Commented Oct 20, 2015 at 11:01
  • am pretty sure something else is ALSO wrong, causing this, seeing as how the error is displaying bundle/index.html.twig.twig <- notice the 2 times twig Commented Oct 20, 2015 at 13:49
  • there are some files with double twig extensions in the generator bundle. $ find |grep "twig\.twig" Commented Oct 20, 2015 at 15:03

2 Answers 2

2

The problem was the locale. Set it to en_US.UTF-8 and its ok now. Spent 2 days for nothing...

Sign up to request clarification or add additional context in comments.

Comments

0

I can't reproduce this error. The following commands work for me:

$ symfony new test
$ cd test/
$ php app/console generate:bundle --namespace=NV/TestdBundle --bundle-name=NVTestdBundle --dir=src --format=yml --structure

Note that I've changed the --dir option value to src because I'm inside the project's directory.

If still doesn't work for you, remember that you can append -vvv to any Symfony command to output very detailed error information.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.