Messages not processed from queue

Hello, how are you? What’s the Telegram link to join? I’m dealing with something I still can’t resolve, and it’s been several days. Best regards, Chapa

Is there a Telegram? Usually, we resolve everything on the forum; you ask a question and the community helps you.

1 Like

Hello,
I have a topic I posted 3 days ago and no one has dared to respond (or maybe it didn’t happen to them like it did to me).

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:

  1. 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',
  1. 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!
  2. .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 'Desde .env: ' . ($ENV['MAUTIC_MESSENGER_DSN_EMAIL'] ?? 'NO DEFINIDO') . PHP_EOL;
echo 'getenv: ' . (getenv('MAUTIC_MESSENGER_DSN_EMAIL') ?: 'VACÍO') . PHP_EOL;
"
# Output:
Desde .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_email from sync:// to doctrine://default?queue_name=default in local.php
  • Configured Queue Settings via Mautic UI
  • Added environment variables to .env file
  • 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?

Hi folks,

Please don’t post comments on the description of the Spanish category - please create a new topic! :slight_smile: