[Dovecot] dict Panic after upgrade to 2.1.7

ckubu ckubu at so36.net
Sun Jun 24 13:21:15 EEST 2012


Hello,

after upgrade my mailsystem to dovecot version 2.1.7, dovecot doesn't work 
properly. something went wrong in dict service connecting the postgres 
backend. that happens not on every connection. the db connection data are 
correct, no difference connecting via tcp or linux socket. 

dovecot log entries:
Jun 23 23:19:10 mx dovecot: dict: Panic: file driver-pgsql.c: line 84 
(driver_pgsql_set_state): assertion failed: (state == SQL_DB_STATE_BUSY || db-
>cur_result == NULL)
Jun 23 23:19:10 mx dovecot: dict: Error: Raw backtrace: 
/usr/local/dovecot-2.1.7/lib/dovecot/libdovecot.so.0(+0x4478a) 
[0x7ffc7d8e578a] -> 
/usr/local/dovecot-2.1.7/lib/dovecot/libdovecot.so.0(+0x447d6) 
[0x7ffc7d8e57d6] -> 
/usr/local/dovecot-2.1.7/lib/dovecot/libdovecot.so.0(i_error+0) 
[0x7ffc7d8bc5ef] -> dovecot/dict() [0x40a9a6] -> dovecot/dict() [0x40aa01] -> 
dovecot/dict() [0x40be43] -> dovecot/dict() [0x409474] -> 
dovecot/dict(sql_db_cache_deinit+0x20) [0x4089d0] -> dovecot/dict(main+0x169) 
[0x4059f9] -> /lib/libc.so.6(__libc_start_main+0xfd) [0x7ffc7d335c8d] -> 
dovecot/dict() [0x404b59]
Jun 23 23:19:10 mx dovecot: dict: Fatal: master: service(dict): child 13812 
killed with signal 6 (core dumps disabled)

Jun 23 23:23:09 mx dovecot: dict: Error: dict sql iterate failed: Not 
connected to database
Jun 23 23:23:09 mx dovecot: pop3(xxx at yyy.zz): Error: acl: dict iteration 
failed, can't update dict
Jun 23 23:23:09 mx dovecot: dict: Error: dict sql iterate failed: Not 
connected to database
Jun 23 23:23:09 mx dovecot: pop3(xxx at yyy.zz): Error: acl: dict iteration 
failed, can't update dict
Jun 23 23:23:17 mx dovecot: dict: Error: dict sql lookup failed: Not connected 
to database
Jun 23 23:23:17 mx dovecot: imap(xxx at yyy.zz): Error: Internal quota 
calculation error
Jun 23 23:23:19 mx dovecot: dict: Error: dict sql lookup failed: Not connected 
to database
Jun 23 23:23:40 mx dovecot: dict: Error: dict sql lookup failed: Not connected 
to database

maybe i have missconfigured the dovecot system, but i don't find the mistake. 
can anybody give me a hint ?

best wiches
christoph

----- doveconf -n
# 2.1.7: /usr/local/dovecot-2.1.7/etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-5-vserver-amd64 x86_64 Debian 6.0.5 ext3
auth_mechanisms = plain login digest-md5 cram-md5 apop
auth_socket_path = /var/run/dovecot/auth-userdb
auth_username_translation = %@
auth_verbose = yes
auth_verbose_passwords = plain
base_dir = /var/run/dovecot/
dict {
  acl = pgsql:/usr/local/dovecot/etc/dovecot/sql-dict.conf.ext
  expire = pgsql:/usr/local/dovecot/etc/dovecot/sql-dict.conf.ext
  quota = pgsql:/usr/local/dovecot/etc/dovecot/sql-dict.conf.ext
}
disable_plaintext_auth = no
first_valid_gid = 5000
first_valid_uid = 5000
hostname = mx.warenform.de
last_valid_gid = 5000
last_valid_uid = 5000
listen = 178.63.63.151 2a01:4f8:121:c5::2
mail_gid = vmail
mail_location = maildir:/var/vmail/%d/%n/Maildir
mail_plugins = autocreate quota expire acl
mail_uid = vmail
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags 
copy include variables body enotify environment mailbox date ihave
namespace {
  list = children
  location = maildir:/var/vmail/%%d/%%n/Maildir:INDEX=~/Maildir/shared/%%u
  prefix = shared/%%u/
  separator = /
  subscriptions = no
  type = shared
}
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Spam {
    special_use = \Junk
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
  separator = /
  type = private
}
passdb {
  args = /usr/local/dovecot/etc/dovecot/sql-connect.conf.ext
  driver = sql
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  autocreate = Spam
  autocreate2 = Sent
  autocreate3 = Trash
  autocreate4 = Drafts
  autosubscribe = Spam
  autosubscribe2 = Sent
  autosubscribe3 = Trash
  autosubscribe4 = Drafts
  expire = Trash
  expire2 = Trash.*
  expire3 = Spam
  expire_dict = proxy::expire
  quota = dict:User quota::proxy::quota
  quota_rule = *:storage=1G
  quota_rule2 = Trash:storage=+200M
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
  recipient_delimiter = 
  sieve = ~/.dovecot.sieve
  sieve_before = /usr/local/dovecot/etc/dovecot/sieve/move-spam.sieve
  sieve_dir = ~/sieve
  sieve_global_dir = /usr/local/dovecot/etc/dovecot/sieve/global/
}
postmaster_address = admin at warenform.de
protocols = imap pop3 sieve lmtp
service auth {
  unix_listener /var/spool/postfix/private/dovecot-auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-userdb {
    group = vmail
    mode = 0600
    user = vmail
  }
}
service dict {
  unix_listener dict {
    mode = 0600
    user = vmail
  }
}
service imap-login {
  inet_listener imap {
    address = 127.0.0.1 178.63.63.151 2a01:4f8:121:c5::2
  }
  inet_listener imaps {
    address = 178.63.63.151 2a01:4f8:121:c5::2
  }
  process_min_avail = 16
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service managesieve-login {
  inet_listener sieve {
    address = 127.0.0.1
    port = 4190
  }
}
service pop3-login {
  inet_listener pop3 {
    address = 178.63.63.151 2a01:4f8:121:c5::2
  }
  inet_listener pop3s {
    address = 178.63.63.151 2a01:4f8:121:c5::2
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
    user = vmail
  }
  user = dovecot
}
shutdown_clients = no
ssl_cert = </etc/postfix/ssl/servercert.pem
ssl_key = </etc/postfix/ssl/servercert.pem
syslog_facility = local1
userdb {
  args = /usr/local/dovecot/etc/dovecot/sql-connect.conf.ext
  driver = sql
}
protocol lmtp {
  mail_plugins = autocreate quota expire acl sieve
}
protocol lda {
  mail_plugins = autocreate quota expire acl sieve
}
protocol imap {
  imap_client_workarounds = delay-newmail
  mail_max_userip_connections = 24
  mail_plugins = autocreate quota expire acl imap_quota imap_acl
  ssl_cert = </etc/postfix/ssl/imap_warenform_de.crt
  ssl_key = </etc/postfix/ssl/imap_warenform_de.key
}
protocol pop3 {
  mail_max_userip_connections = 10
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
  ssl_cert = </etc/postfix/ssl/pop_warenform_de.crt
  ssl_key = </etc/postfix/ssl/pop_warenform_de.key
}


----- sql-dict.conf.ext:

connect = host=/var/run/postgresql user=db_user password=db_passwd 
dbname=db_name

# quota
map {
  pattern = priv/quota/storage
  table = quota2
  username_field = username
  value_field = bytes
}
map {
  pattern = priv/quota/messages
  table = quota2
  username_field = username
  value_field = messages
}

# expires
map {
  pattern = shared/expire/$user/$mailbox
  table = expires
  value_field = expire_stamp

  fields {
    username = $user
    mailbox = $mailbox
  }
}

# acl
map {
  pattern = shared/shared-boxes/user/$to/$from
  table = user_shares
  value_field = dummy

  fields {
    from_user = $from
    to_user = $to
  }
}

map {
  pattern = shared/shared-boxes/anyone/$from
  table = anyone_shares
  value_field = dummy

  fields {
    from_user = $from
  }
}



-- 
e: ckubu at so36.net



More information about the dovecot mailing list