Articles in this section

Mail stuck in the queue in the server with Plesk: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

Plesk for Linux kb: technical ext: pes ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • E-Mails are stuck in the queue with below messages in /var/log/maillog:

    amavis[26892]: (26892-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=emailsecurity;host=localhost;port=3306': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
    amavis[26892]: (26892-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 132) line 253.
    amavis[26892]: (26892-01) (!)Requesting process rundown after fatal error

  • MariaDB upgrade has been performed recently on the server with SELinux enabled

Cause

MariaDB bug #MDEV-24941: SElinux incorrect label for server socket.

The SELinux context for the MariaDB socket file /var/lib/mysql/mysql.sock has been lost because of an upgrade to MariaDB version affected by the bug. This bug will be fixed in mysql-selinux-1.0.14

Resolution

To workaround the problem until the bug is resolved apply the following steps:

  1. Connect to the server via SSH

Warning: On applying the following step the database server MariaDB will be restarted, which leads to a short inaccessibility of other Plesk related services and websites accessing the database

  1. Run the following command:

    # printf '%s\n' '[Service]' 'ExecStartPost=/sbin/restorecon /var/lib/mysql/mysql.sock' > /etc/systemd/system/mariadb.service.d/restorecon_socket.conf && systemctl daemon-reload && systemctl restart mariadb

  2. Resend the stuck e-mails

The following alternative workarounds are also available:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.