Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-41746

LDAP import process fails in sharded data bases when the shard is not the default

    Details

      Description

      The automatic process that synchronizes/imports users from LDAP is broken when it process a company that isn't in the default shard.

      In a normal sharded data base with: shard.selector=com.liferay.portal.dao.shard.RoundRobinShardSelector , this causes that only the default company is synchronized correctly, because the synchronization process stops when it tries to process the second company due the next exception:

      15:57:01,573 ERROR [liferay/scheduler_dispatch-3][ParallelDestination:72] Unable to process message {destinationName=liferay/scheduler_dispatch, response=null, responseDestinationName=null, responseId=null, payload=null, values={JOB_NAME=com.liferay.portlet.admin.messaging.LDAPImportMessageListener, EXCEPTIONS_MAX_SIZE=0, GROUP_NAME=com.liferay.portlet.admin.messaging.LDAPImportMessageListener, DESTINATION_NAME=liferay/scheduler_dispatch, JOB_STATE=com.liferay.portal.kernel.scheduler.JobState@561d3e05, companyId=0, MESSAGE_LISTENER_CLASS_NAME=com.liferay.portlet.admin.messaging.LDAPImportMessageListener, RECEIVER_KEY=com.liferay.portlet.admin.messaging.LDAPImportMessageListener.com.liferay.portlet.admin.messaging.LDAPImportMessageListener, MESSAGE_LISTENER_UUID=1cae30d4-ef6d-4185-8bb6-f50467f57c2e}}
      com.liferay.portal.kernel.messaging.MessageListenerException: com.liferay.portal.NoSuchUserException: No User exists with the primary key 10705
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:32)
              at sun.reflect.GeneratedMethodAccessor374.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.kernel.bean.ClassLoaderBeanHandler.invoke(ClassLoaderBeanHandler.java:67)
              at $Proxy515.receive(Unknown Source)
              at com.liferay.portal.kernel.scheduler.messaging.SchedulerEventMessageListenerWrapper.receive(SchedulerEventMessageListenerWrapper.java:76)
              at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:72)
              at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:69)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
              at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: com.liferay.portal.NoSuchUserException: No User exists with the primary key 10705
              at com.liferay.portal.service.persistence.UserPersistenceImpl.findByPrimaryKey(UserPersistenceImpl.java:7199)
              at com.liferay.portal.service.persistence.UserPersistenceImpl.findByPrimaryKey(UserPersistenceImpl.java:7217)
              at sun.reflect.GeneratedMethodAccessor332.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
              at com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice.invoke(ShardPersistenceAdvice.java:101)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
              at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
              at $Proxy50.findByPrimaryKey(Unknown Source)
              at com.liferay.portal.service.impl.LockLocalServiceImpl.lock(LockLocalServiceImpl.java:155)
              at com.liferay.portal.service.impl.LockLocalServiceImpl.lock(LockLocalServiceImpl.java:128)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
              at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
              at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
              at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
              at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
              at $Proxy87.lock(Unknown Source)
              at com.liferay.portal.service.LockLocalServiceUtil.lock(LockLocalServiceUtil.java:344)
              at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:126)
              at com.liferay.portal.security.ldap.PortalLDAPImporterImpl.importFromLDAP(PortalLDAPImporterImpl.java:101)
              at com.liferay.portal.security.ldap.PortalLDAPImporterUtil.importFromLDAP(PortalLDAPImporterUtil.java:39)
              at com.liferay.portlet.admin.messaging.LDAPImportMessageListener.doReceive(LDAPImportMessageListener.java:51)
              at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
              ... 11 more
      

      Steps to reproduce:

      1. Configure a sharded environment (see attached portal-ext.properties to get an example)
      2. Start the Server, this create the default instance liferay.com.
      3. Create two more instances, from Control Panel> Portal Instances:
      3.1 Add liferaydev1.com (it will be created in the shard one)
      3.2 Add liferaydev2.com (it will be created in the shard two)
      4. Signed into liferay.com as SuperAdmin (test@liferay.com) and go to Control Panel> Portal Settings> Authentication:
      4.1 Enabled LDAP
      4.2 Import Enabled
      4.3 Import on Startup Enabled
      4.4 Add the configuration of your LDAP Server.
      5. Go to liferaydev1.com and sign into as SuperAdmin (test@liferaydev1.com) and enabled the LDAP synch process ( steps 4.1 - 4.4 )
      6. Go to liferaydev1.com and sign into as SuperAdmin (test@liferaydev2.com) and enabled the LDAP synch process ( steps 4.1 - 4.4 )
      7. Wait a few minutes until LDAP process will be launched (the process is launched each 10 minutes by default)

      Results: Checks as super admin users in liferay.com , liferaydev1.com, liferaydev2.com => the user only were created in liferay.com and in logs you can view the exception above.

      Expected: the users are imported in all the instances.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mark.jin Mark Jin (Inactive)
                Reporter:
                jose.jimenez Jose Jimenez
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 46 weeks, 6 days ago

                  Packages

                  Version Package
                  6.2.1 CE GA2
                  6.2.X EE
                  7.0.0 M1