[Dovecot] Problem with running two dovecot instances on the same server
Hello All,
Have anyone met the problem I am struggling with at the moment ? The problem is when I run two instances of dovecot 2.1.8 which are one for proxy-director and another one is a regular one on the same server then I have big amount of strange entries in the /var/log/mail.err:
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Jul 26 11:52:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:52:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:52:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs
That's for sure set->director_mail_servers variable in main_preinit of ./src/director/main.c But after dumping it it turns out that ppid of the process which failed to use main_preinit function is a "regular" dovecot not the proxy one. When main_preinit is used by dovecot-proxy then set->director_mail_servers = ip address of a mail server and it is all good but if main_preinit is used by dovecot then set->director_mail_servers = empty and I get fatal errors in logs.
So here is a question: How come that "non-proxy" dovecot requests director_mail_servers variable and writes fatal error in the logs if it doesn't find it ?
Thank you very much for any assistance!
Please find my configs:
DOVECOT:
root@dovecot-test-1:~/software/dovecot/dovecot-2.1.8# /usr/local/dovecot/sbin/dovecot -n # 2.1.8: /usr/local/dovecot/etc/dovecot/dovecot.conf # OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.5 auth_mechanisms = plain digest-md5 cram-md5 apop auth_verbose = yes base_dir = /var/run/dovecot/ default_internal_user = webmail disable_plaintext_auth = no doveadm_password = secret listen = 192.168.0.42 mail_fsync = always mail_location = maildir:~/ mail_nfs_index = yes mail_nfs_storage = yes mail_plugins = " quota fts fts_solr" mmap_disable = yes passdb { args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext driver = ldap } plugin { fts = solr fts_solr = break-imap-search url=http://localhost:8080/solr/ quota = maildir:User quota } service doveadm { inet_listener { port = 8282 } } service imap-login { inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } } service imap { executable = imap } service lmtp { inet_listener lmtp { port = 24 } } service pop3-login { inet_listener pop3 { port = 110 } inet_listener pop3s { port = 995 ssl = yes } } service pop3 { executable = pop3 } ssl_cert = </usr/local/dovecot/ssl/dovecot.pem ssl_key = </usr/local/dovecot/ssl/dovecot.pem userdb { args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext driver = ldap } protocol imap { mail_plugins = " quota fts fts_solr imap_quota" }
DOVECOT-PROXY:
root@dovecot-test-1:~/software/dovecot/dovecot-2.1.8# /usr/local/dovecot/sbin/dovecot -c /usr/local/dovecot/etc/dovecot/dovecot-proxy.conf -n # 2.1.8: /usr/local/dovecot/etc/dovecot/dovecot-proxy.conf # OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.5 auth_verbose = yes base_dir = /var/run/dovecot-proxy default_internal_user = webmail director_mail_servers = 192.168.0.42 director_servers = 192.168.0.41 disable_plaintext_auth = no doveadm_password = secret doveadm_proxy_port = 8282 instance_name = dovecot-proxy listen = 192.168.0.41 login_greeting = Dovecot Proxy ready. mail_location = maildir:~/ passdb { args = proxy=y nopassword=y driver = static } service auth-worker { user = webmail } service auth { client_limit = 2400 } service director { fifo_listener login/proxy-notify { mode = 0666 } inet_listener { port = 8181 } unix_listener director-userdb { mode = 0600 } unix_listener login/director { mode = 0666 } } service doveadm { inet_listener { port = 8282 } } service imap-login { executable = imap-login director inet_listener imap { port = 143 } inet_listener imaps { port = 993 ssl = yes } } service imap { service_count = 0 } service lmtp { inet_listener lmtp { port = 24 } } service pop3-login { executable = pop3-login director inet_listener pop3 { port = 110 } inet_listener pop3s { port = 995 ssl = yes } } service pop3 { service_count = 0 } ssl_cert = </usr/local/dovecot/ssl/dovecot.pem ssl_key = </usr/local/dovecot/ssl/dovecot.pem userdb { args = /usr/local/dovecot/etc/dovecot/dovecot-ldap.conf.ext driver = ldap } protocol imap { mail_max_userip_connections = 100 }
protocol doveadm { auth_socket_path = director-userdb }
--
Regards, Alexandr Sabitov
Alexandr Sabitov wrote:
The problem is when I run two instances of dovecot 2.1.8 which are one for proxy-director and another one is a regular one on the same server then I have big amount of strange entries in the /var/log/mail.err:
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Jul 26 11:52:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:52:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:52:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs
Does behaviour change when you are using more than a single IP address on director_mail_servers variable?
Can you elaborate a bit more how the IP addresses are used and on which hosts which IP is UP and running on which interface?
That's for sure set->director_mail_servers variable in main_preinit of ./src/director/main.c But after dumping it it turns out that ppid of the process which failed to use main_preinit function is a "regular" dovecot not the proxy one. When main_preinit is used by dovecot-proxy then set->director_mail_servers = ip address of a mail server and it is all good but if main_preinit is used by dovecot then set->director_mail_servers = empty and I get fatal errors in logs.
So here is a question: How come that "non-proxy" dovecot requests director_mail_servers variable and writes fatal error in the logs if it doesn't find it ?
Maybe your director is not using the dovecot-proxy.conf? Maybe a conflict between the sockets of the two instances?
Please show the output of the following commands:
# ps -ef|grep bin/dovecot|grep -v grep # doveadm instance list
Regards Daniel
On 27/07/12 10:00, Daniel Parthey wrote:
Alexandr Sabitov wrote:
The problem is when I run two instances of dovecot 2.1.8 which are one for proxy-director and another one is a regular one on the same server then I have big amount of strange entries in the /var/log/mail.err:
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Jul 26 11:52:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:52:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:52:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Does behaviour change when you are using more than a single IP address on director_mail_servers variable?
Can you elaborate a bit more how the IP addresses are used and on which hosts which IP is UP and running on which interface?
That's for sure set->director_mail_servers variable in main_preinit of ./src/director/main.c But after dumping it it turns out that ppid of the process which failed to use main_preinit function is a "regular" dovecot not the proxy one. When main_preinit is used by dovecot-proxy then set->director_mail_servers = ip address of a mail server and it is all good but if main_preinit is used by dovecot then set->director_mail_servers = empty and I get fatal errors in logs.
So here is a question: How come that "non-proxy" dovecot requests director_mail_servers variable and writes fatal error in the logs if it doesn't find it ? Maybe your director is not using the dovecot-proxy.conf? Maybe a conflict between the sockets of the two instances?
Please show the output of the following commands:
# ps -ef|grep bin/dovecot|grep -v grep # doveadm instance list
Regards Daniel Hi Daniel and All,
Sure, here is an output of the commands:
root@dovecot-test-1:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep root 8214 1 0 Jul26 ? 00:00:04 /usr/local/dovecot/sbin/dovecot -c /usr/local/dovecot/etc/dovecot/dovecot-proxy.conf root 8224 1 0 Jul26 ? 00:00:07 /usr/local/dovecot/sbin/dovecot
root@dovecot-test-1:/home/asabitov# /usr/local/dovecot/bin/doveadm instance list path name last used running /var/run/dovecot dovecot 2012-07-26 23:29:41 yes /var/run/dovecot-proxy dovecot-proxy 2012-07-26 23:20:00 yes
And the situation changes for the better when I use two separate binaries installed in different folders, so for example this is another server where I do NOT have those fatal errors in the logs:
root@dovecot-test-2:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep root 31859 1 0 Jul25 ? 00:00:10 /usr/local/dovecot/sbin/dovecot root 31871 1 0 Jul25 ? 00:00:03 /usr/local/dovecot-proxy/sbin/dovecot
Thank you for your reply anyway.
--
Regards, Alexandr Sabitov Systems Administrator Netregistry
On 27/07/12 10:00, Daniel Parthey wrote:
Alexandr Sabitov wrote:
The problem is when I run two instances of dovecot 2.1.8 which are one for proxy-director and another one is a regular one on the same server then I have big amount of strange entries in the /var/log/mail.err:
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Jul 26 11:52:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:52:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:52:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Does behaviour change when you are using more than a single IP address on director_mail_servers variable?
Can you elaborate a bit more how the IP addresses are used and on which hosts which IP is UP and running on which interface?
That's for sure set->director_mail_servers variable in main_preinit of ./src/director/main.c But after dumping it it turns out that ppid of the process which failed to use main_preinit function is a "regular" dovecot not the proxy one. When main_preinit is used by dovecot-proxy then set->director_mail_servers = ip address of a mail server and it is all good but if main_preinit is used by dovecot then set->director_mail_servers = empty and I get fatal errors in logs.
So here is a question: How come that "non-proxy" dovecot requests director_mail_servers variable and writes fatal error in the logs if it doesn't find it ? Maybe your director is not using the dovecot-proxy.conf? Maybe a conflict between the sockets of the two instances?
Please show the output of the following commands:
# ps -ef|grep bin/dovecot|grep -v grep # doveadm instance list
Regards Daniel Hi Daniel and All,
Sure, here is an output of the commands:
root@dovecot-test-1:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep root 8214 1 0 Jul26 ? 00:00:04 /usr/local/dovecot/sbin/dovecot -c /usr/local/dovecot/etc/dovecot/dovecot-proxy.conf root 8224 1 0 Jul26 ? 00:00:07 /usr/local/dovecot/sbin/dovecot
root@dovecot-test-1:/home/asabitov# /usr/local/dovecot/bin/doveadm instance list path name last used running /var/run/dovecot dovecot 2012-07-26 23:29:41 yes /var/run/dovecot-proxy dovecot-proxy 2012-07-26 23:20:00 yes
And the situation changes for the better when I use two separate binaries installed in different folders, so for example this is another server where I do NOT have those fatal errors in the logs:
root@dovecot-test-2:/home/asabitov# ps -ef|grep bin/dovecot |grep -v grep root 31859 1 0 Jul25 ? 00:00:10 /usr/local/dovecot/sbin/dovecot root 31871 1 0 Jul25 ? 00:00:03 /usr/local/dovecot-proxy/sbin/dovecot
Thank you for your reply anyway.
--
Regards, Alexandr Sabitov Systems Administrator Netregistry
On 26.7.2012, at 5.27, Alexandr Sabitov wrote:
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs
Director process gets started for the backend installation where it of course isn't configured. My guess: doveadm (from some cronjob?) is attempting to connect to /var/run/dovecot/director-admin instead of /var/run/dovecot-proxy/director-admin.
On 29/07/12 02:49, Timo Sirainen wrote:
On 26.7.2012, at 5.27, Alexandr Sabitov wrote:
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Director process gets started for the backend installation where it of course isn't configured. My guess: doveadm (from some cronjob?) is attempting to connect to /var/run/dovecot/director-admin instead of /var/run/dovecot-proxy/director-admin.
Hi Timo,
Thanks for reply.
That's right: strace shows that director process is a child of non-proxy dovecot (pid 7089) which is should not be happening. And I don't have any cronjob running.
Might we need just update dovecot wiki that if someone runs dovecot and dovecot-proxy then they have to be installed in different folders as separate binaries otherwise one instance cross over another somehow magically. :)
7089 epoll_wait(51, {}, 56, 25070) = 0 7089 epoll_ctl(51, EPOLL_CTL_ADD, 38, {EPOLLIN|EPOLLPRI|EPOLLERR|EPOLLHUP, {u32=15790944, u64=15790944}}) = 0 7089 epoll_wait(51, {{EPOLLIN, {u32=15790944, u64=15790944}}}, 56, 43627051) = 1 7089 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f56462d19d0) = 7169 7089 epoll_ctl(51, EPOLL_CTL_DEL, 38, {0, {u32=15790944, u64=15790944}}) = 0 7089 epoll_wait(51, <unfinished ...> 7169 dup2(83, 2) = 2 7169 close(6) = 0 7169 dup2(38, 7) = 7 7169 dup2(10, 3) = 3 7169 dup2(129, 5) = 5 7169 dup2(95, 6) = 6 7169 setrlimit(RLIMIT_DATA, {rlim_cur=262144*1024, rlim_max=262144*1024}) = 0 7169 setrlimit(RLIMIT_AS, {rlim_cur=262144*1024, rlim_max=262144*1024}) = 0 7169 execve("/usr/local/dovecot/libexec/dovecot/director", ["dovecot/director"], [/* 15 vars */]) = 0 7169 brk(0) = 0xff6000 7169 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
root@dovecot-test-1:/home/asabitov# lsof /var/run/dovecot/director-admin COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dovecot 7089 root 38u unix 0xffff88007e8e1200 0t0 48243 /var/run/dovecot/director-admin root@dovecot-test-1:/home/asabitov# lsof /var/run/dovecot-proxy/director-admin COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dovecot 7102 root 39u unix 0xffff88007e9da300 0t0 48469 /var/run/dovecot-proxy/director-admin director 7178 webmail 8u unix 0xffff88007e9da300 0t0 48469 /var/run/dovecot-proxy/director-admin
#ps auxf root 7089 0.0 0.0 17332 1092 ? Ss Jul27 0:02 /usr/local/dovecot/sbin/dovecot webmail 7091 0.0 0.0 12808 1100 ? S Jul27 0:00 \_ dovecot/anvil root 7092 0.0 0.0 13056 1324 ? S Jul27 0:01 \_ dovecot/log root 3572 0.0 0.1 14256 2220 ? S Jul29 0:01 \_ dovecot/config webmail 16207 0.0 0.2 71684 4252 ? S 09:11 0:00 \_ dovecot/imap root 7102 0.0 0.0 17204 1072 ? Ss Jul27 0:01 /usr/local/dovecot/sbin/dovecot -c /usr/local/dovecot/etc/dovecot/dovecot-proxy.conf webmail 7104 0.0 0.0 12808 1084 ? S Jul27 0:00 \_ dovecot-proxy/anvil root 7105 0.0 0.0 12936 1244 ? S Jul27 0:00 \_ dovecot-proxy/log webmail 7178 0.0 0.0 12964 1328 ? S Jul27 0:00 \_ dovecot-proxy/director dovenull 16202 0.0 0.1 23500 2916 ? S 09:11 0:00 \_ dovecot-proxy/imap-login director root 16203 0.0 0.1 14604 2544 ? S 09:11 0:00 \_ dovecot-proxy/config webmail 16208 0.0 0.0 12804 1028 ? S 09:11 0:00 \_ dovecot-proxy/ipc root 7108 0.0 0.3 48240 6412 ? Ss Jul27 0:01 perl /usr/local/dovecot/bin/poolmon
--
Regards, Alexandr Sabitov Systems Administrator Netregistry
On 30.7.2012, at 10.24, Alexandr Sabitov wrote:
Jul 26 11:51:20 dovecot-test-1 dovecot: director: Error: Empty server list Jul 26 11:51:20 dovecot-test-1 dovecot: director: Fatal: Invalid value for director_mail_servers setting Jul 26 11:51:20 dovecot-test-1 dovecot: master: Error: service(director): command startup failed, throttling for 60 secs Director process gets started for the backend installation where it of course isn't configured. My guess: doveadm (from some cronjob?) is attempting to connect to /var/run/dovecot/director-admin instead of /var/run/dovecot-proxy/director-admin.
Hi Timo,
Thanks for reply.
That's right: strace shows that director process is a child of non-proxy dovecot (pid 7089) which is should not be happening. And I don't have any cronjob running.
Might we need just update dovecot wiki that if someone runs dovecot and dovecot-proxy then they have to be installed in different folders as separate binaries otherwise one instance cross over another somehow magically. :)
I have several such setups and they don't have this problem, so you've managed to create something that tries to connect there. One easy way to make sure this never happens is to just disable the socket:
service director { unix_listener director-admin { mode = 0 } }
participants (3)
-
Alexandr Sabitov
-
Daniel Parthey
-
Timo Sirainen