Jira 500 Error - "Multiple entries with same key" error caused by mixed case in project keys
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
When trying to access all project or issue pages in Jira, the response is a code 500 - internal server error with the stack like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
java.lang.RuntimeException: com.atlassian.cache.CacheException: java.lang.IllegalArgumentException: Multiple entries with same key: SOFP=10000 and SOFp=10000
at com.atlassian.web.servlet.plugin.DynamicAuthorizationServletForwarder.forward(DynamicAuthorizationServletForwarder.java:55) [?:?]
at com.atlassian.web.servlet.plugin.DynamicAuthorizationServletForwarder.forwardSafely(DynamicAuthorizationServletForwarder.java:83) [?:?]
...
Caused by: com.atlassian.cache.CacheException: java.lang.IllegalArgumentException: Multiple entries with same key: SOFP=10000 and SOFp=10000
at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:92) [atlassian-cache-memory-4.0.0.jar:?]
at com.atlassian.jira.project.util.CachingProjectKeyStore.getProjectId(CachingProjectKeyStore.java:39) [classes/:?]
at com.atlassian.jira.project.ProjectCache.getProjectByKey(ProjectCache.java:156) [classes/:?]
...
Caused by: java.lang.IllegalArgumentException: Multiple entries with same key: SOFP=10000 and SOFp=10000
at com.google.common.collect.ImmutableMap.conflictException(ImmutableMap.java:215) [guava-26.0-jre.jar:?]
at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:209) [guava-26.0-jre.jar:?]
at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:394) [guava-26.0-jre.jar:?]
at com.google.common.collect.ImmutableSortedMap.fromEntries(ImmutableSortedMap.java:344) [guava-26.0-jre.jar:?]
at com.google.common.collect.ImmutableSortedMap.copyOfInternal(ImmutableSortedMap.java:328) [guava-26.0-jre.jar:?]
at com.google.common.collect.ImmutableSortedMap.copyOf(ImmutableSortedMap.java:240) [guava-26.0-jre.jar:?]
at com.atlassian.jira.project.util.CachingProjectKeyStore$ProjectKeyCache.<init>(CachingProjectKeyStore.java:89) [classes/:?]
at com.atlassian.jira.project.util.CachingProjectKeyStore.lambda$new$0(CachingProjectKeyStore.java:27) [classes/:?]
...
Diagnosis
Notice the message in the error: Multiple entries with same key: SOFP=10000 and SOFp=10000
It shows the project keys (SOFP
and SOFp
) and the project ID (10000)
The issue described here happens when the project keys differ only in the character case. In this example, the last character.
Cause
Jira allows changing the project key, as documented in Changing the project key format.
When loading the project keys from the project_key
table into the cache, there are entries that differ only in case. In the example, "SOFP" and "SOFp".
If we allow lower case characters and at some point change only the case in the project key, Jira understands that the entries in the project_key
table are duplicates, causing these errors.
Solution
Notice the message in the error:
Multiple entries with same key: SOFP=10000 and SOFp=10000
It shows the project keys (
SOFP
andSOFp
) and the project ID (10000)
Find the entries in the database:
1
SELECT * FROM project_key WHERE project_ID=10000
For example:
id | project_id | project_key |
---|---|---|
10200 | 10000 | SOFP |
10000 | 10000 | SOFp |
Choose the one to be removed and remove it. Following the example above:
1
2
DELETE FROM project_key WHERE id=10000;
COMMIT;
⚠️ Make sure to always have a backup before making database changes.
Shutdown all the nodes.
Start Jira again.
Was this helpful?