Popular Tab Does Not Show Any Results Due to NullPointerException
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
Summary
Symptoms
Popular tab does not show any results for a particular user and it keeps on loading. The following appears in the atlassian-confluence.log
:
1
2
3
4
5
6
7
8
2013-08-22 07:41:34,005 ERROR [http-80-31] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service
-- url: /rest/popular/1/stream/content | userName: pfranken | referer: <base-url>
java.lang.NullPointerException
at com.atlassian.confluence.plugins.edgeindex.DefaultEdgeQueries.getMostPopular(DefaultEdgeQueries.java:87)
at com.atlassian.confluence.plugins.edgeindex.DefaultEdgeQueries.getMostPopular(DefaultEdgeQueries.java:48)
at com.atlassian.confluence.plugins.edgeindex.rest.StreamResource.getMostPopular(StreamResource.java:131)
at sun.reflect.GeneratedMethodAccessor3164.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Diagnosis
Try running the following SQL query to see if it returns any results. If it does, proceed to the resolution
Confluence 5.1.x and earlier
1
2
select * from FOLLOW_CONNECTIONS
where lower(followee) NOT IN (SELECT lower_user_name FROM cwd_user);
Confluence 5.2.x and above
1
2
select * FROM FOLLOW_CONNECTIONS f, user_mapping u
WHERE f.followee = u.user_key AND u.lower_username NOT IN (SELECT lower_user_name FROM cwd_user);
Cause
The problematic user is following a user that does not exist due to this bug: CONFSERVER-15614 - Follow info not removed when user is removed with LDAP integration or Crowd.
Solution
Resolution
Shutdown Confluence
Backup your Confluence database for safety precaution
Execute the following SQL query in your Confluence database to delete all followers that do not exist in
cwd_user
tableConfluence 5.1.x and earlier
1 2
DELETE FROM follow_connections WHERE LOWER(followee) NOT IN (SELECT lower_user_name FROM cwd_user);
Confluence 5.2.x and above
1 2
DELETE FROM follow_connections WHERE followee in (select user_key from user_mapping WHERE lower_username NOT IN (SELECT lower_user_name FROM cwd_user));
Start Confluence
Was this helpful?