[Dovecot] Panic: key not found from hash

Hans-Jürgen Mehnert hjmehnert at gmail.com
Mon Feb 6 12:25:05 EET 2006


Hello,

we have about 120 servers doing some million mails per day. Most of
them use dovecot for pop and imap.

In version 1.0.alpha4 we have dovecot-crashes on one or two of the
machines in a week where dovecot log says "Panic: key not found from
hash" and dovecot dies.

We tried version 1.0.beta2 on some machines but with that we have
another problem where log says "Error: auth-worker(default):
sql((USER),(IP)): Password query failed: MySQL client run out of
memory" and the auth process dies.

Couldn't find anything usefull on that on the net so i'll ask the list
bevor i'll post a bug report.


==================== /etc/dovecot.conf ====================

# dovecot pop3 + imap config (rpm)
# SG PN HJM 2005-09-09

## Main

protocols = imap imaps pop3 pop3s
# protocols = pop3 pop3s
ssl_disable = no
ssl_cert_file = /etc/ssl/cert
ssl_key_file = /etc/ssl/key
disable_plaintext_auth = no

log_path = /var/log/dovecot

## Login processes

login_processes_count = 2
login_max_processes_count = 128
login_max_logging_users = 256

# Greeting message for clients.
login_greeting = Dovecot ready.


## Mail processes

max_mail_processes = 1024
verbose_proctitle = yes
verbose_ssl = no
first_valid_uid = 500
last_valid_uid = 0
first_valid_gid = 0
last_valid_gid = 0
mail_extra_groups =
mail_debug = no
#default_mail_env =
#mail_save_crlf = no
#mmap_disable = no
#lock_method = fcntl
#maildir_stat_dirs = no
#maildir_copy_with_hardlinks = no
#mbox_read_locks = fcntl
#mbox_write_locks = dotlock fcntl
#mbox_lock_timeout = 300
#mbox_dotlock_change_timeout = 30
#mbox_dirty_syncs = yes
#mbox_very_dirty_syncs = no
#mbox_lazy_writes = yes
#umask = 0077
#mail_drop_priv_before_exec = no
#mail_process_size = 256
#mail_log_prefix = "%Us(%u): "


## IMAP specific settings

protocol imap {
  imap_max_line_length = 65536
  login_greeting_capability = no
  imap_client_workarounds = outlook-idle
  mail_use_modules = yes
  mail_modules = /usr/lib/dovecot/imap
}


## POP3 specific settings

protocol pop3 {
  pop3_no_flag_updates = no
  pop3_enable_last = yes
  pop3_uidl_format = %08Xu%08Xv
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  mail_use_modules = yes
  mail_modules = /usr/lib/dovecot/pop3
}


## Authentication processes
auth_verbose = no
auth_debug = no
auth_worker_max_count = 30

auth default {
  mechanisms = plain

  # SQL database - normal
  passdb sql {
    args = /etc/dovecot-sql.conf
  }

  # SQL database - normal
  userdb sql {
    args = /etc/dovecot-sql.conf
  }

  user = root
  count = 1
}


==================== /etc/dovecot-sql.conf ====================

driver = mysql
connect = host=/var/lib/mysql/mysql.sock dbname=(DB) user=(DBUSER)
password=(DBPWD)
default_pass_scheme = CRYPT

password_query = SELECT pwhash AS password, user FROM mail_mailboxes
WHERE  (user = '%n' AND active = 'Y' AND (type != 'smtp') AND (type =
'imap' OR '%s' = 'pop3')) OR (mainuser = '%n' AND user =
CONCAT('%n','mail0') AND (type != 'smtp') AND (type = 'imap' OR '%s' =
'pop3'))
user_query = SELECT location AS home, uid, gid, user AS system_user
FROM mail_mailboxes WHERE  (user = '%n') OR (mainuser = '%n' AND user
= CONCAT('%n','mail0'))


==================== table structure ====================

CREATE TABLE mail_mailboxes (
  mainuser varchar(128) NOT NULL default '',
  domain varchar(128) NOT NULL default '',
  user varchar(128) NOT NULL default '',
  addr varchar(128) NOT NULL default '',
  type set('pop3','imap','smtp') NOT NULL default 'pop3',
  active set('Y','N') NOT NULL default 'Y',
  pwhash varchar(255) NOT NULL default 'unset',
  quota int(11) NOT NULL default '0',
  location varchar(255) NOT NULL default 'unset',
  uid int(11) NOT NULL default '0',
  gid int(11) NOT NULL default '0',
  PRIMARY KEY  (user)
) TYPE=MyISAM;


More information about the dovecot mailing list