1

Topic: In dovecot.log Error: read(/var/run/dovecot/dict-server) failed

==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Debian 6 Squeeze  2.6.32.17
- Related log if you're reporting an issue: dovecot.log
====

When the number of connected sessions 100-130 in dovecot.log appear lines like this:

Mar 14 11:27:26 IMAP(abc@chemical.ru): Warning: read(/var/run/dovecot/dict-server): dict lookup took 12 seconds
Mar 14 11:27:52 IMAP(cba@chemical.ru): Error: read(/var/run/dovecot/dict-server) failed: Timeout after 30 seconds
Mar 14 11:27:52 IMAP(cba@chemical.ru): Error: Internal quota calculation error

... and e-mail clients can not login.
Server load is low.

Please help to solve this problem.

2

Re: In dovecot.log Error: read(/var/run/dovecot/dict-server) failed

Dmitry wrote:

Mar 14 11:27:52 IMAP(cba@chemical.ru): Error: Internal quota calculation error

Could you please show us output of command "dovecot -n" to help troubleshoot?

3

Re: In dovecot.log Error: read(/var/run/dovecot/dict-server) failed

dovecot -n
# 1.2.15: /etc/dovecot/dovecot.conf
Warning: fd limit 1024 is lower than what Dovecot can use under full load (more than 4096). Either grow the limit or change login_max_processes_count and max_mail_processes settings
# OS: Linux 2.6.32-17-pve i686 Debian 6.0.6
log_path: /var/log/dovecot.log
protocols: pop3 pop3s imap imaps managesieve
listen(default): *
listen(imap): *
listen(pop3): *
listen(managesieve): 127.0.0.1:4190
ssl: required
ssl_ca_file: /etc/ssl/certs/iRedMail_CA.pem
ssl_cert_file: /etc/ssl/certs/iRedMail_CA.pem
ssl_key_file: /etc/ssl/private/iRedMail.key
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
login_process_per_connection: no
login_process_size: 128
login_processes_count: 4
login_max_processes_count: 1024
login_max_connections: 1024
max_mail_processes: 1024
first_valid_uid: 1000
last_valid_uid: 1000
mail_uid: 1000
mail_gid: 1000
mail_location: maildir:/%Lh/Maildir/:INDEX=/%Lh/Maildir/
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_process_size: 512
mail_plugins(default): quota imap_quota autocreate
mail_plugins(imap): quota imap_quota autocreate
mail_plugins(pop3): quota
mail_plugins(managesieve):
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
imap_client_workarounds(default): tb-extra-mailbox-sep
imap_client_workarounds(imap): tb-extra-mailbox-sep
imap_client_workarounds(pop3):
imap_client_workarounds(managesieve):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
pop3_client_workarounds(managesieve):
namespace:
  type: private
  separator: /
  inbox: yes
  list: yes
  subscriptions: yes
namespace:
  type: shared
  separator: /
  prefix: Shared/%%u/
  location: maildir:/%%Lh/Maildir/:INDEX=/%%Lh/Maildir/Shared/%%u
  list: children
  subscriptions: yes
lda:
  postmaster_address: root
  auth_socket_path: /var/run/dovecot/auth-master
  mail_plugins: quota sieve autocreate
  sieve_global_path: /var/vmail/sieve/dovecot.sieve
  log_path: /var/log/sieve.log
auth default:
  mechanisms: plain login
  default_realm: chemical.ru
  user: vmail
  passdb:
    driver: ldap
    args: /etc/dovecot/dovecot-ldap.conf
  userdb:
    driver: ldap
    args: /etc/dovecot/dovecot-ldap.conf
  socket:
    type: listen
    client:
      path: /var/spool/postfix/dovecot-auth
      mode: 438
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 438
      user: vmail
      group: vmail
plugin:
  quota_warning: storage=85%% /usr/local/bin/dovecot-quota-warning.sh 85
  quota_warning2: storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90
  quota_warning3: storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95
  quota: dict:user::proxy::quotadict
  quota_rule: *:storage=0
  expire: Trash 7 Trash/* 7 Junk 30
  expire_dict: proxy::expire
  auth_socket_path: /var/run/dovecot/auth-master
  sieve: /%Lh/sieve/dovecot.sieve
  autocreate: INBOX
  autocreate2: Sent
  autocreate3: Trash
  autocreate4: Drafts
  autocreate5: Junk
  autosubscribe: INBOX
  autosubscribe2: Sent
  autosubscribe3: Trash
  autosubscribe4: Drafts
  autosubscribe5: Junk
  acl: vfile
  acl_shared_dict: proxy::acl
  sieve: /var/vmail/sieve/%Ld/%Ln/dovecot.sieve
  sieve_dir: /var/vmail/sieve/%Ld/%Ln
dict:
  expire: db:/var/lib/dovecot/expire/expire.db
  quotadict: mysql:/etc/dovecot/dovecot-used-quota.conf
  acl: mysql:/etc/dovecot/dovecot-share-folder.conf

=========

A similar problem in file descriptor limit...

4

Re: In dovecot.log Error: read(/var/run/dovecot/dict-server) failed

No idea yet, sorry. But i saw this message:

Dmitry wrote:

Warning: fd limit 1024 is lower than what Dovecot can use under full load (more than 4096). Either grow the limit or change login_max_processes_count and max_mail_processes settings

login_max_processes_count: 1024
login_max_connections: 1024
max_mail_processes: 1024

iRedMail comments out above 3 settings by default, and you turned them on. So you should fix them as suggested by dovecot (text marked in red).

5

Re: In dovecot.log Error: read(/var/run/dovecot/dict-server) failed

After I commented out lines:
#login_processes_count: 4
#login_max_processes_count: 1024
#login_max_connections: 1024
#max_mail_processes: 1024

log show this:
Mar 15 10:08:43 dovecot: Error: Maximum number of mail processes exceeded (see max_mail_processes setting)
Mar 15 10:08:43 imap-login: Info: Internal login failure (auth failed, 1 attempts): user=<abc@chemical.ru>, method=PLAIN, rip=192.168.0.10, lip=192.168.0.4, TLS
Mar 15 10:08:43 dovecot: Error: Maximum number of mail processes exceeded (see max_mail_processes setting)
Mar 15 10:08:43 imap-login: Info: Internal login failure (auth failed, 1 attempts): user=<abc@chemical.ru>, method=PLAIN, rip=192.168.0.10, lip=192.168.0.4, TLS

6 (edited by Dmitry 2013-03-18 18:58:41)

Re: In dovecot.log Error: read(/var/run/dovecot/dict-server) failed

After uncomment:

max_mail_processes: 1024

error no longer appears.
Authorization is normally and dovecot works fine