Sogo sql Error after install

,

since I’m not on completely safe ground. therefore said I do not quite know what to do.
then you attach these two log files. So I hope that can help me.

I hope that it ok:-)

Excerpts from both logs show this sequence of events:

170330 11:17:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-03-30 11:17:23.468 sogod[1390:1390] ERROR: could not open MySQL4 connection to database 'sogo': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
170330 11:17:24 [Note] Server socket created on IP: '0.0.0.0'.
170330 11:17:25 [Note] /usr/libexec/mysqld: ready for connections.
1 Like

ok,and how to fix it?

I’ve been looking into this:

ERROR: could not open MySQL4 connection to database ‘sogo’: Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)

[WARN] <0x0x7fc797db4e40[GCSChannelManager]> will prevent opening of this channel 5 seconds after…

[ERROR] <0x0x7fc797db4e40[GCSChannelManager]> could not open channel for mysql://localhost/sogo/sogo_user_profile

In this particular case, my theory regarding these errors at startup (or when mariadb/mysqld service is restarted) is that SOGo tries to connect to the database before the mysql socket is ready for connections (hence the errors), and warns the user it will retry the database connection after a few seconds.

This behaviour can be tracked looking at the status of services and at mariadb, sogo and boot logs.


If it works after retrying the connection I think you shouldn’t worry about it.

There are some methods that could be used to get rid of the errors and keep the log a bit “cleaner”, but don’t think they worth it. Here is one of them:

Method 1: drop-in systemd unit conf file

Create and edit a drop-in systemd conf for sogo service:

mkdir -p /etc/systemd/system/sogod.service.d/
vi /etc/systemd/system/sogod.service.d/mariadb.conf

with the following content:

[Unit]
# Wait for mariadb/mysqld to be fully loaded (mysql.sock included).
# see http://community.nethserver.org/t/sogo-sql-error-after-install/6407
Requires=mariadb.service

Apply the changes:

systemctl daemon-reload

Reboot the server.

Note SOGo can use other than mariadb database server; the example applies to NethServer but may not apply to custom installations or other distros.
Other than “Requires” systemd’s statement might fit better and achieve the same result in a more elegant way. Sorry, systemd illiterate here :blush:.

2 Likes

I now test your recipe, and can report that it seems that it works:joy::smiley:
I would like to say many thanks for your support.

1 Like

Please mark the thread as solved.

The previous tweak has an undesired side-effect. This correction might fix it:

Create and edit a drop-in systemd conf for sogo service:

mkdir -p /etc/systemd/system/sogod.service.d/
vi /etc/systemd/system/sogod.service.d/mariadb.conf

with the following content:

[Unit]
# Wait for mariadb/mysqld service
# see http://community.nethserver.org/t/sogo-sql-error-after-install/6407
After=mariadb.service mysqld.service

Apply the changes:

systemctl daemon-reload

Reboot the server to evaluate the whole starting process.

1 Like