Single e-mail stop working - Error 500

software
My Mautic version is: v3.0.2
My PHP version is: 7.3.22-1+ubuntu20.04.1+deb.sury.org+1

My problem is:
So, until yesterday my mautic was running perfectly (is about a month that I’m not having any kind of issue), everything was working really fine.

But today, when I tried to send a single e-mail through the contact field, I realized that stop working. The screen keeps loading forever, and the console of chrome shows an 500 (Internal Server Error) status.


I send e-mail almost every day through this feature :roll_eyes:.

These errors are showing in the log:
[2020-12-18 02:25:15] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:segments:update
[2020-12-18 02:25:15] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:campaigns:trigger
[2020-12-18 02:25:15] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:reports:scheduler
[2020-12-18 02:25:15] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:import
[2020-12-18 02:25:15] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:campaigns:rebuild
[2020-12-18 02:25:20] mautic.WARNING: Command mautic:campaigns:rebuild exited with status code 1
[2020-12-18 02:25:20] mautic.WARNING: Command mautic:reports:scheduler exited with status code 1
[2020-12-18 02:25:20] mautic.WARNING: Command mautic:campaigns:trigger exited with status code 1
[2020-12-18 02:25:20] mautic.WARNING: Command mautic:segments:update exited with status code 1
[2020-12-18 02:25:20] mautic.WARNING: Command mautic:import exited with status code 1
[2020-12-18 17:15:08] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:reports:scheduler
[2020-12-18 17:15:08] mautic.WARNING: Command mautic:reports:scheduler exited with status code 1
[2020-12-18 17:15:08] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:import
[2020-12-18 17:15:08] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:social:monitoring
[2020-12-18 17:15:08] mautic.WARNING: Command mautic:import exited with status code 1
[2020-12-18 17:15:08] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:messages:send
[2020-12-18 17:15:08] mautic.WARNING: Command mautic:social:monitoring exited with status code 1
[2020-12-18 17:15:08] mautic.WARNING: Command mautic:messages:send exited with status code 1
[2020-12-18 17:15:08] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:broadcasts:send
[2020-12-18 17:15:08] mautic.WARNING: Command mautic:broadcasts:send exited with status code 1
[2020-12-18 17:31:20] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:reports:scheduler
[2020-12-18 17:31:20] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:import
[2020-12-18 17:31:20] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:social:monitoring
[2020-12-18 17:31:20] mautic.WARNING: Command mautic:import exited with status code 1
[2020-12-18 17:31:20] mautic.WARNING: Command mautic:social:monitoring exited with status code 1
[2020-12-18 17:31:20] mautic.WARNING: Command mautic:reports:scheduler exited with status code 1
[2020-12-18 17:31:20] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:messages:send
[2020-12-18 17:31:20] mautic.WARNING: Command mautic:messages:send exited with status code 1
[2020-12-18 17:31:21] mautic.NOTICE: Doctrine\DBAL\Exception\ConnectionException: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused (uncaught exception) at /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 93 while running console command mautic:broadcasts:send
[2020-12-18 17:31:21] mautic.WARNING: Command mautic:broadcasts:send exited with status code 1

Steps I have tried to fix the problem:
Since I didn’t make any changes (on my VPS or mautic configuration) I don’t know what to do.
I already clear the cache and restart my VPS through AWS.

Hi, actually all your cron commands fail, not just email sending. Did segments upgrade? All okay with your sql tables?
Joey

1 Like

Hi Joey, thanks for answering.

Yes, actually I notice that (that all my cron commands did fail), and this is very weird since I was running the same crons for at least one month, and I didn’t notice any issue. Everything was running fine, campaign, email, segments, etc.

Maybe it can be a problem with my database, a couple of minutes ago, I tried to test segments upgrade, but when I tried to save it, my mautic just stopped working, I get the “Can’t reach this page” error.

Yesterday I tried to log in, and it gave the return: “mautic database connection error (code #0)”, but I notice that just one time.

I solve that with the command line “sudo service mysql start” through ssh.

This is the cron commands that I’m using:

Cron line: */5 * * * * php /var/www/html/bin/console mautic:import
Cron line: 5,20,35,50 * * * * php /var/www/html/bin/console mautic:campaigns:rebuild
Cron line: 2,17,32,47 * * * * php /var/www/html/bin/console mautic:campaigns:trigger
Cron line: 8,23,38,52 * * * * php /var/www/html/bin/console mautic:segments:update
Cron line: 0,15,30,45 * * * * php /var/www/html/bin/console mautic:messages:send
Cron line: 0,15,30,45 * * * * php /var/www/html/bin/console mautic:emails:send
Cron line: 0,15,30,45 * * * * php /var/www/html/bin/console mautic:email:fetch
Cron line: 0,15,30,45 * * * * php /var/www/html/bin/console mautic:social:monitoring
Cron line: * */30 * * * php /var/www/html/bin/console mautic:webhooks:process
Cron line: 0,15,30,45 * * * * php /var/www/html/bin/console mautic:broadcasts:send
Cron line: * 1 * * * php /var/www/html/bin/console mautic:maintenance:cleanup --days-old=90 --dry-run
Cron line: 0 4 15 * * php /var/www/html/bin/console mautic:iplookup:download
Cron line: */5 * * * * php /var/www/html/bin/console mautic:reports:scheduler
Cron line: 0 5 10 * * php /var/www/html/bin/console mautic:unusedip:delete

The single mail is working again (and I didn’t did anything), but now my mautic just work for a couple of minutes, after that, I have to restart my AWS VPS.

My VPS hardware is very modest, so I don’t know if this may be the problem:

description: Computer
product: t3a.micro
vendor: Amazon EC2
width: 64 bits
capabilities: smbios-2.7 dmi-2.7 smp vsyscall32
*-core
description: Motherboard
vendor: Amazon EC2
physical id: 0
*-firmware
description: BIOS
vendor: Amazon EC2
physical id: 0
version: 1.0
date: 10/16/2017
size: 64KiB
capacity: 64KiB
capabilities: pci edd acpi virtualmachine
*-cpu
description: CPU
product: AMD EPYC 7571
vendor: Advanced Micro Devices [AMD]
physical id: 4
bus info: cpu@0
version: AMD EPYC 7571
slot: CPU 0
size: 2200MHz
capacity: 3GHz
width: 64 bits
clock: 100MHz
capabilities: lm fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp x86-64 constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch topoext vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero xsaveerptr arat npt nrip_save
configuration: cores=1 enabledcores=1 threads=2
*-memory
description: System memory
physical id: 1
size: 1GiB

My database is very small, i have only:
Contacts: 251
Mail templates: 6
Segments: 10

I don’t know what to do here, if you have any recommendation or test that I should be running, I will appreciate that. Thank you!

Hi @rodrigooliveira, have you solved this issue?
I have the same and need to restore everyday.
@joeyk could you look at this?