Confluence Is Unable To Fetch Data From Crowd When Following "Here Be Dragons" Instructions
Symptoms
Confluence throws a NullPointerException when trying to:
- List Group members via the Confluence Admin console,
- Creating a Space,
- Changing the Confluence license,
Confluence will show a stack trace with the following messages in the bottom:
...
Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at com.atlassian.confluence.util.ReadOnlyLicenseCalculator.handleExecutionFailure(ReadOnlyLicenseCalculator.java:106)
...
... 160 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:232)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at com.atlassian.confluence.util.ReadOnlyLicenseCalculator.getNumberOfLicensedUsers(ReadOnlyLicenseCalculator.java:81)
... 170 more
Caused by: java.lang.NullPointerException
at com.atlassian.confluence.user.DefaultUserAccessor.getUsersWithConfluenceAccess(DefaultUserAccessor.java:274)
at com.atlassian.confluence.user.DefaultUserAccessor.getUsersWithConfluenceAccessAsList(DefaultUserAccessor.java:658)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
...
Cause
Unknown. Atlassian has not been able to reproduce the issue locally, and the issue is only reported by a very low minority, however it is clear that using the Directory created during the Setup Wizard to store data for non-administrator users is causing the problem.
Resolution
Please try the following workaround:
- Create a new Internal Directory called TestDirectory (Crowd console >> Directories).
- Create a user inside the Directory with the same name as the one already existent: charlie (Crowd console >> Users)
- Create group confluence-users and confluence-administrators inside the new Directory (Crowd console >> Groups)
- Add user charlie to both Groups.
- Assign the new Directory to the Confluence Application (Crowd console >> Applications >> confluence >> Directories tab) and set Allow all to Authenticate to true.
- Unassign the old directory crowd from the confluence Application (Crowd console >> Applications >> confluence >> Directories tab >> Remove)
- Test the authentication with the new user (Crowd console >> Applications >> confluence >> Authentication Test)
- Restart Confluence
Login with charlie and try to perform the operation that was not working