Jim Lawson
2011-Oct-04 17:31 UTC
[Dovecot] trouble setting up director, "invalid argument" for connect() call
Hi Timo & everyone, I'm trying out a 2-node director setup, but I keep getting the following error: Oct 3 16:11:29 imapdir1 dovecot: master: Dovecot v2.0.15 starting up (core dumps disabled) Oct 3 16:11:34 imapdir1 dovecot: director: Error: connect(132.198.100.150:9090) failed: Invalid argument Oct 3 16:11:41 imapdir1 last message repeated 3 times Both nodes report this error. The director on each node is listening on port 9090 just fine:> [root at imapdir1 ~]# nc imapdir2 9090 > VERSION director 1 0 > ME 127.0.0.1 9090> [root at imapdir2 ~]# nc imapdir1 9090 > VERSION director 1 0 > ME 127.0.0.1 9090"doveadm director ring status" always reports failure of the peer:> [root at imapdir1 ~]# doveadm director ring status > director ip port type last > failed > 127.0.0.1 9090 self > never > 132.198.100.150 9090 2011-10-04 > 13:28:55> [root at imapdir2 ~]# doveadm director ring status > director ip port type last > failed > 127.0.0.1 9090 self > never > 132.198.100.149 9090 2011-10-04 > 13:24:08Has anyone else seen this? FWIW, a single-node director works fine, proxying IMAP, LMTP and POP. I'm guessing I have a broken config, but if I do I can't figure it out. Hope I'm not missing something *too* obvious... Here's doveconf -n from imapdir1: # 2.0.15: /etc/dovecot/dovecot.conf # OS: Linux 2.6.18-274.3.1.el5 x86_64 Red Hat Enterprise Linux Server release 5.7 (Tikanga) base_dir = /var/run/dovecot/ director_mail_servers = penguina.uvm.edu penguinb.uvm.edu penguinc.uvm.edu director_servers = imapdir1.uvm.edu imapdir2.uvm.edu lmtp_proxy = yes login_trusted_networks 132.198.101.211,132.198.101.212,132.198.101.213,132.198.101.214,132.198.101.215,132.198.101.216,132.198.100.45,132.198.100.46,132.198.100.47 passdb { args = proxy=y nopassword=y protocol=smtp driver = static } service auth { unix_listener auth-userdb { group = mail mode = 0660 user = dovecot } } service director { fifo_listener login/proxy-notify { mode = 0666 } inet_listener { port = 9090 } unix_listener director-userdb { mode = 0600 } unix_listener login/director { mode = 0666 } } service imap-login { executable = imap-login director } service lmtp { client_limit = 1 inet_listener lmtp { port = 24 } unix_listener /var/lib/dovecot/lmtp-socket { group = root mode = 0600 user = root } } Best, Jim
Jim Lawson
2011-Oct-05 20:31 UTC
[Dovecot] trouble setting up director, "invalid argument" for connect() call [SOLVED]
On 10/4/11 13:31 , Jim Lawson wrote:> Hi Timo & everyone, > > I'm trying out a 2-node director setup, but I keep getting the following > error: > > Oct 3 16:11:29 imapdir1 dovecot: master: Dovecot v2.0.15 starting up > (core dumps disabled) > Oct 3 16:11:34 imapdir1 dovecot: director: Error: > connect(132.198.100.150:9090) failed: Invalid argument > Oct 3 16:11:41 imapdir1 last message repeated 3 timesI was specifying DNS names in director_servers (imapdir1.uvm.edu, imapdir2.uvm.edu). /etc/hosts listed 127.0.0.1 as the address for the local host name (in addition to "localhost"). This can happen on some RHEL installs that begin their life as DHCP clients. So when the director tried to figure out its self_ip, it always picked 127.0.0.1. Calling connect() using a localhost socket with a non-local address as destination just doesn't work so well, I guess. Seeing 127.0.0.1 as "self" in "doveadm director ring status" should have been a clue, but I hadn't seen the output before to have anything to compare it to. 2 easy fixes: specify real IP addresses in the director_servers config, or don't list 127.0.0.1 as your local hostname in /etc/hosts. Jim