Jira server fails to start with Too many rows found for query on ClusteredJob error
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Symptoms
JIRA fails to start and this error is thrown in JIRA_Home/log/atlassian-jira.log:
1
2
3
2016-01-31 13:16:10,207 localhost-startStop-1 ERROR [c.a.c.manager.application.ApplicationServiceGeneric] com.atlassian.cache.CacheException: java.lang.IllegalStateException: Too many rows found for query on ClusteredJob
row1: OfBizClusteredJob[id=10110,delegate=ImmutableClusteredJob[jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10200,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager,schedule=Schedule[type=INTERVAL,intervalScheduleInfo=IntervalScheduleInfo[firstRunTime=Thu Feb 19 10:37:48 EET 2015,intervalInMillis=3600000]],nextRunTime=Wed Jan 27 19:55:13 EET 2016,version=2304,rawParameters=[ACED0005737200156F72672E71756172747A2E4A6F62446174614D61709FB083E8BFA9B0CB020000787200266F72672E71756172747A2E7574696C732E537472...]]]row2:
OfBizClusteredJob[id=11106,delegate=ImmutableClusteredJob[jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10200,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager,schedule=Schedule[type=INTERVAL,intervalScheduleInfo=IntervalScheduleInfo[firstRunTime=Wed Jan 27 16:10:42 EET 2016,intervalInMillis=3600000]],nextRunTime=Sun Jan 31 12:10:42 EET 2016,version=93,rawParameters=[ACED000573720037636F6D2E676F6F676C652E636F6D6D6F6E2E636F6C6C6563742E496D6D757461626C6542694D61702453657269616C697A6564466F726D00...]]]
Diagnosis
There are 2 entries with duplicate job_id and job_runner_key in clusteredjob table
According to the above error message, they are:
1 2
id=10110,jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10200,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager id=11106,jobId=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager.10200,jobRunnerKey=com.atlassian.jira.crowd.embedded.JiraDirectoryPollerManager
Please use this SQL to identify the duplicate entries in the database:
1
SELECT * FROM clusteredjob WHERE job_id in (SELECT job_id FROM clusteredjob GROUP BY job_id HAVING COUNT(*)>1)
Cause
The duplicate entry causes JIRA not to start up properly.
See related bug: JRASERVER-64325 - Jira fails to start due to duplicate job IDs in the clusteredjob table Fixed in 7.4.6, 7.5.4, 7.7.0, 7.2.13, 7.6.2, 7.3.9 and later
Solution
Resolution
Shut down JIRA and back up the database properly
Delete either of the entries:
1
delete from clusteredjob where id = 11106;
For Oracle DB, ensure run
commit;
after the above.Restart JIRA
Was this helpful?