Jira server throws there is no ID mapped for the user key error
プラットフォームについて: 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 は除く
問題
No problem is noticed on the regular usage, however the following exception appears in the atlassian-jira.log when trying to create issues or send mail notifications for issue activities:
2015-07-08 16:43:02,465 http-bio-8080-exec-99 ERROR admin 1003x52096x1 xe4oev 10.0.0.8 /secure/CommentAssignIssue.jspa [atlassian.event.internal.AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event [com.atlassian.jira.event.issue.DefaultIssueEventBundle@25b22747] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.jira.event.listeners.mail.MailListener.handleIssueEventBundle(com.atlassian.jira.event.issue.IssueEventBundle), listener=com.atlassian.jira.event.listeners.mail.MailListener@28efb47d}]
java.lang.RuntimeException: There is no ID mapped for the user key 'testuser'
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107)
at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)
または
2018-09-28 08:33:58,330 http-nio-8080-exec-120432 ERROR admin_user 513x41379501x1 32fnvs 10.122.130.50,10.122.140.22 /rest/schizophrenia/1.0/switchuser/possibleusers [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: There is no ID mapped for the user key 'testuser'
java.lang.IllegalStateException: There is no ID mapped for the user key 'testuser'
[..........]
診断
Run the following queries on JIRA database (replace 'testuser'
with the user name mentioned on the stack trace of the error):
Query 1: check userassociation
table
SELECT * FROM userassociation
WHERE association_type = 'WatchIssue'
AND source_name = 'testuser';
Query 2: check app_user
table
SELECT * FROM "app_user"
WHERE "user_key"='testuser';
If none of the queries come back with a result, please contact Atlassian Support.
原因 1
If query 1 comes back with results, there are entries on userassociation
table, related to the watchers list on issues, that are referencing to non-existent users on cwd_user
table. Follow the steps in solution 1 to fix the issue.
原因 2
if query 2 comes back with results, there are entries in the app_user
table, referencing non-existent users on the cwd_user
table. Follow the steps in solution 2 to fix the issue.
ソリューション
Before proceeding, perform a database backup, as the next steps will require delete operations on the database and a rollback may be needed in case of any issues
ソリューション 1
Jira をシャットダウンします。
Run the following statement (replace
'testuser'
with the user name mentioned on the stack trace of the error):DELETE FROM userassociation WHERE association_type = 'WatchIssue' AND source_name = 'testuser';
- Restart JIRA and run a full re-index.
ソリューション 2
Jira をシャットダウンします。
Run the following statement (replace
'testuser'
with the user name mentioned on the stack trace of the error):DELETE FROM app_user WHERE "user_key" = 'testuser';
- Restart JIRA and run a full re-index.