1

Topic: Could not get a valid IMAP connection after upgrade

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8 MYSQL edition
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Ubuntu 18.0.4 LTS (kernel 4.15.0-51)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After last update yesterday, I have IMAP connection broken for all users (about 50, mostly Exchange-ActiveSync).

/var/log/sogo/sogo.log:

Jun 07 12:32:04 sogod [4416]: [ERROR] <0x55a66605cc30[SOGoMailFolder]:folderINBOX> Could not get a valid IMAP connection
Jun 07 12:32:04 sogod [4416]: [WARN] <0x55a665cc68a0[SOGoMailAccount]:0> IMAP connection is broken, trying to reconnect...

/var/log/dovecot/imap.log:

Jun  7 12:35:39 mx dovecot: imap-login: Login: user=<john.doe@example.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=23891, secured, session=<DbpHZLmKEtJ/AAAB>
Jun  7 12:35:39 mx dovecot: imap(john.doe@example.com): Connection closed (status finished 0.003 secs ago) in=63 out=865

Somehow, system works, sending and receving mails works, but CPU is close to 100% all the time, both a.m. logs are filling up extremely fast, and all users are experienced very slow response, and occasionally lost connection from their Outlook clients.

Is there anyone else with the same issue ?

Any advice how to solve this ?
Is it possible to rollback to previous sogo & sogoactivesync upgrade ?

This is production server, any help will be highly appreciated !

----

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

2

Re: Could not get a valid IMAP connection after upgrade

Hi,

What did you update yesterday? How?

What is using the cpu (you can check with "top")?

3 (edited by buggy09 2019-06-08 01:16:32)

Re: Could not get a valid IMAP connection after upgrade

top CPU are fail2ban and sogo.
I upgraded everything available, as well as upgraded to the newest kernel (4.15.0-51):

apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot
root@mx:/var/log# grep upgrade /var/log/dpkg.log
2019-06-06 20:24:25 upgrade libapt-pkg5.0:amd64 1.6.10 1.6.11
2019-06-06 20:24:25 upgrade libapt-inst2.0:amd64 1.6.10 1.6.11
2019-06-06 20:24:25 upgrade libdb5.3:amd64 5.3.28-13.1ubuntu1 5.3.28-13.1ubuntu1.1
2019-06-06 20:24:26 upgrade apt:amd64 1.6.10 1.6.11
2019-06-06 20:24:27 upgrade apt-utils:amd64 1.6.10 1.6.11
2019-06-06 20:24:27 upgrade update-notifier-common:all 3.192.1.5 3.192.1.7
2019-06-06 20:24:27 upgrade linux-libc-dev:amd64 4.15.0-50.54 4.15.0-51.55
2019-06-06 20:24:28 upgrade php7.2-mysql:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:28 upgrade php7.2-opcache:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:28 upgrade php7.2-intl:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:28 upgrade php7.2-json:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:29 upgrade php7.2-readline:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:29 upgrade php7.2-mbstring:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:29 upgrade php7.2-curl:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:29 upgrade php7.2-fpm:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:30 upgrade php7.2-xml:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:30 upgrade php7.2-gd:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:31 upgrade php7.2-cli:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:31 upgrade php7.2-common:amd64 7.2.17-0ubuntu0.18.04.1 7.2.19-0ubuntu0.18.04.1
2019-06-06 20:24:32 upgrade python-jinja2:all 2.10-1 2.10-1ubuntu0.18.04.1
2019-06-06 20:24:32 upgrade libsbjson2.3:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:32 upgrade libsope-xml4.9:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:33 upgrade libsope-core4.9:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:33 upgrade libsope-mime4.9:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:33 upgrade libsope-appserver4.9:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:33 upgrade libsope-gdl1-4.9:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:33 upgrade libsope-ldap4.9:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:34 upgrade sogo-activesync:amd64 4.0.7.20190530-1 4.0.7.20190606-1
2019-06-06 20:24:34 upgrade sope4.9-libxmlsaxdriver:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:34 upgrade sope4.9-gdl1-mysql:amd64 4.9.r1664.20190524 4.9.r1664.20190605
2019-06-06 20:24:34 upgrade sogo:amd64 4.0.7.20190530-1 4.0.7.20190606-1
2019-06-06 20:27:49 upgrade linux-generic:amd64 4.15.0.50.52 4.15.0.51.53
2019-06-06 20:27:49 upgrade linux-image-generic:amd64 4.15.0.50.52 4.15.0.51.53
2019-06-06 20:27:53 upgrade linux-headers-generic:amd64 4.15.0.50.52 4.15.0.51.53

php upgrade was asking wether to keep existing php.ini or overwrite with the new, I kept existing one.

4 (edited by Neutro 2019-06-08 01:19:01)

Re: Could not get a valid IMAP connection after upgrade

The sogo upgrade might have overwritten the iredmail sogo config file (/etc/sogo/sogo.conf) , thus creating your problems.

Do you have a backup of this config file before updating? The sogo update process might have renamed your old config file to /etc/sogo/sogo.conf.<date of update>, it's worth checking as well.

If so, i'd recommend comparing the two of them, you might see a difference that would explain the problem.

Also make a system image of your server next time before upgrading wink

5

Re: Could not get a valid IMAP connection after upgrade

I have full backup before upgrade, sogo.conf was not touched.

6

Re: Could not get a valid IMAP connection after upgrade

I tried again with the restored server. Before upgrade, everything works perfectly. After upgrade, same errors. These were packages available for upgrade:

The following packages will be upgraded:
  apt apt-utils libapt-inst2.0 libapt-pkg5.0 libdb5.3 libsbjson2.3 libsope-appserver4.9 libsope-core4.9 libsope-gdl1-4.9 libsope-ldap4.9 libsope-mime4.9 libsope-xml4.9 linux-libc-dev php7.2-cli php7.2-common php7.2-curl php7.2-fpm
  php7.2-gd php7.2-intl php7.2-json php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml python-jinja2 sogo sogo-activesync sope4.9-gdl1-mysql sope4.9-libxmlsaxdriver update-notifier-common

And again same errors:

Jun 07 19:45:08 sogod [17330]: [ERROR] <0x557cafe8f860[SOGoMailAccount]:0> Could not get a valid IMAP connection
Jun 07 19:45:08 sogod [17330]: [WARN] <0x557cafe8f860[SOGoMailAccount]:0> IMAP connection is broken, trying to reconnect...
Jun 07 19:45:08 sogod [17329]: [WARN] <0x557caf5866c0[SOGoMailAccount]:0> IMAP connection is broken, trying to reconnect...
Jun 07 19:45:08 sogod [17329]: [ERROR] <0x557caf5866c0[SOGoMailAccount]:0> Could not get a valid IMAP connection
Jun 07 19:45:08 sogod [17329]: <0x0x557caf345e10[NGImap4Client]> ERROR(-[NGImap4Client _processUnknownCommandParserException:]): catched non-IMAP4 parsing exception NGSocketException: NGActiveSocket is not open
Jun 07 19:45:08 sogod [17330]: [ERROR] <0x557cafe8f860[SOGoMailAccount]:0> Could not get a valid IMAP connection

Server is Ubuntu 18.04, and it was standard iRedMail installation without much (if any) customization.

7

Re: Could not get a valid IMAP connection after upgrade

Search "_limit" in /var/log/dovecot/*.log, it's possible that Dovecot reaches the client limit. Please increase the limit if you get any warning message from log file.