1 (edited by Buck 2020-09-28 23:28:25)

Topic: Cron Mail: Can't connect to MySQL server on '127.0.0.1' (115)

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- 1.3.1
- downloadable installer
- Ubuntu 20.04 LTS
- LDAP
- Nginx
- No iRedAdmin-Pro
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Email:
Cron <root@ired> /bin/bash /usr/local/bin/fail2ban_banned_db unban_db
Content:
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)

On system when checking MySQL Status:

mariadb.service - MariaDB 10.3.22 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─override.conf
     Active: active (running) since Sun 2020-09-27 18:19:07 CEST; 4s ago
....
....
Sep 27 18:19:06  systemd[1]: Starting MariaDB 10.3.22 database server...
Sep 27 18:19:06 mysqld[6384]: 2020-09-27 18:19:06 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-1ubuntu1) starting as proces>
Sep 27 18:19:07 systemd[1]: Started MariaDB 10.3.22 database server.
Sep 27 18:19:07 /etc/mysql/debian-start[6419]: Upgrading MySQL tables if necessary.
Sep 27 18:19:07 /etc/mysql/debian-start[6422]: Looking for 'mysql' as: /usr/bin/mysql
Sep 27 18:19:07 /etc/mysql/debian-start[6422]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Sep 27 18:19:07 /etc/mysql/debian-start[6422]: Version check failed. Got the following error when calling the 'mysql' command li>
Sep 27 18:19:07 /etc/mysql/debian-start[6422]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Sep 27 18:19:07 /etc/mysql/debian-start[6422]: FATAL ERROR: Upgrade failed
Sep 27 18:19:07 debian-start[6435]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

--------------------------------------------------------------
Well just freshly reinstall the iRedMail on a fresh Ubuntu 20.04 LTS.
According to the mail time stamp, this email was received right after the installation.

--------------------------------------------------------------
Update, I did reinstall a on a fresh Ubuntu 20.04.1 LTS again today, and I didn't receive the Cron email above, but the when i check out the MySQL system status, I got the same records as listed above.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Cron Mail: Can't connect to MySQL server on '127.0.0.1' (115)

Buck wrote:

Email:
Cron <root@ired> /bin/bash /usr/local/bin/fail2ban_banned_db unban_db
Content:
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)

Seems the cron job is ran before mysql server is running, safe to ignore when system is booting.