Popular Tab Does Not Show Any Results Due to NullPointerException

Still need help?

The Atlassian Community is here for you.

Ask the community

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:

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
select * from FOLLOW_CONNECTIONS
where lower(followee) NOT IN (SELECT lower_user_name FROM cwd_user);
Confluence 5.2.x and above
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:  CONF-15614 - Getting issue details... STATUS

Resolution

  1. Shutdown Confluence
  2. Backup your Confluence database for safety precaution
  3. Execute the following SQL query in your Confluence database to delete all followers that do not exist in cwd_user table

    Confluence 5.1.x and earlier
    DELETE FROM follow_connections
    WHERE LOWER(followee) NOT IN (SELECT lower_user_name FROM cwd_user);
    Confluence 5.2.x and above
    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));
  4. Start Confluence

Last modified on Mar 30, 2016

Was this helpful?

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