Details
-
Bug
-
Status: Closed
-
Resolution: Fixed
-
7.0.X, 7.1.X, 7.2.X, Master
-
7.2.x, 7.1.x, 7.0.x
-
Committed
-
3
-
Iteration 32
Description
Reproducing Steps
- Startup Liferay
- Go to Control Panel > Configuration > Instance Settings > LDAP > Import (or ... > Instance Settings > Configuration > Authentication > LDAP)
- Enable LDAP (but do not actually configure one to ensure the problem is readily visible)
- Make sure to enable "Import" but not "Enable Import on Startup"
- Notice that the default import interval is 10 minutes
- Save
- Restart Liferay
Expected: There are no warning or errors in the logs since user import wasn't triggered.
Observed: User import was triggered and the following warning is displayed at startup
2020-02-20 09:28:00.579 WARN [liferay/scheduled_user_ldap_import-1][DefaultPortalLDAP:184] Unable to bind to the LDAP server javax.naming.CommunicationException: localhost:10389 [Root exception is java.net.ConnectException: Connection refused (Connection refused)] at com.sun.jndi.ldap.Connection.<init>(Connection.java:226) at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:137) at com.sun.jndi.ldap.LdapClientFactory.createPooledConnection(LdapClientFactory.java:64) at com.sun.jndi.ldap.pool.Connections.<init>(Connections.java:114) at com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:136) at com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:340) at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1601) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2749) at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:319) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210) at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153) at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313) at javax.naming.InitialContext.init(InitialContext.java:244) at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154) at com.liferay.portal.security.ldap.internal.DefaultPortalLDAP.getContext(DefaultPortalLDAP.java:180) at com.liferay.portal.security.ldap.internal.DefaultPortalLDAP.getContext(DefaultPortalLDAP.java:126) at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importUsers(LDAPUserImporterImpl.java:433) at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importUsers(LDAPUserImporterImpl.java:417) at com.liferay.portal.security.ldap.internal.configuration.persistence.listener.UserImportMessageListener.doReceive(UserImportMessageListener.java:135) at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26) at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper._processMessage(SchedulerEventMessageListenerWrapper.java:127) at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:98) at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74) at com.liferay.portal.messaging.internal.SerialDestination$1.run(SerialDestination.java:62) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752) at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664) at java.lang.Thread.run(Thread.java:748) Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sun.jndi.ldap.Connection.createSocket(Connection.java:360) at com.sun.jndi.ldap.Connection.<init>(Connection.java:213) ... 29 more
Note:
- The trace is shown because the LDAP connection is not properly configure so it let us see that the import task has been triggered. If we had actually configured the LDAP connection, we wouldn't notice that the task triggered ahead of time.
- The observed behavior may not happen every single time, so more than one try may be needed.
- The observed behavior is not the expected one because we haven't checked "Enable Import on Startup".