Jira server throws there is no ID mapped for the user key error

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

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)

Cause

This exception happens because there are entries on userassociation table, related to the watchers list on issues, that are referencing to non-existent users on cwd_user table.

Resolution

  • Run the following query on JIRA database (replace 'testuser' with the user name mentioned on the stack trace of the error):

    SELECT * from userassociation WHERE association_type = 'WatchIssue' 
    AND source_name = 'testuser'
  • If the query above returns any results, please proceed to the next steps. Otherwise, contact Atlassian Support.

    tip/resting Created with Sketch.

    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. Shutdown JIRA.

  2. Run the following statement:

    DELETE FROM userassociation 
    WHERE association_type = 'WatchIssue' 
    AND source_name = 'testuser'
  3. Restart JIRA and run a full re-index.

Last modified on Sep 25, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.