Skip to content

Issue on starting queue consuming, missing doctrine messages table #46609

@lhervieux

Description

@lhervieux

Symfony version(s) affected

4.4.40

Description

Since last symfony/messenger update, facing MySql error when starting consuming messenger queues.

In DoctrineReceiver.php line 63:
                                                                               
  An exception occurred while executing 'DELETE FROM messenger_messages WHERE delivered_at = ?' with params ["9999-12-31"]:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'messenger_messages' doesn't exist                                               
                                                                               
In AbstractMySQLDriver.php line 61:
                                                                               
An exception occurred while executing 'DELETE FROM messenger_messages WHERE delivered_at = ?' with params ["9999-12-31"]:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'messenger_messages' doesn't exist                                               
                                                                               
In Exception.php line 18: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'messenger_messages' doesn't exist                                               
                                                                               

In PDOStatement.php line 117: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'messenger_messages' doesn't exist

According the documentation, the table messenger_messages is automatically created when the transport is used. In my case, I use this transport only for failure messages.

This bug

How to reproduce

Configure a doctrine transport only for failure messages and a other one (redis, amqp..) for success ones. Start consuming your messages with supervisor.

Possible Solution

In the Symfony\Component\Messenger\Transport\Doctrine\Connection class, for each operation on doctrine table, check this table is created : check table messenger_messages;

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions