Your software
My Mautic version is: 5.2.3 (official docker image mautic:5.2.3-apache)
My PHP version is: the one packaged with the image above
My Database type and version is: MariaDB 11.2.3
Your problem
I deployed mautic on a kubernetes cluster (on bare metal) for testing purposes. This is how I set it up:
-
I created a deployment for running the web interface (running with env DOCKER_MAUTIC_ROLE = mautic_web) and corresponding service/ingress for external access.
-
I created a serie of cronjobs (running with env DOCKER_MAUTIC_ROLE = mautic_cron) to handle periodic tasks as follows:
- mautic:segments:update --no-interaction, --no-ansi, --batch-limit=300 with schedule 0-59/3 * * * *
- mautic:campaigns:update --no-interaction --no-ansi --batch-limit=300 with schedule 1-59/3 * * * *
- mautic:campaigns:trigger --no-interaction --no-ansi --batch-limit=100 with schedule 2-59/3 * * * *
- mautic:broadcasts:send --no-interaction --no-ansi --limit=100 --batch=50 with schedule 0-59/1 * * * *
- mautic:messages:send --no-interaction --no-ansi -vvv with schedule 0-59/1 * * * *
- messenger:consume email --no-interaction --no-ansi -vvv --time-limit=50 with schedule 0-59/1 * * * *
- messenger:consume failed --no-interaction --no-ansi -vvv --time-limit=50 with schedule 0-59/1 * * * *
- messenger:consume hit --no-interaction --no-ansi -vvv --time-limit=50 with schedule 0-59/1 * * * *
- mautic:email:fetch --no-interaction --no-ansi with schedule 0-59/1 * * * *
and a few optional ones I do not list here because I don’t think are relevant in this context.
I deployed mariadb 11.2.3 for database back-end and mailhog for SMTP testing using helm charts.
- I created/mounted two volumes for persisting media (/var/www/html/media) and plugins (/var/www/html/plugins).
For both web/cron roles I set the following environment variables:
database access:
MAUTIC_DB_HOST: my-mariadb-host
MAUTIC_DB_PORT: 3306
MAUTIC_DB_NAME: mautic
MAUTIC_DB_DATABASE: mautic # not clear if needed but mentioned sometimes
MAUTIC_DB_USER: mautic
MAUTIC_DB_PASSWORD: my-mariadb-password # stored in a secret
MAUTIC_DB_DRIVER: pdo_mysql
doctrine queues:
MAUTIC_MESSENGER_TRANSPORT_DSN: doctrine://default
MAUTIC_MESSENGER_DSN_EMAIL: doctrine://default
MAUTIC_MESSENGER_DSN_HIT: doctrine://default
MAUTIC_MESSENGER_DSN_FAILED: doctrine://default
I could log in the web interface, create a new user, configure the email settings to send e-mails to my dummy mailhog deployment (DSN = smtp://my-mailhog-service:1025) and successfully sent/received the test e-mail.
I imported some test companies and contacts, created segments, and set up a simple campaign and e-mail message to be sent but, for some reason, MAUTIC IS NOT SENDING OUT ANY E-MAIL to the dummy mailhog SMTP service.
In the campaign view I can see that mautic has scheduled a few e-mails for sending (which I believe it means it placed them in the doctrine queues for sending), but it seems that the cron jobs are not correctly fetching them and have nothing to send out to the dummy SMTP service.
Here the logs from the cron job which i believe is responsible for sending messages (the docs are not clear on this):
k logs mautic-cron-messages-send-29159474-hp22d
[2025-06-10 15:14:01] Processing message queue
[2025-06-10 15:14:01] Messages sent: 0
Here the logs from the cron jons responsible for consuming email:
k logs mautic-cron-messenger-consume-email-29159476-z4qjk
[OK] Consuming messages from transport “email”.
// The worker will automatically exit once it has been running for 50s or
// received a stop signal via the messenger:stop-workers command.
// Quit the worker with CONTROL-C.
Here the logs from the cron jons responsible for consuming failed:
k logs mautic-cron-messenger-consume-failed-29159494-2lj7l
[OK] Consuming messages from transport “failed”.
// The worker will automatically exit once it has been running for 50s or
// received a stop signal via the messenger:stop-workers command.
// Quit the worker with CONTROL-C.
So there is no error in the logs, but e-mails are not being sent out to the configured SMTP service.
Does anybody know how what’s wrong with my deployment?
I could not find much about deploying Mautic on Kubernetes on this forum, and some threads seemed to suggest that the docker image is not maintained and should not be used, although new versions are constantly released on docker hub (a couple weeks passed and now it is at v5.2.6). IS IT POSSIBLE TO DEPLOY MAUTIC USING THE DOCKER IMAGE OR SHOULD BE AVOIDED?