Jira 500 Error - "Multiple entries with same key" error caused by mixed case in project keys
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
要約
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:
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/:?]
...
診断
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.
原因
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.
ソリューション
- 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:
SELECT * FROM project_key WHERE project_ID=10000
例:
ID | project_id | project_key |
---|---|---|
10200 | 10000 | SOFP |
10000 | 10000 | SOFp |
- Choose the one to be removed and remove it. Following the example above:
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.