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

Doctrine Migration Bundle (bin/console make:migration ?) runs its own checks for the Messenger component settings #49120

Closed
DavidGarciaCat opened this issue Jan 26, 2023 · 3 comments

Comments

@DavidGarciaCat
Copy link

Symfony version(s) affected

5.4.12

Description

Good day,

As per my report here doctrine/DoctrineMigrationsBundle#485 it seems this issue I am experiencing with the Doctrine Bundle and the Messenger component working with the AMQP implementation are caused by this pull request #36655

It seems the Messenger.yaml file works file when warming up the cache but it throws an error with the Doctrine Bundle and generating migrations - the lines that cause the error seem to be:

                options:
                    exchange:
                        name: async
                        type: direct

Any ideas here?

According to bin/console --version I am running Symfony 5.4.12

Thanks,

How to reproduce

I have a project including the Messenger AMQP vendor as well as the Doctrine Pack.

I get the error when I set up the AMQP transport with the options.exchange key and try to generate a diff migration:

                options:
                    exchange:
                        name: async
                        type: direct

Possible Solution

I'm open to suggestions, but based on doctrine/DoctrineMigrationsBundle#485 it seems to be an issue with the update merged here #36655

Additional Context

No response

@DavidGarciaCat
Copy link
Author

By the way, this is the stack trace I posted on the other repo before being forwarded here:

[root@86f7c8606725 project]# bin/console doctrine:migrations:diff -vvv

In Connection.php line 106:

  [Symfony\Component\Messenger\Exception\InvalidArgumentException]
  Unknown option found: [exchange]. Allowed options are [table_name, queue_name, redeliver_timeout, auto_setup, use_notify, check_delayed_interval, get_notify_timeout].


Exception trace:
  at /opt/project/vendor/symfony/doctrine-messenger/Transport/Connection.php:106
 Symfony\Component\Messenger\Bridge\Doctrine\Transport\Connection::buildConfiguration() at /opt/project/vendor/symfony/doctrine-messenger/Transport/DoctrineTransportFactory.php:43
 Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineTransportFactory->createTransport() at /opt/project/vendor/symfony/messenger/Transport/TransportFactory.php:36
 Symfony\Component\Messenger\Transport\TransportFactory->createTransport() at /opt/project/var/cache/dev/ContainerUghmqjF/getMessenger_Transport_NotificationJsonService.php:26
 ContainerUghmqjF\getMessenger_Transport_NotificationJsonService::do() at /opt/project/var/cache/dev/ContainerUghmqjF/HicceArs_KernelDevDebugContainer.php:924
 ContainerUghmqjF\HicceArs_KernelDevDebugContainer->load() at /opt/project/var/cache/dev/ContainerUghmqjF/getDoctrine_Orm_Messenger_DoctrineSchemaSubscriberService.php:29
 ContainerUghmqjF\getDoctrine_Orm_Messenger_DoctrineSchemaSubscriberService::ContainerUghmqjF\{closure}() at /opt/project/vendor/symfony/doctrine-bridge/SchemaListener/MessengerTransportDoctrineSchemaSubscriber.php:44
 Symfony\Bridge\Doctrine\SchemaListener\MessengerTransportDoctrineSchemaSubscriber->postGenerateSchema() at /opt/project/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:68
 Symfony\Bridge\Doctrine\ContainerAwareEventManager->dispatchEvent() at /opt/project/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/SchemaTool.php:411
 Doctrine\ORM\Tools\SchemaTool->getSchemaFromMetadata() at /opt/project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Provider/OrmSchemaProvider.php:50
 Doctrine\Migrations\Provider\OrmSchemaProvider->createSchema() at /opt/project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Generator/DiffGenerator.php:135
 Doctrine\Migrations\Generator\DiffGenerator->createToSchema() at /opt/project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Generator/DiffGenerator.php:90
 Doctrine\Migrations\Generator\DiffGenerator->generate() at /opt/project/vendor/doctrine/migrations/lib/Doctrine/Migrations/Tools/Console/Command/DiffCommand.php:154
 Doctrine\Migrations\Tools\Console\Command\DiffCommand->execute() at /opt/project/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at /opt/project/vendor/symfony/console/Application.php:1046
 Symfony\Component\Console\Application->doRunCommand() at /opt/project/vendor/symfony/framework-bundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /opt/project/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at /opt/project/vendor/symfony/framework-bundle/Console/Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /opt/project/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at /opt/project/bin/console:41

doctrine:migrations:diff [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--namespace NAMESPACE] [--filter-expression FILTER-EXPRESSION] [--formatted] [--line-length LINE-LENGTH] [--check-database-platform [CHECK-DATABASE-PLATFORM]] [--allow-empty-diff] [--from-empty-schema]

[root@86f7c8606725 project]#

@DavidGarciaCat DavidGarciaCat changed the title Doctrine Migration Bundle runs its own checks for the Messenger component? Doctrine Migration Bundle (bin/console make:migration ?) runs its own checks for the Messenger component settings Jan 27, 2023
@xabbuh
Copy link
Member

xabbuh commented Jan 29, 2023

Can you create a small example application that allows to reproduce your issue?

@xabbuh
Copy link
Member

xabbuh commented Feb 9, 2023

I am going to close here for now due to the lack of feedback. Please let us know when you have more information and we can consider to reopen.

@xabbuh xabbuh closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants