ejabberd - Comments for "LDAP authentication and contact list persistence" https://www.ejabberd.im/node/4590 en Problem Solved! The problem https://www.ejabberd.im/node/4590#comment-57204 <p>Problem Solved!</p> <p>The problem was/is that ejabberd establishes a long-lived TCP connection to the LDAP server. However, the firewall was configured with a TCP idle timeout of 1 hour. This repeatedly leaded to the situaton that a user tried to authenticate through ejabberd with LDAP over an already-dropped TCP connection.</p> <p>The LDAP server was/is configured for TCP keep-alives. But the default for TCP keep-alive (on most operating systems) is 2 hours.</p> <p>The workaround now either is to disable TCP SYN checking on the firewall (not preferred) or to set the TCP timeout on the firewall to more than 2 hours (this is what I did).</p> Thu, 31 Mar 2011 19:19:03 +0000 marc234 comment 57204 at https://www.ejabberd.im LDAP authentication still there https://www.ejabberd.im/node/4590#comment-57176 <p>I found out the following:</p> <p>The first user authentication in the morning times out. While the first has to wait a few dozen minutes, the second and all other users can quickly authenticate. Is there a problem with the LDAP connection which is established over a long time?</p> <p>My LDAP config:<br /> {auth_method, ldap}.<br /> {ldap_servers, ["SERVER"]}.<br /> {ldap_encrypt, tls}.<br /> {ldap_port, 1636}.<br /> {ldap_rootdn, "ROOTDN"}.<br /> {ldap_password, "PASSWORD"}.<br /> {ldap_base, "BASE"}.<br /> {ldap_uids, [{"uid", "%u@%d"}]}.</p> <p>The c2s config:<br /> {5222, ejabberd_c2s, [<br /> {certfile, "CERTFILE"}, starttls_required,<br /> {access, c2s},<br /> {shaper, c2s_shaper},<br /> {max_stanza_size, 65536}<br /> ]},</p> <p>The ejabberd.log emits:<br /> =INFO REPORT==== 2011-03-23 07:28:10 ===<br /> I(&lt;0.377.0&gt;:ejabberd_listener:281) : (#Port&lt;0.4063&gt;) Accepted connection {{IP,49160} -&gt; {{IP},5222}</p> <p>=INFO REPORT==== 2011-03-23 07:29:50 ===<br /> I(&lt;0.935.0&gt;:ejabberd_c2s:649) : ({socket_state,tls,{tlssock,#Port&lt;0.4063&gt;,#Port&lt;0.4065&gt;},&lt;0.934.0&gt;}) Failed authentication for FIRSTUSER</p> <p>=WARNING REPORT==== 2011-03-23 07:33:52 ===<br /> W(&lt;0.220.0&gt;:eldap:589) : LDAP server closed the connection: SERVER:1636<br /> In State: active</p> <p>=INFO REPORT==== 2011-03-23 07:33:53 ===<br /> I(&lt;0.220.0&gt;:eldap:967) : LDAP connection on SERVER:1636</p> <p>=INFO REPORT==== 2011-03-23 07:35:33 ===<br /> I(&lt;0.946.0&gt;:ejabberd_c2s:649) : ({socket_state,tls,{tlssock,#Port&lt;0.4075&gt;,#Port&lt;0.4077&gt;},&lt;0.945.0&gt;}) Failed authentication for FIRSTUSER</p> <p>=WARNING REPORT==== 2011-03-23 07:39:34 ===<br /> W(&lt;0.229.0&gt;:eldap:589) : LDAP server closed the connection: SERVER:1636<br /> In State: active_bind</p> <p>=INFO REPORT==== 2011-03-23 07:39:35 ===<br /> I(&lt;0.229.0&gt;:eldap:967) : LDAP connection on SERVER:1636</p> <p>=INFO REPORT==== 2011-03-23 07:44:57 ===<br /> I(&lt;0.377.0&gt;:ejabberd_listener:281) : (#Port&lt;0.4083&gt;) Accepted connection {{IP},52500} -&gt; {{IP},5222}</p> <p>=INFO REPORT==== 2011-03-23 07:44:58 ===<br /> I(&lt;0.968.0&gt;:ejabberd_c2s:631) : ({socket_state,tls,{tlssock,#Port&lt;0.4083&gt;,#Port&lt;0.4085&gt;},&lt;0.967.0&gt;}) Accepted authentication for SECONDUSER by ejabberd_auth_ldap</p> <p>=INFO REPORT==== 2011-03-23 07:44:58 ===<br /> I(&lt;0.968.0&gt;:ejabberd_c2s:890) : ({socket_state,tls,{tlssock,#Port&lt;0.4083&gt;,#Port&lt;0.4085&gt;},&lt;0.967.0&gt;}) Opened session for SECONDUSER</p> <p>=INFO REPORT==== 2011-03-23 08:22:07 ===<br /> I(&lt;0.377.0&gt;:ejabberd_listener:281) : (#Port&lt;0.4106&gt;) Accepted connection {{IP},50436} -&gt; {{IP},5222}</p> <p>=INFO REPORT==== 2011-03-23 08:22:07 ===<br /> I(&lt;0.1029.0&gt;:ejabberd_c2s:631) : ({socket_state,tls,{tlssock,#Port&lt;0.4106&gt;,#Port&lt;0.4108&gt;},&lt;0.1028.0&gt;}) Accepted authentication for FIRSTUSER by ejabberd_auth_ldap</p> <p>=INFO REPORT==== 2011-03-23 08:22:07 ===<br /> I(&lt;0.1029.0&gt;:ejabberd_c2s:890) : ({socket_state,tls,{tlssock,#Port&lt;0.4106&gt;,#Port&lt;0.4108&gt;},&lt;0.1028.0&gt;}) Opened session for FIRSTUSER</p> <p>What can I do to work around this tedious initial timeout?</p> Wed, 23 Mar 2011 07:50:09 +0000 marc234 comment 57176 at https://www.ejabberd.im The contact list problem is https://www.ejabberd.im/node/4590#comment-57152 <p>The contact list problem is solved. Sorry. I mistakenly deleted mod_roster from the config.</p> <p>But the LDAP problem is still there. 90% of the time, it works, but then it fails for about 10 minutes (but only for the user which first experienced the problem).</p> Fri, 18 Mar 2011 10:46:15 +0000 marc234 comment 57152 at https://www.ejabberd.im