Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-64325

Jira fails to start due to duplicate job IDs in the clusteredjob table

    • 7.01
    • 55
    • Severity 1 - Critical
    • 1,303
    • Hide
      Atlassian Update – 12 January 2018

      Hi everyone,

      All the Jira versions, which have the bug fixed, are now released.
      Wish you a smooth upgrade.

      Cheers,
      Ignat Alexeyenko
      Jira bugmaster.

      Show
      Atlassian Update – 12 January 2018 Hi everyone, All the Jira versions, which have the bug fixed, are now released. Wish you a smooth upgrade. Cheers, Ignat Alexeyenko Jira bugmaster.

      Summary

      Caesium method getJobDetails calls clusteredJobDao.find(jobId) and expects single uniq value from DB, while clusteredjob table does not ensure this.

      Steps to Reproduce

      1. Create duplicated records in table
      2. Restart JIRA

      Expected Results

      JIRA works fine

      Actual Results

      JIRA is failing to start with the following errors:

      2017-03-03 02:26:53,599 Structure-Jobs-1143be31 Queue-Thread#1 ERROR anonymous     [c.a.c.manager.application.ApplicationServiceGeneric] com.atlassian.cache.CacheException: java.lang.IllegalStateException: Too many rows found for query on ClusteredJob
          	row1: OfBizClusteredJob[id=81932,delegate=ImmutableClusteredJob[jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10001,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager,schedule=Schedule[type=INTERVAL,intervalScheduleInfo=IntervalScheduleInfo[firstRunTime=Fri Mar 03 01:56:51 PST 2017,intervalInMillis=3540000]],nextRunTime=Fri Mar 03 01:56:51 PST 2017,version=1,rawParameters=[ .. ]
      row2:
      	OfBizClusteredJob[id=82235,delegate=ImmutableClusteredJob[jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10001,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager,schedule=Schedule[type=INTERVAL,intervalScheduleInfo=IntervalScheduleInfo[firstRunTime=Fri Mar 03 01:56:51 PST 2017,intervalInMillis=3540000]],nextRunTime=Fri Mar 03 01:56:51 PST 2017,version=1,rawParameters=[ .. ]]
      com.atlassian.crowd.exception.DirectoryInstantiationException: com.atlassian.cache.CacheException: java.lang.IllegalStateException: Too many rows found for query on 
      	at com.atlassian.crowd.directory.loader.CacheableDirectoryInstanceLoader.getDirectory(CacheableDirectoryInstanceLoader.java:92)
      	at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.getDirectoryImplementation(DirectoryManagerGeneric.java:272)
      ....
      Caused by: com.atlassian.cache.CacheException: java.lang.IllegalStateException: Too many rows found for query on ClusteredJob
      	row1: OfBizClusteredJob[id=81932,delegate=ImmutableClusteredJob[jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10001,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager,schedule=Schedule[type=INTERVAL,intervalScheduleInfo=IntervalScheduleInfo[firstRunTime=Fri Mar 03 01:56:51 PST 2017,intervalInMillis=3540000]],nextRunTime=Fri Mar 03 01:56:51 PST 2017,version=1,rawParameters=
      row2:
      	OfBizClusteredJob[id=82235,delegate=ImmutableClusteredJob[jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10001,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager,schedule=Schedule[type=INTERVAL,intervalScheduleInfo=IntervalScheduleInfo[firstRunTime=Fri Mar 03 01:56:51 PST 2017,intervalInMillis=3540000]],nextRunTime=Fri Mar 03 01:56:51 PST 2017,version=1,rawParameters=
      	at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl$1.consume(SelectQueryImpl.java:198)
      	at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.forEach(SelectQueryImpl.java:231)
      	at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.consumeWith(SelectQueryImpl.java:214)
      	at com.atlassian.jira.entity.SelectQueryImpl$ExecutionContextImpl.singleValue(SelectQueryImpl.java:191)
      	at com.atlassian.jira.scheduler.OfBizClusteredJobDao.find(OfBizClusteredJobDao.java:88)
      	at com.atlassian.scheduler.caesium.impl.CaesiumSchedulerService.getJobDetails(CaesiumSchedulerService.java:230)
      	at com.atlassian.scheduler.core.DelegatingSchedulerService.getJobDetails(DelegatingSchedulerService.java:97)
      	at com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.hasPoller(JiraDirectoryPollerManager.java:64)
      	at com.atlassian.crowd.manager.directory.monitor.DirectoryMonitorManagerImpl.hasMonitor(DirectoryMonitorManagerImpl.java:108)
      	at com.atlassian.crowd.directory.loader.DbCachingRemoteDirectoryInstanceLoader.getDirectory(DbCachingRemoteDirectoryInstanceLoader.java:113)
      ...
      

      Notes

      Related Indexes for clusteredjob table:

      • "pk_clusteredjob" PRIMARY KEY, btree (id)
      • "clusteredjob_jobid_idx" btree (job_id)

      Workaround

          Form Name

            [JRASERVER-64325] Jira fails to start due to duplicate job IDs in the clusteredjob table

            Benito Picarelli made changes -
            Remote Link Original: This issue links to "RAID-722 (JIRA Server)" [ 330875 ] New: This issue links to "RAID-722 (JIRA Server (Bulldog))" [ 330875 ]
            Julien Rey made changes -
            Remote Link Original: This issue links to "Page (Confluence)" [ 415461 ]
            set-jac-bot made changes -
            set-jac-bot made changes -
            Summary Original: Duplicate job IDs in clusteredjob table prevents JIRA from starting New: Jira fails to start due to duplicate job IDs in the clusteredjob table
            Tomasz Bartyzel made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 391684 ]
            Tomasz Bartyzel made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 391125 ]
            Tomasz Bartyzel made changes -
            Remote Link Original: This issue links to "Page (Atlassian Documentation)" [ 391124 ]
            Bugfix Automation Bot made changes -
            Minimum Version New: 7.01
            Julien Rey made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 415461 ]
            Luciano Fagundes (Inactive) made changes -
            Affects Version/s New: 7.5.3 [ 75316 ]

              pczuj Przemyslaw Czuj
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Affected customers:
              67 This affects my team
              Watchers:
              84 Start watching this issue

                Created:
                Updated:
                Resolved: