Details
-
Bug
-
Resolution: Obsolete
-
Medium
-
3.0
-
None
-
BEAC
Description
https://bamboo.extranet.atlassian.com/browse/CONFFUNC-CLUST5MYSQLR-940 failed due to a number of tests being unable to create the test1 user.
Errors for tests were of the form:
java.lang.RuntimeException: org.apache.xmlrpc.XmlRpcException: java.lang.Exception: java.lang.NullPointerException at com.atlassian.confluence.usermanagement.DefaultUserManagementHelper.xmlRpcExecute(DefaultUserManagementHelper.java:85) at com.atlassian.confluence.usermanagement.DefaultUserManagementHelper.createUser(DefaultUserManagementHelper.java:30) at com.atlassian.confluence.AbstractConfluenceAcceptanceTest.createUserViaHelper(AbstractConfluenceAcceptanceTest.java:1746) at com.atlassian.confluence.AbstractConfluenceAcceptanceTest.createUserViaHelper(AbstractConfluenceAcceptanceTest.java:1758) at com.atlassian.confluence.AbstractConfluenceAcceptanceTest.createTestUser1ViaHelper(AbstractConfluenceAcceptanceTest.java:1768) at com.atlassian.confluence.SpaceAdminPermissionsAcceptanceTest.setUp(SpaceAdminPermissionsAcceptanceTest.java:26) at junit.framework.TestCase.runBare(TestCase.java:125) at net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:58)
The corresponding server error for the RPC exception is:
java.lang.NullPointerException at com.atlassian.user.impl.delegation.DelegatingUserManager.createUser(DelegatingUserManager.java:102) at bucket.user.DefaultUserAccessor.addUser(DefaultUserAccessor.java:91) at bucket.user.DefaultUserAccessor.addUser(DefaultUserAccessor.java:66) at com.atlassian.confluence.user.DefaultUserAccessor.addUser(DefaultUserAccessor.java:115) at sun.reflect.GeneratedMethodAccessor337.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Around line 102 of DelegatingUserManager:
User preexistingUser; try { preexistingUser = getUser(username); } catch (EntityException e) { throw new EntityException("Couldn't check whether user already exists", e); } if (preexistingUser != null) throw new DuplicateEntityException("User [" + username + "] already exists in " + getRepository(preexistingUser).getName());
The null-pointer is in the last line, so the preexistingUser is found but when looking up the repository that user belongs to null is returned. As the userManager being used is a CachingUserManager, it seems that the user cache is incorrect, finding that the user exists after all users have been removed (in AbstractConfluenceAcceptanceTest.cleanup(). The repository cache is correct, with no entry for the user, hence the null pointer exception.
The problem could be cluster-specific, but the first failing test AntiXSSAcceptanceTest.testVelocityStaticRenderingWithAntiXssModeDisabled had the two previous tests clearing users successfully on the same node (see https://bamboo.extranet.atlassian.com/browse/CONFFUNC-CLUST5MYSQLR-940/artifact/All-logs/output-node1.log).
Might be that logging CachingUserManager.removeUser will show the user existing in the cache after the remove, due to some cluster-cache-syncing timing issue hoodoo.