Mentions or AutoComplete do not work as expected - You receive a java.lang.NullPointerException: userkey

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

Symptoms

When attempting to mention a user, you are not able to click the user name to insert, or the search does not work as expected to find a user. You may also find this behaviour when working with other areas of Confluence that ask you to select a User.

The following appears in the atlassian-confluence.log (You may also see a similar stack trace in the console of your browser):

1 2 3 4 -- url: /rest/prototype/1/search.json | userName: userName | referer: http://wiki/some/path/ java.lang.NullPointerException: userkey at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204) at com.atlassian.sal.api.user.UserKey.<init>(UserKey.java:27)

Cause

The index is damaged or incomplete; and must be rebuilt.

Resolution

ℹ️ Because you'll need to shut down Confluence in order to re-build the content indices, you may wish to schedule the downtime outside your normal operating hours.

⚠️ Always ensure you have a full back up of your Home Directory before making changes to it.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.