i'm new to symfony 4, i tried to install admin panel by composer require admin command, but it sounds error :
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In Definition.php line 770:
!!
!! The deprecation template must contain the "%service_id%" placeholder.
!!
!!
!!
Script #auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
a new commit that seems to fix this issue was merged today in the repo EasyCorp/EasyAdminBundle.
Until they release next version, you could do
symfony composer req admin:3.0.x-dev
Related
i've tried to update Symfony 4.3 runing the command "composer update". 107 packages were updated . then in the end of the script an error appeared when runing the command "cache:clear"
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In ArrayNode.php line 327:
!!
!! Unrecognized options "dir_name, namespace" under "doctrine_migrations". Ava
!! ilable options are "all_or_nothing", "check_database_platform", "connection
!! ", "custom_template", "em", "factories", "migrations", "migrations_paths",
!! "organize_migrations", "services", "storage".
!!
!!
!!
Script #auto-scripts was called via post-update-cmd
i did some reserches and i foud that i have to update the DoctrineMigrations config file
config/packages/doctrine_migrations.yaml :
from
doctrine_migrations:
dir_name: '%kernel.project_dir%/src/Migrations'
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
namespace: DoctrineMigrations
to
doctrine_migrations:
migrations_paths:
"App\\Migrations": "src/Migrations"
Here are the steps, I am following:
Cloning my repository from github
git clone https://github.com/EresDev/EresNoteSymfony.git .
Updating .env file with APP_ENV=prod
Then performing install
composer install --no-dev
I get following error:
.
.
.
- Installing symfony/translation (v4.2.4): Loading from cache
- Installing symfony/validator (v4.2.4): Loading from cache
- Installing symfony/yaml (v4.2.4): Loading from cache
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!!
Script #auto-scripts was called via post-install-cmd
However, it works fine if I just use composer install without --no-dev
What can I do to make it work with --no-dev
Please refer to repository to access code if required.
apparently you have somehow managed to turn error display off (or it's some default). I get a very distinct error message when I run composer install --no-dev (run with commit e722218...)
!! PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "TwigBundle" from namespace "Symfony\Bundle\TwigBundle".
!! Did you forget a "use" statement for another namespace? in [path]/EresNoteSymfony/src/Kernel.php:23
!! Stack trace:
!! #0 [path]/EresNoteSymfony/vendor/symfony/http-kernel/Kernel.php(424): App\Kernel->registerBundles()
!! #1 [path]/EresNoteSymfony/vendor/symfony/http-kernel/Kernel.php(130): Symfony\Component\HttpKernel\Kernel->initializeBundles()
!! #2 [path]/EresNoteSymfony/vendor/symfony/framework-bundle/Console/Application.php(65): Symfony\Component\HttpKernel\Kernel->boot()
!! #3 [path]/EresNoteSymfony/vendor/symfony/console/Application.php(145): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
!! #4 [path]/EresNoteSymfony/bin/console(38): Symfony\Component\Console\Application->run(Object(Symfony\Componen in [path]/EresNoteSymfony/src/Kernel.php on line 23
!!
you should somehow turn error display on ;o)
update:
your config/bundles.php:6 says:
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
which essentially says, the twigbundle is expected in prod as well as in dev. thus the error? (but anyway, the point still stands, that you should display errors when running on cli)
after you change that line in your bundles.php, you have to move your twig.yaml config into the dev/test folders, I suppose.
I was using everyday assetic in work (OS: Win7) but today i was runned command: php bin/console assetic:watch and get this error:
[Symfony\Component\Debug\Exception\ContextErrorException] Notice: unserialize(): Error at offset 0 of 25228 bytes
I was try clear cache - don't help.
I not delete any file and in repository that file not exist and this project is on 3 machines (don't have access now only to 1) and everywhere it works...
Nothing was updated or installed to project so far as i know.
So helped delete all files with prefix assetic_watch_* in %LOCALAPPDATA%\Temp\
bin/console assetic:watch --force also cleared for me.
I did the following :
1) I installed a fresh Symfony 3.2.2 version with this command line : php symfony.phar new Symfony3.2.2
2) I tested the version screen display with this url : http://localhost/Symfony3.2.2/web/app_dev.php/ and it well displays "Welcome to
Symfony 3.2.2 .... "
3) Then I did an update of symfony and all depencies with this command : php ../composer.phar update symfony/symfony --with-dependencies
4) I did not expected it updates anything (since I have installed latest version) but it seems it does, like "Updating twig/twig (v1.31.0 => v2.1.0)" and some few others libs (doctrine collections/annotations/common)
5) Then I retest http://localhost/Symfony3.2.2/web/app_dev.php/ but this times I got this error :
Twig_Error_Syntax in classes.php line 5280:
An exception has been thrown during the compilation of a template ("Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in C:\wamp\www\Symfony3.2.2\var\cache\dev\classes.php on line 5573 and defined") in "#Twig/Exception/exception_full.html.twig".
6) I have tried to clear cache with command : php bin/console cache:clear and then retest step 5) but I got same error
So all suggestions are welcome... thanks in advance for help
I have fixed by myself... it was a PHP issue... after the update, PHP 7 must be used instead PHP 5 (for some libs as Twig I presume like mentioned here )
I had this error while running phpunit on a symphony project
Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException: You have requested a non-existent parameter "secret_parameter".
The parameter was in a .html.twig file. I attempted to suppress the error by removing the line with "secret_parameter".
The string "secret_parameter" is no longer in my project.
However, if I try to run phpunit, I still get the same error.
Why is that?
I have tried running this line to clear the cache but it has not helped:
php bin/console cache:clear
The full stacktrace of my error is:
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:84
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:200
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:171
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:161
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:161
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:161
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:45
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:104
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:571
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:510
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:132
/home/jon/NetBeansProjects/spankthatmonkey/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:145
/home/jon/NetBeansProjects/spankthatmonkey/tests/HelloWorld/UserBundle/Entity/UserRepositoryTest.php:23
When you do
php bin/console cache:clear
you are clearing the cache for the dev environement.
Phpunit use the test environnement.
You should do
php bin/console cache:clear --env=test