Error : There are no maps defined for user username. Are the map services running?

Ever wondered why you get the below error sporadically on loading Dekho..

Error

Usually, refreshing the page once or twice makes the problem go away. But what causes this? Let me explain.

If you happen to look in the Dekho.log file, you will notice an error similar to –

ERROR au.com.esriau.dekho.auth.LdapAuthoriser – Exception while retrieving roles for user
org.springframework.ldap.ServiceUnavailableException: <LDAP Domain Name>:389; socket closed; nested exception is javax.naming.ServiceUnavailableException: <LDAP Domain Name>:389; socket closed; remaining name ‘/’

Research suggested that sometimes there can be issues with specific applications and LDAP. Here the issue seems to be how Tomcat and LDAP communicate.  

This error only seems to arrive if there has been no traffic (i.e. login attempts to the LDAP Server) for some time. And is very difficult to trouble shoot as once it’s happened it won’t occur again for hours, maybe even a full day.

Further investigation showed that adding the below mentioned Tomcat Java parameters solves the issue.

-Dcom.sun.jndi.ldap.connect.pool.maxsize
-Dcom.sun.jndi.ldap.connect.pool.prefsize
-Dcom.sun.jndi.ldap.connect.pool.timeout

Here is an example that sets the maximum pool size to 20, the preferred pool size to 10, and the idle timeout to 5 minutes for pooled connections.
-Dcom.sun.jndi.ldap.connect.pool.maxsize=20
-Dcom.sun.jndi.ldap.connect.pool.prefsize=10
-Dcom.sun.jndi.ldap.connect.pool.timeout=300000

Example

Please note that this is just an example, and might require different values for different environments.

References-

http://forum.spring.io/forum/spring-projects/data/ldap/96508-ldap-authentication-intermittent-socket-closed-error

http://docs.oracle.com/javase/jndi/tutorial/ldap/connect/config.html

http://www-01.ibm.com/support/docview.wss?uid=swg21358588

https://issues.jenkins-ci.org/browse/JENKINS-2489

http://www-01.ibm.com/support/docview.wss?uid=swg21215841

This entry was posted in Other. Bookmark the permalink.

One Response to "Error : There are no maps defined for user username. Are the map services running?"

  • Meenal C

Leave a Reply

Your email address will not be published. Required fields are marked *


*