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 and SOFp)  and the project ID (10000)
  • Find the entries in the database:
SELECT * FROM project_key WHERE project_ID=10000

例:

IDproject_idproject_key
1020010000SOFP
1000010000SOFp
  • Choose the one to be removed and remove it. Following the example above:
DELETE FROM project_key WHERE id=10000;
COMMIT;

(warning) Make sure to always have a backup before making database changes.

  • Shutdown all the nodes.
  • Start Jira again.


最終更新日 2020 年 11 月 10 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.