Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-21645

Daily report stops functioning when user is removed directly from LDAP server

XMLWordPrintable

      Steps to reproduce issue
      1. Integrate Confluence with LDAP
      2. Ensure a local user and an LDAP user have Subscribed to daily updates
      3. Stop Confluence server
      4. Remove the LDAP user straight in LDAP server
      5. Start Confluence
      6. The daily report will fail with the following error:
        2011-01-17 18:38:56,873 ERROR [DefaultQuartzScheduler_Worker-7] [org.quartz.core.ErrorLogger] schedulerError Job (DEFAULT.DailyReportJob threw an exception.
        org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.atlassian.core.exception.InfrastructureException: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER): Turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition.]
                at org.quartz.core.JobRunShell.run(JobRunShell.java:210)
                at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
        Caused by: com.atlassian.core.exception.InfrastructureException: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER): Turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition.
                at com.atlassian.hibernate.HibernateObjectDao.remove(HibernateObjectDao.java:166)
                at com.atlassian.confluence.mail.notification.DefaultNotificationManager.removeNotification(DefaultNotificationManager.java:118)
                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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
                at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
                at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
                at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
                at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
                at $Proxy26.removeNotification(Unknown Source)
                at com.atlassian.confluence.mail.ChangeDigestNotificationBean.getAllChangeReports(ChangeDigestNotificationBean.java:176)
                at com.atlassian.confluence.mail.jobs.DefaultDailyReportManager.generateDailyReports(DefaultDailyReportManager.java:51)
                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)
        ..
        ..
        ..
        Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER): Turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition.
                at org.springframework.orm.hibernate.HibernateTemplate.checkWriteOperationAllowed(HibernateTemplate.java:1000)
                at org.springframework.orm.hibernate.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:650)
                at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370)
                at org.springframework.orm.hibernate.HibernateTemplate.delete(HibernateTemplate.java:648)
                at org.springframework.orm.hibernate.HibernateTemplate.delete(HibernateTemplate.java:644)
                at com.atlassian.hibernate.HibernateObjectDao.remove(HibernateObjectDao.java:160)
                ... 38 more
        ~                       
        
      Findings

      In Confluence 2.10.3 and 3.3.1, this does not take place because of the following:

      2011-01-17 18:19:16,804 WARN [DefaultQuartzScheduler_Worker-6] [atlassian.confluence.mail.ChangeDigestNotificationBean] getAllChangeReports User Test not found for notification com.atlassian.confluence.mail.notification.Notification@110002 (removing notification)
      

      Workaround for 3.4.x

      1. Unzip CONF-21645-fix.zip into WEB-INF
      2. Make sure the following exists in your Confluence installation directory
        • confluence-install/confluence/WEB-INF/classes/com/atlassian/confluence/mail/ChangeDigestNotificationBean.class
      3. Restart Confluence

        1. CONF-21645-do-not-delete-notification.patch
          0.9 kB
          Don Willis
        2. CONF-21645-fix.zip
          4 kB
          Don Willis

              don.willis@atlassian.com Don Willis
              sjayaraman Sashidaran Jayaraman [Atlassian]
              Votes:
              7 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: