Your software
My Mautic version is: 5.2.8
My PHP version is: 8.3
My Database type and version is: MySQL/MariaDB
OS: Ubuntu 24 (dedicated server, no Docker)
Problem Description:
I have configured Mautic to use Doctrine as the queue transport for emails, but the messenger:consume email command does not process any messages from the queue, even though there are 9,884 messages waiting in the messenger_messages table.
Current Configuration:
- config/local.php contains:
'messenger_dsn_email' => 'doctrine://default?queue_name=default',
'messenger_dsn_hit' => 'doctrine://default?queue_name=default',
'messenger_dsn_failed' => 'doctrine://default?queue_name=failed',
-
Queue Settings in UI (Settings → Configuration → Queue Settings):
- Scheme:
doctrine - Host:
default - Options:
queue_name = default - DSN shown:
doctrine://default?queue_name=default - “Send test message” returns: Success!
- Scheme:
-
.env file contains:
MAUTIC_MESSENGER_DSN_EMAIL=doctrine://default%3Fqueue_name=default
MAUTIC_MESSENGER_DSN_HIT=doctrine://default%3Fqueue_name=default
MAUTIC_MESSENGER_DSN_FAILED=doctrine://default%3Fqueue_name=failed
- Environment variables are loading correctly:
$ sudo -u www-data php8.3 -r "
require '/var/www/mautic/vendor/autoload.php';
\$dotenv = new Symfony\Component\Dotenv\Dotenv();
\$dotenv->loadEnv('/var/www/mautic/.env');
echo 'From .env: ' . (\$_ENV['MAUTIC_MESSENGER_DSN_EMAIL'] ?? 'NOT DEFINED') . PHP_EOL;
echo 'getenv: ' . (getenv('MAUTIC_MESSENGER_DSN_EMAIL') ?: 'EMPTY') . PHP_EOL;
"
# Output:
From .env: doctrine://default?queue_name=default
getenv: doctrine://default?queue_name=default
- Messages exist in database:
SELECT queue_name, COUNT(*) as total FROM messenger_messages GROUP BY queue_name;
-- Result: queue_name=default, total=9884
- Messages are available (not locked):
SELECT COUNT(*) FROM messenger_messages WHERE available_at <= NOW();
-- Result: 9884 (all available)
Steps Taken:
-
Changed
messenger_dsn_emailfromsync://todoctrine://default?queue_name=defaultin local.php -
Configured Queue Settings via Mautic UI
-
Added environment variables to
.envfile -
Cleared cache completely:
rm -rf /var/www/mautic/var/cache/* -
Rebuilt cache:
sudo -u www-data php8.3 bin/console cache:warmup --env=prod -
Restarted PHP-FPM:
systemctl restart php8.3-fpm
Test Performed:
$ sudo -u www-data php8.3 /var/www/mautic/bin/console messenger:consume email --limit=3 -vvv --env=prod
[OK] Consuming messages from transport "email".
// The worker will automatically exit once it has processed 3 messages, been
// running for 60s or received a stop signal via the messenger:stop-workers
// command.
// Quit the worker with CONTROL-C.
$
Result: The command starts, shows “Consuming messages from transport email”, waits for 60 seconds, and exits without processing any messages. No errors are shown, but no messages are consumed either.
Debug Config Output:
$ sudo -u www-data php8.3 bin/console debug:config framework messenger --env=prod | grep -A10 "email:"
email:
dsn: '%env(urlencoded-dsn:MAUTIC_MESSENGER_DSN_EMAIL)%'
retry_strategy:
service: Mautic\MessengerBundle\Retry\RetryStrategy
max_retries: 3
delay: 1000
multiplier: 2
max_delay: 0
serializer: null
options: { }
failure_transport: null
Previous Error (before configuration changes):
When the DSN was set to sync://, I received this error:
You cannot receive messages from the Messenger SyncTransport.
This error no longer appears, but the worker still doesn’t process any messages.
Question:
Why is messenger:consume email not processing messages from the messenger_messages table even though:
- The DSN is correctly configured as
doctrine://default?queue_name=default - There are 9,884 messages in the table with
queue_name='default' - All messages have
available_at <= NOW() - The “Send test message” button in Queue Settings returns “Success!”
- No errors are displayed when running the command
Is there an additional configuration step required for Mautic 5.2.8 to connect the email transport to the default queue in the messenger_messages table?
I need help please
thanks!!!
You can post this at: https://forum.mautic.org/c/support/8
Would you like us to try one last thing before sending this to support? These errors are showing in the log:
Steps I have tried to fix the problem: