Jira Data Center node startup fails with the error "Only one result is allowed for fetchOne calls" in the logs
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
Jira Data Center node fails to start and a stacktrace like the following appears in atlassian-jira.log
:
2022-08-04 02:42:57,901+0100 localhost-startStop-1 ERROR [c.a.jira.startup.ComponentContainerLauncher] A fatal error occurred during initialisation. JIRA has been locked.
net.sf.ehcache.CacheException: java.util.concurrent.CompletionException: com.google.common.util.concurrent.UncheckedExecutionException: com.querydsl.core.NonUniqueResultException: Only one result is allowed for fetchOne calls
at net.sf.ehcache.CacheManager.init(CacheManager.java:426)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:270)
at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:1116)
at net.sf.ehcache.CacheManager.newInstance(CacheManager.java:1092)
at com.atlassian.jira.component.pico.registrar.CacheManagerRegistrar.getCacheManagerDelegate(CacheManagerRegistrar.java:264)
at com.atlassian.jira.component.pico.registrar.CacheManagerRegistrar.registerCacheManager(CacheManagerRegistrar.java:162)
at com.atlassian.jira.component.pico.registrar.ContainerRegistrar.registerCacheManager(ContainerRegistrar.java:3963)
at com.atlassian.jira.component.pico.registrar.ContainerRegistrar.registerComponents(ContainerRegistrar.java:3910)
at com.atlassian.jira.component.pico.ComponentManager.createFullContainer(ComponentManager.java:209)
at com.atlassian.jira.startup.ComponentContainerLauncher.populateFullPicoContainer(ComponentContainerLauncher.java:50)
at com.atlassian.jira.startup.ComponentContainerLauncher.start(ComponentContainerLauncher.java:30)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$postDbLaunch$2(DefaultJiraLauncher.java:138)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrEnqueue(DatabaseConfigurationManagerImpl.java:301)
at com.atlassian.jira.config.database.DatabaseConfigurationManagerImpl.doNowOrWhenDatabaseActivated(DatabaseConfigurationManagerImpl.java:196)
at com.atlassian.jira.startup.DefaultJiraLauncher.postDbLaunch(DefaultJiraLauncher.java:135)
at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$0(DefaultJiraLauncher.java:102)
at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:100)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuff(LauncherContextListener.java:154)
at com.atlassian.jira.startup.LauncherContextListener.initSlowStuffInBackground(LauncherContextListener.java:139)
at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:101)
... 5 filtered
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.util.concurrent.CompletionException: com.google.common.util.concurrent.UncheckedExecutionException: com.querydsl.core.NonUniqueResultException: Only one result is allowed for fetchOne calls
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1606)
... 3 more
Environment
Jira Data Center 8.17+.
Diagnosis
There are multiple rows in the table securityproperty
which holds the authentication key used in the cache replication exchange between the nodes:
SELECT * FROM public.securityproperty;
The query above is valid for PostgreSQL database. For other databases, the schema under which the table exists can be different. Please adapt the query as needed.
For more details about the cluster authentication mechanism, please check Jira Data Center cluster authentication.
Cause
Only one authentication key must exist, otherwise the node cannot pick any key from the table and the cache service won't start.
The reason for which multiple keys were created is unknown.
Solution
Delete the existing keys from the database:
DELETE FROM public.securityproperty WHERE property_key = 'rmi.socket.cluster.auth.secret.key';
The statement above is valid for PostgreSQL database. For other databases, the schema under which the table exists can be different. Please adapt the query as needed.
A new key will be generated within a minute.
Restart Jira on the affected node.
For the working Data Center nodes, the communication will continue to use the old key for a short time, and then switch to using the new key, just to not allow for any unauthenticated communication. For this reason a restart on the working nodes is not needed.