Symfony - Circular reference detected only only cache-clear prod - php

somethings is weird with my cache:clear : in dev environment there's no error but if I did with cache:clear --env=prod , I've got a "Circular reference detected for service".
What's wrong ?
Copy of the stacktrace :
Exception trace:
() at /var/www/nf-platform/symfony/app/bootstrap.php.cache:2235
Symfony\Component\DependencyInjection\Container->get() at /var/www/nf-platform/symfony/vendor/symfony/symfony/src/ Symfony/Bridge/Doctrine/ManagerRegistry.php:35
Symfony\Bridge\Doctrine\ManagerRegistry->getService() at /var/www/nf-platform/symfony/vendor/doctrine/common/lib/D octrine/Common/Persistence/AbstractManagerRegistry.php:183
Doctrine\Common\Persistence\AbstractManagerRegistry->getManager() at /var/www/nf-platform/symfony/vendor/lexik/tra nslation-bundle/Lexik/Bundle/TranslationBundle/Storage/AbstractDoctrineStorage.php:48
Lexik\Bundle\TranslationBundle\Storage\AbstractDoctrineStorage->getManager() at /var/www/nf-platform/symfony/vendo r/lexik/translation-bundle/Lexik/Bundle/TranslationBundle/Storage/DoctrineORMStorage.php:19
Lexik\Bundle\TranslationBundle\Storage\DoctrineORMStorage->translationsTablesExist() at /var/www/nf-platform/symfo ny/vendor/lexik/translation-bundle/Lexik/Bundle/TranslationBundle/EventDispatcher/GetDatabaseResourcesListener.php: 41
Lexik\Bundle\TranslationBundle\EventDispatcher\GetDatabaseResourcesListener->onGetDatabaseResources() at n/a:n/a
call_user_func() at /var/www/nf-platform/symfony/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Even tDispatcher.php:184
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch() at /var/www/nf-platform/symfony/vendor/symfony/sym fony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:46
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() at /var/www/nf-platform/symfony/vendor/lexik/transla tion-bundle/Lexik/Bundle/TranslationBundle/Translation/Translator.php:28
Lexik\Bundle\TranslationBundle\Translation\Translator->addDatabaseResources() at /var/www/nf-platform/symfony/app/ cache/pro_/appProdProjectContaine_.php:3871
appProdProjectContaine_->getLexikTranslation_TranslatorService() at /var/www/nf-platform/symfony/app/bootstrap.php .cache:2261
Symfony\Component\DependencyInjection\Container->get() at /var/www/nf-platform/symfony/app/cache/pro_/appProdProje ctContaine_.php:7820
appProdProjectContaine_->getTwigService() at /var/www/nf-platform/symfony/app/bootstrap.php.cache:2261
Symfony\Component\DependencyInjection\Container->get() at /var/www/nf-platform/symfony/app/cache/pro_/appProdProje ctContaine_.php:3908
appProdProjectContaine_->getMailManagerService() at /var/www/nf-platform/symfony/app/bootstrap.php.cache:2261
Symfony\Component\DependencyInjection\Container->get() at /var/www/nf-platform/symfony/app/cache/pro_/appProdProje ctContaine_.php:2025
appProdProjectContaine_->getFei_DoctrineListener_UserService() at /var/www/nf-platform/symfony/app/bootstrap.php.c ache:2261
Symfony\Component\DependencyInjection\Container->get() at /var/www/nf-platform/symfony/app/cache/pro_/appProdProje ctContaine_.php:1235
appProdProjectContaine_->getDoctrine_Dbal_DefaultConnectionService() at /var/www/nf-platform/symfony/app/bootstrap .php.cache:2261
Symfony\Component\DependencyInjection\Container->get() at /var/www/nf-platform/symfony/app/cache/pro_/appProdProje ctContaine_.php:1349
appProdProjectContaine_->getDoctrine_Orm_DefaultEntityManagerService() at /var/www/nf-platform/symfony/app/bootstr ap.php.cache:2261
Symfony\Component\DependencyInjection\Container->get() at /var/www/nf-platform/symfony/vendor/symfony/symfony/src/ Symfony/Bridge/Doctrine/ManagerRegistry.php:35
Symfony\Bridge\Doctrine\ManagerRegistry->getService() at /var/www/nf-platform/symfony/vendor/doctrine/common/lib/D octrine/Common/Persistence/AbstractManagerRegistry.php:231
Doctrine\Common\Persistence\AbstractManagerRegistry->getManagers() at /var/www/nf-platform/symfony/vendor/symfony/ symfony/src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php:49
Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer->warmUp() at /var/www/nf-platform/symfony/vendor/symfony/symf ony/src/Symfony/Component/HttpKernel/CacheWarmer/CacheWarmerAggregate.php:48
Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at /var/www/nf-platform/symfony/app/bootst rap.php.cache:2775
Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/www/nf-platform/symfony/app/bootstrap.php.cache :2542
Symfony\Component\HttpKernel\Kernel->boot() at /var/www/nf-platform/symfony/vendor/symfony/symfony/src/Symfony/Bun dle/FrameworkBundle/Command/CacheClearCommand.php:134
Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->warmup() at /var/www/nf-platform/symfony/vendor/symfony/ symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:96
Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand->execute() at /var/www/nf-platform/symfony/vendor/symfony /symfony/src/Symfony/Component/Console/Command/Command.php:241
Symfony\Component\Console\Command\Command->run() at /var/www/nf-platform/symfony/vendor/symfony/symfony/src/Symfon y/Component/Console/Application.php:861
Symfony\Component\Console\Application->doRunCommand() at /var/www/nf-platform/symfony/vendor/symfony/symfony/src/S ymfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at /var/www/nf-platform/symfony/vendor/symfony/symfony/src/Symfony/ Bundle/FrameworkBundle/Console/Application.php:84
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/nf-platform/symfony/vendor/symfony/symfony /src/Symfony/Component/Console/Application.php:117
Symfony\Component\Console\Application->run() at /var/www/nf-platform/symfony/app/console:27
cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [-- ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <comman d>

In my experience with Symfony I find that in some cases the cache:clear command isn't enough. Sometimes I have to clear the cache completely at file system level. Use one of the following commands instead (assuming you're in a Unix like environment).
For Symfony 2.x:
rm -rf ./app/cache/*
For Symfony 3.x and 4.x:
rm -rf ./var/cache/*
If you had any .gitkeep files in there you'll need to touch them again before committing.
You should not need to run cache:clear again after doing this, as Symfony will warm up a brand new cache on your first application request. Expect your first request to take noticeably longer to process though. (10-20 seconds can be expected depending on your app.)
About the circular reference specifically I'd suggest you have two custom service classes both of which have the Symfony service container injected into them, then try to reference each other via $this->container->get('the_other_service')->whatever();.
As of Symfony 4.0 this is no longer supported, forcing you to use dependency injection instead. (Service classes should no longer have the service container injected into them, as tempting and easy as it may appear.) -- I know the struggle this can be particularly when upgrading from Symfony 2.x or 3.x, but we're told it's for the best.

Related

Symfony v4, php bin/console doesn't work as expected. Automatically Aborted [duplicate]

This question already has an answer here:
Why does PHP 7.4 on Windows aborts all command line actions that require user input?
(1 answer)
Closed 1 year ago.
I just installed composer, php, apache etc. on my new SSD. After that I wanted to start coding. I opened my project from another drive in IDE. Then I wanted to load my fixtures into my new database, but I cannot. I cannot even make migrations etc. The php bin/console is broken (It automatically aborts any terminal input etc). I tried to run commands from other terminals, but it doesn't work. You can see commands below w/ or without -vvv. Thanks for any reply how to fix it.
First:
D:\project>php bin/console doctrine:fixtures:load
Careful, database "project1" will be purged. Do you want to continue?
(yes/no) [no]:
>
Aborted.
doctrine:fixtures:load [--append] [--group GROUP] [--em EM] [--shard SHARD] [--purge-with-truncate] [-h|--help] [-q|--quiet] [
-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]
One more:
D:\project>php bin/console make:controller
Choose a name for your controller class (e.g. VictoriousGnomeController):
>
Aborted.
make:controller [--no-template] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-in
teraction] [-e|--env ENV] [--no-debug] [--] []
With verbose
D:\project>php bin/console -vvv make:controller
2019-12-10T12:48:26+00:00 [debug] Notified event "console.command" to
listener "Symfony\Component\HttpKernel\EventListener\Deb
ugHandlersListener::configure".
Choose a name for your controller class (e.g. AgreeableJellybeanController):
2019-12-10T12:48:26+00:00 [error] Error thrown while running command "-vvv make:controller". Message: "Aborted."
2019-12-10T12:48:26+00:00 [debug] Notified event "console.error" to listener "Symfony\Bundle\MakerBundle\Event\ConsoleErrorSub
scriber::onConsoleError".
2019-12-10T12:48:26+00:00 [debug] Notified event "console.error" to listener "Symfony\Component\Console\EventListener\ErrorLis
tener::onConsoleError".
2019-12-10T12:48:26+00:00 [debug] Command "-vvv make:controller" exited with code "1"
2019-12-10T12:48:26+00:00 [debug] Notified event "console.terminate" to listener
"Symfony\Bundle\MakerBundle\Event\ConsoleErro
rSubscriber::onConsoleTerminate".
2019-12-10T12:48:26+00:00 [debug] Notified event "console.terminate" to listener
"Symfony\Component\Console\EventListener\Erro
rListener::onConsoleTerminate".
In QuestionHelper.php line 137:
[Symfony\Component\Console\Exception\RuntimeException]
Aborted.
Exception trace:
at D:\apache\www\itnetwork\vendor\symfony\console\Helper\QuestionHelper.php:137
Symfony\Component\Console\Helper\QuestionHelper->doAsk() at D:\apache\www\itnetwork\vendor\symfony\console\Helper\QuestionHel
per.php:85
Symfony\Component\Console\Helper\QuestionHelper->Symfony\Component\Console\Helper{closure}()
at D:\apache\www\itnetwork\vend
or\symfony\console\Helper\QuestionHelper.php:437
Symfony\Component\Console\Helper\QuestionHelper->validateAttempts() at
D:\apache\www\itnetwork\vendor\symfony\console\Helper\
QuestionHelper.php:88
Symfony\Component\Console\Helper\QuestionHelper->ask() at D:\apache\www\itnetwork\vendor\symfony\console\Style\SymfonyStyle.p
hp:360
Symfony\Component\Console\Style\SymfonyStyle->askQuestion() at D:\apache\www\itnetwork\vendor\symfony\console\Style\SymfonySt
yle.php:267
Symfony\Component\Console\Style\SymfonyStyle->ask() at D:\apache\www\itnetwork\vendor\symfony\maker-bundle\src\Command\MakerC
ommand.php:95
Symfony\Bundle\MakerBundle\Command\MakerCommand->interact() at D:\apache\www\itnetwork\vendor\symfony\console\Command\Command
.php:240
Symfony\Component\Console\Command\Command->run() at D:\apache\www\itnetwork\vendor\symfony\console\Application.php:1029
Symfony\Component\Console\Application->doRunCommand() at D:\apache\www\itnetwork\vendor\symfony\framework-bundle\Console\Appl
ication.php:86
Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at
D:\apache\www\itnetwork\vendor\symfony\console\Applicat
ion.php:272
Symfony\Component\Console\Application->doRun() at D:\apache\www\itnetwork\vendor\symfony\framework-bundle\Console\Application
.php:74
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at D:\apache\www\itnetwork\vendor\symfony\console\Application.php
:148
Symfony\Component\Console\Application->run() at D:\apache\www\itnetwork\bin\console:39
make:controller [--no-template] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-in
teraction] [-e|--env ENV] [--no-debug] [--] []
seems like this issue comes from a bug whitin the php 7.4 release on windows only
https://bugs.php.net/bug.php?id=78883
https://github.com/php/php-src/pull/4961
Other links:
https://github.com/symfony/symfony/issues/34702
https://github.com/symfony/symfony/issues/34754
https://github.com/phpMussel/phpMussel/issues/211
https://github.com/php/php-src/pull/4952

PHP artisan optimize returns error on bitBucket Pipeline

I'm trying to use bitBucket Pipeline with a Laravel. But everytime that run the pipeline return the follow error:
> post-install-cmd: Illuminate\Foundation\ComposerScripts::postInstall
> post-install-cmd: php artisan optimize --verbose
Generating optimized class loader
Compiling common classes
Script php artisan optimize --verbose handling the post-install-cmd event returned with an error
[RuntimeException]
Error Output:
Exception trace:
() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:196
Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:94
Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Installer.php:350
Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:134
Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:256
Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:838
Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:189
Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:167
Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:120
Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:98
Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:43
require() at /usr/local/bin/composer:25
bitbucket-pipelines.yml:
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: phpunit/phpunit:5.0.3
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- composer install --verbose
The problem was solved, I needed to set some environments variable.
To be more specific, I use a collect errors' service called rollbar (really good by the way)
And in config/services.php it was setted like that:
'rollbar' => [
'access_token' => env('ROLLBAR_ACCESS_TOKEN'),
'level' => env('ROLLBAR_LEVEL', 'error'),
],
I just needed to set ROLLBAR_ACCESS_TOKEN variable in Settings/PIPELINES/Environment variables on BitBucket

Cache:clear fails with The annotation "#Doctrine\ORM\Mapping\HasLifeCycleCallbacks" ... does not exist

I'm trying to do a preview release for my customer.
Everything is working fine on my development host in the preview environment.
I created a tarball excluding the stuff that isn't needed on the live site.
tar \
--create \
--auto-compress \
--dereference \
--exclude=.DS_Store \
--exclude=.git \
--exclude=.idea \
--exclude=.nfs* \
--exclude=node_modules \
--exclude=tests \
--exclude=var/cache/* \
--exclude=ToDo* \
--exclude=var/logs/* \
--exclude=var/sessions/* \
--exclude=web/tickets/* \
--file ./preview.tgz
I transferred the tarball to the target host and unpacked it.
Then cded into the directory and issued
sudo bin/console cache:clear --env=preview
Symfony throws the following error:
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "#Doctrine\ORM\Mapping\HasLifeCycleCallbacks" in class Bcs\BcsVmsUserBundle\Entity\VmsUser does not exist, or could not be auto-loaded.
I have manually deleted the contents of the cache directory and still get this error.
2016-0801-1124: Additional information.
I re-generated the auto-load files on the target host. No change.
I verified that the the HasLifeCycleCallbacks class is defined in the autoload files. It's in autoload_static.php and in autoload_classmap.php.
I verified that the file specified in the auto-load files does, indeed, exist.
Verbose output from console cache:clear --env=preview
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] The annotation "#Doctrine\ORM\Mapping\HasLifeCycleCallbacks" in class Bcs\BcsVmsUserBundle\Entity\VmsUser does not exist, or could not be auto-loaded.
Exception trace:
() at /var/www/wwui/preview/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
Doctrine\Common\Annotations\AnnotationException::semanticalError() at /var/www/wwui/preview/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:708
Doctrine\Common\Annotations\DocParser->Annotation() at /var/www/wwui/preview/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:641
Doctrine\Common\Annotations\DocParser->Annotations() at /var/www/wwui/preview/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php:334
Doctrine\Common\Annotations\DocParser->parse() at /var/www/wwui/preview/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php:195
Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations() at /var/www/wwui/preview/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php:83
Doctrine\Common\Annotations\CachedReader->getClassAnnotations() at /var/www/wwui/preview/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php:63
Doctrine\ORM\Mapping\Driver\AnnotationDriver->loadMetadataForClass() at /var/www/wwui/preview/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/Driver/MappingDriverChain.php:102
Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain->loadMetadataForClass() at /var/www/wwui/preview/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:151
Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadMetadata() at /var/www/wwui/preview/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:332
Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata() at /var/www/wwui/preview/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:78
Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata() at /var/www/wwui/preview/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:216
Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->getMetadataFor() at /var/www/wwui/preview/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:281
Doctrine\ORM\EntityManager->getClassMetadata() at /var/www/wwui/preview/vendor/doctrine/orm/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php:44
Doctrine\ORM\Repository\DefaultRepositoryFactory->getRepository() at /var/www/wwui/preview/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:698
Doctrine\ORM\EntityManager->getRepository() at /var/www/wwui/preview/var/cache/preview/appPreviewDebugProjectContainer.php:450
appPreviewDebugProjectContainer->getBcs_Vmsuser_RepositoryService() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275
Symfony\Component\DependencyInjection\Container->get() at /var/www/wwui/preview/var/cache/preview/appPreviewDebugProjectContainer.php:437
appPreviewDebugProjectContainer->getBcs_Vmsuser_LoaderService() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275
Symfony\Component\DependencyInjection\Container->get() at /var/www/wwui/preview/var/cache/preview/appPreviewDebugProjectContainer.php:411
appPreviewDebugProjectContainer->getBcs_Vmsuser_AuthenticatorService() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275
Symfony\Component\DependencyInjection\Container->get() at /var/www/wwui/preview/var/cache/preview/appPreviewDebugProjectContainer.php:4403
appPreviewDebugProjectContainer->getSecurity_Authentication_ManagerService() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275
Symfony\Component\DependencyInjection\Container->get() at /var/www/wwui/preview/var/cache/preview/appPreviewDebugProjectContainer.php:2476
appPreviewDebugProjectContainer->getSecurity_AuthorizationCheckerService() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275
Symfony\Component\DependencyInjection\Container->get() at /var/www/wwui/preview/var/cache/preview/appPreviewDebugProjectContainer.php:1103
appPreviewDebugProjectContainer->getDplhMenuUtilityService() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275
Symfony\Component\DependencyInjection\Container->get() at /var/www/wwui/preview/var/cache/preview/appPreviewDebugProjectContainer.php:1077
appPreviewDebugProjectContainer->getDplhMenuDebugCommandService() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275
Symfony\Component\DependencyInjection\Container->get() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:123
Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:98
Symfony\Bundle\FrameworkBundle\Console\Application->all() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:72
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/wwui/preview/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:117
Symfony\Component\Console\Application->run() at /var/www/wwui/preview/bin/console:29
Development host:
Ubuntu 14.04.4 LTS
PHP 7.0.7-4
Symfony 3.1.2
Target host:
Ubuntu 16.04.1 LTS
PHP 7.0.8-0
Symfony 3.1.2 (as part of the tarball)
Suggestions?
Turns out #Doctrine\ORM\Mapping\HasLifeCycleCallbacks should be #Doctrine\ORM\Mapping\HasLifecycleCallbacks (that's a lowercase c in cycle).
I develop on a Mac which has case-insensitive file systems, by default and deploy to Ubuntu.
Many thanks to sfix and trq on the #symfony IRC node for this answer.

CakePHP Migrations: The "template" option does not exist

I am getting following error when executing
bin/cake migrations create Initial
Error:
[InvalidArgumentException]
The "template" option does not exist.
Plugin is loaded and working.
// Edit: I am using CakePHP 3.0 RC1 fresh installation on a virtualbox with vagrant
Maybe this output helps:
Exception trace:
() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Input/Input.php:180
Symfony\Component\Console\Input\Input->getOption() at /var/www/projects/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php:130
Phinx\Console\Command\Create->execute() at /var/www/projects/vendor/cakephp/migrations/src/ConfigurationTrait.php:145
Migrations\Command\Create->execute() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
Symfony\Component\Console\Command\Command->run() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at /var/www/projects/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /var/www/projects/vendor/cakephp/migrations/src/Shell/MigrationsShell.php:70
Migrations\Shell\MigrationsShell->main() at n/a:n/a
call_user_func_array() at /var/www/projects/vendor/cakephp/cakephp/src/Console/Shell.php:387
Cake\Console\Shell->runCommand() at /var/www/projects/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:200
Cake\Console\ShellDispatcher->_dispatch() at /var/www/projects/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:171
Cake\Console\ShellDispatcher->dispatch() at /var/www/projects/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php:122
Cake\Console\ShellDispatcher::run() at /var/www/projects/bin/cake.php:20
I hope you can help me.
Thx
I am afraid that this is a bug in cakephp/migrations
Look into:
/vendor/cakephp/migrations/src/Command/Create.php
configure() is not calling its parent so changes in underlying phinx library are not taken into account, namely addition of "template" option which is the problem in this case.
IMO configure() should call parent::configure() and leave calls of setName(), setDescription() etc. to phinx - there is an issue open here https://github.com/cakephp/migrations/issues/53

MakeGood + PHPUnit + Eclipse Luna

I try to do tests with PHPUnit & MakeGood on Eclipse but when i run the test from MakeGood i have an error like that :
"Class 'PHPUnit_Framework_TestSuite' not found in D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-testrunner\src\Collector\PHPUnitCollector.php on line 124
Call Stack:
0.0029 267904 1. {main}()
D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\bin\testrunner.php:0
0.3527 2733800 2. Symfony\Component\Console\Application->run() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\bin\testrunner.php:55
0.3988 3124008 3. Symfony\Component\Console\Application->doRun() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\symfony\console\Symfony\Component\Console\Application.php:124
0.4046 3125048 4. Symfony\Component\Console\Application->doRunCommand() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\symfony\console\Symfony\Component\Console\Application.php:193
0.4052 3125472 5. Symfony\Component\Console\Command\Command->run() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\symfony\console\Symfony\Component\Console\Application.php:887
0.4398 3131080 6. Stagehand\TestRunner\CLI\TestRunnerApplication\Command\PluginCommand->execute() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\symfony\console\Symfony\Component\Console\Command\Command.php:252
0.6717 4411720 7. Stagehand\TestRunner\CLI\TestRunnerApplication\Command\PluginCommand->createTestRunner() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-testrunner\src\CLI\TestRunnerApplication\Command\PluginCommand.php:149
0.6718 4411848 8. Stagehand\TestRunner\Core\ApplicationContext->createComponent() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-testrunner\src\CLI\TestRunnerApplication\Command\PluginCommand.php:295
0.6718 4411912 9. Stagehand\ComponentFactory\ComponentFactory->create() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-testrunner\src\Core\ApplicationContext.php:104
0.6720 4412416 10. Symfony\Component\DependencyInjection\Container->get() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-componentfactory\src\Stagehand\ComponentFactory\ComponentFactory.php:76
0.6721 4413008 11. Stagehand\TestRunner\DependencyInjection\PHPUnitContainer->getTestRunnerService() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\symfony\dependency-injection\Symfony\Component\DependencyInjection\Container.php:312
0.6854 4475880 12. Symfony\Component\DependencyInjection\Container->get() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-testrunner\src\DependencyInjection\PHPUnitContainer.php:448
0.6856 4476408 13. Stagehand\TestRunner\DependencyInjection\PHPUnitContainer->getPhpunit_CollectorService() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\symfony\dependency-injection\Symfony\Component\DependencyInjection\Container.php:312
0.6943 4601016 14. Stagehand\TestRunner\Collector\Collector->__construct() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-testrunner\src\DependencyInjection\PHPUnitContainer.php:302
0.6943 4601120 15. Stagehand\TestRunner\Collector\PHPUnitCollector->createTestSuite() D:\Downloads\eclipse\plugins\com.piece_framework.makegood.stagehandtestrunner_3.1.1.v201409021510\resources\php\vendor\piece\stagehand-testrunner\src\Collector\Collector.php:92
"
I correctly import the phpunit.phar in my project on Eclipse (because after this december Pear will be no longer available with PHPUnit) but MakeGood look as he doesn't really happy ...
Thank you in advance for your help.
Currently, MakeGood does not support phpunit.phar. Use PHPUnit as a Composer package as the following:
composer require --dev phpunit/phpunit "4.4.*"

Categories