1

Topic: SoGo Can't connect to MySQL server

Hi! Please help me to solve this problem.

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Linux/BSD distribution name and version: Linux mail 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
- Related log if you're reporting an issue:
====

I just installed iRedMail. I have an error in sogo.log:

cat /var/log/sogo/sogo.log.1  | grep ERROR
2015-04-12 11:52:59.143 sogod[2130] ERROR: could not open MySQL4 connection to database 'sogo': Can't connect to MySQL server on '127.0.0.1' (111)
Apr 12 11:52:59 sogod [2130]: [ERROR] <0x0x7ff3de2cad60[GCSChannelManager]> could not open channel <MySQL4Channel[0x0x7ff3de1f6810] connection=0x(null)> for mysql://127.0.0.1/sogo/sogo_user_profile

And every minut in auth.log

cat /var/log/auth.log 
Apr 15 09:35:01 mail CRON[7758]: pam_unix(cron:session): session opened for user sogo by (uid=0)
Apr 15 09:35:01 mail CRON[7759]: pam_unix(cron:session): session opened for user sogo by (uid=0)
Apr 15 09:35:01 mail CRON[7759]: pam_unix(cron:session): session closed for user sogo
Apr 15 09:35:01 mail CRON[7758]: pam_unix(cron:session): session closed for user sogo

And every minute I have a message about it (mail.log)

cat /var/log/mail.log | grep sogo
Apr 15 09:38:02 mail postfix/qmgr[18604]: 33220620076: from=<sogo@mail.mydomain>, size=1196, nrcpt=1 (queue active)
Apr 15 09:38:02 mail amavis[6679]: (06679-18) Passed CLEAN {RelayedInternal}, MYUSERS <sogo@mail.mydomain> -> <sogo@mail.mydomain>, Message-ID: <20150415063801.EA69062007A@mail.mydomain>, mail_id: 5ltnR4R9jpyO, Hits: 0, size: 733, queued_as: 33220620076, 253 ms
Apr 15 09:38:02 mail postfix/local[3750]: 33220620076: to=<sogo@mail.mydomain>, relay=local, delay=0.07, delays=0.04/0/0/0.03, dsn=2.0.0, status=sent (forwarded as 3C963620078)
Apr 15 09:38:02 mail postfix/qmgr[18604]: 3C963620078: from=<sogo@mail.mydomain>, size=1334, nrcpt=1 (queue active)
Apr 15 09:38:02 mail postfix/smtp[7885]: EA69062007A: to=<sogo@mail.mydomain>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.34, delays=0.05/0/0/0.28, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 33220620076)

In postmaster@mydomain are a lot of message with two themes:
1. Cron <sogo@mail> /usr/sbin/sogo-tool expire-sessions 30

2015-04-15 09:42:01.145 sogo-tool[8143] Table 'sogo.sogo_sessions_folder' doesn't exist
/usr/sbin/sogo-tool: Uncaught exception ExecutionFailed, reason: Table 'sogo.sogo_sessions_folder' doesn't exist

2. Cron <sogo@mail> /usr/sbin/sogo-ealarms-notify

<0x0x21519a0[GCSAlarmsFolder]> -[GCSAlarmsFolder recordsForEntriesFromDate:toDate:]: cannot execute fetch: <MySQL4Exception: 0x20a14a0> NAME:ExecutionFailed REASON:Table 'sogo.sogo_alarms_folder' doesn't exist
<0x0x1fb0de0[GCSAlarmsFolder]> -[GCSAlarmsFolder deleteRecordsForEntriesUntilDate:]: cannot delete record: <MySQL4Exception: 0x1fc9590> NAME:ExecutionFailed REASON:Table 'sogo.sogo_alarms_folder' doesn't exist

SoGo's config sogo.conf:

cat /etc/sogo/sogo.conf
{
   
    WOPort = 127.0.0.1:20000;
    SOGoProfileURL = "mysql://sogo:encrypted_password@127.0.0.1:3306/sogo/sogo_user_profile";
    OCSFolderInfoURL = "mysql://sogo:encrypted_password@127.0.0.1:3306/sogo/sogo_folder_info";
    OCSSessionsFolderURL = "mysql://sogo:encrypted_password@127.0.0.1:3306/sogo/sogo_sessions_folder";
   SOGoLanguage = English;
   SOGoLoginModule = Mail;
   SOGoForceExternalLoginWithEmail = YES;
 SOGoMailCustomFromEnabled = YES;
    SOGoEnableEMailAlarms = YES;
    OCSEMailAlarmsFolderURL = "mysql://sogo:encrypted_password@127.0.0.1:3306/sogo/sogo_alarms_folder";
    SOGoIMAPServer = "imap://127.0.0.1:143/";
    SOGoMailingMechanism = smtp;
    SOGoSMTPServer = 127.0.0.1;
   SOGoMemcachedHost = 127.0.0.1;
    SOGoTimeZone = "America/New_York";
    SOGoFirstDayOfWeek = 1;
    SOGoRefreshViewCheck = every_5_minutes;
    SOGoMailReplyPlacement = below;
    SOGoAppointmentSendEMailNotifications = YES;
    SOGoFoldersSendEMailNotifications = YES;
    SOGoACLsSendEMailNotifications = YES;
    SOGoPasswordChangeEnabled = YES;
    SOGoUserSources = (
        {
            type = sql;
            id = vmail_mailbox;
            viewURL = "mysql://sogo:encrypted_password@127.0.0.1:3306/sogo/users";
            canAuthenticate = YES;
            userPasswordAlgorithm = ssha;
            prependPasswordScheme = YES;
        }
    );
}

But there are no tables in MySQL "sogo.sogo_alarms_folder" and "sogo.sogo_sessions_folder". Only "users":

mysql> use sogo;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+----------------+
| Tables_in_sogo |
+----------------+
| users          |
+----------------+
1 row in set (0.00 sec)

What should i do?

2

Re: SoGo Can't connect to MySQL server

Please start sogo service first, SOGo will create required SQL tables automatically.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: SoGo Can't connect to MySQL server

ZhangHuangbin wrote:

Please start sogo service first, SOGo will create required SQL tables automatically.

Ahahaha!!! Thank you! Everything works after "service sogo restart"!

Please tell me, is this normal?
Every minute, 4 posts:

# tail -f /var/log/auth.log
Apr 15 18:32:01 mail CRON[3910]: pam_unix(cron:session): session opened for user sogo by (uid=0)
Apr 15 18:32:01 mail CRON[3911]: pam_unix(cron:session): session opened for user sogo by (uid=0)
Apr 15 18:32:01 mail CRON[3910]: pam_unix(cron:session): session closed for user sogo
Apr 15 18:32:01 mail CRON[3911]: pam_unix(cron:session): session closed for user sogo
Apr 15 18:33:01 mail CRON[3947]: pam_unix(cron:session): session opened for user sogo by (uid=0)
Apr 15 18:33:01 mail CRON[3948]: pam_unix(cron:session): session opened for user sogo by (uid=0)
Apr 15 18:33:01 mail CRON[3948]: pam_unix(cron:session): session closed for user sogo
Apr 15 18:33:01 mail CRON[3947]: pam_unix(cron:session): session closed for user sogo

4

Re: SoGo Can't connect to MySQL server

Yes, you can filter them out using rsyslog config line:

:msg, contains, "pam_unix(cron:session)" ~

Right above the auth line, so it looks like below:

:msg, contains, "pam_unix(cron:session)" ~
auth,authpriv.*         /var/log/auth.log
*.*;auth,authpriv.none      /var/log/syslog

OR if you're running a pretty new version of RSysLogD, the preferred syntax is:

if $msg contains 'pam_unix(cron:session)' then { stop }

By the way, its 4 per minute as its 2 cron jobs, and the start and end of each trigger the log.

5

Re: SoGo Can't connect to MySQL server

7t3chguy wrote:

Yes, you can filter them out using rsyslog config line...

Thank you!
This topic has resolved.