Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-15823

Users that had their usernames renamed after a cache flush event will not be able to log into other nodes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Highest
    • 7.4.0, 7.2.12
    • 7.1.8, 7.2.8, 7.2.9, 7.3.5, 7.3.7, 7.2.10
    • Data Center
    • 7.01
    • 2
    • Severity 2 - Major
    • 1
    • Hide

      We are planning to back-port this bug to 7.2.12. I will let you know as soon as we have a release date set up.

      Cheers
      Pawel Farid
      JIRA Dev Manager.

      Show
      We are planning to back-port this bug to 7.2.12. I will let you know as soon as we have a release date set up. Cheers Pawel Farid JIRA Dev Manager.

    Description

      Summary

      After changing the username of an user on node1, sometimes this user will not be able to log in any other nodes aside from node1.
      Tech details: ApplicationUserEntity used in UserKeyStoreImpl's caches' keys is not Serializable and causes java.io.NotSerializableException in Data Center.

      Environment

      • JIRA Data Center

      Steps to Reproduce

      For end user:

      1. After changing the username of an user on node1, sometimes this user will not be able to log in any other nodes aside from node1.
      2. Deploy a new JIRA Data Center cluster with two nodes
      3. Create an user (e.g. user1) at node1
      4. On node1, change user1's username to user2.
      5. Try to login as user user2 at node2.

      For developers:

      1. Deploy a new JIRA Data Center cluster with two nodes, making sure you are not using an unlimited license.
      2. Create an user (e.g. user1).
      3. On node1, flush all caches
      4. On node1, change user1's username to user2.

      Expected Results

      Cache is correctly replicated to other nodes in the cluster and user2 is able to login properly.

      Actual Results

      The following exception is thrown on node1:

      2017-09-22 10:48:36,331 http-nio-8080-exec-9 INFO admin 648x1078x1 15qcmg1 0:0:0:0:0:0:0:1 /rest/internal/1.0/cache/app [c.a.c.e.c.a.j.c.e.ofbiz.EagerOfBizGroupCache.groupCache] Cache com.atlassian.jira.crowd.embedded.ofbiz.EagerOfBizGroupCache.groupCache was flushed
      2017-09-22 10:48:41,488 ehcache-replicator-19 ERROR admin 678x136x1 1cbrzc8 0:0:0:0:0:0:0:1 /secure/admin/user/EditUser.jspa [c.a.j.c.cache.ehcache.BlockingParallelCacheReplicator] Exception on replication of remove. error marshalling arguments; nested exception is: 
          	java.io.NotSerializableException: com.atlassian.jira.user.ApplicationUserEntity. Cache: com.atlassian.jira.user.util.UserKeyStoreImpl.keyToUserCache Peer: com.atlassian.jira.user.util.UserKeyStoreImpl.keyToUserCache
      java.rmi.MarshalException: error marshalling arguments; nested exception is: 
      	java.io.NotSerializableException: com.atlassian.jira.user.ApplicationUserEntity
      	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:158)
      	at net.sf.ehcache.distribution.RMICachePeer_Stub.remove(Unknown Source)
      	at com.atlassian.jira.cluster.cache.ehcache.BlockingParallelCacheReplicator.lambda$replicateRemovalNotification$1(BlockingParallelCacheReplicator.java:163)
      	at com.atlassian.jira.cluster.cache.ehcache.BlockingParallelCacheReplicator.lambda$null$3(BlockingParallelCacheReplicator.java:203)
      	at com.atlassian.jira.cluster.cache.ehcache.ClassLoaderSwitchingRunnable.run(ClassLoaderSwitchingRunnable.java:18)
      	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.NotSerializableException: com.atlassian.jira.user.ApplicationUserEntity
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
      	at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:294)
      	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:153)
      	... 8 more
      

      This happens because the class com.atlassian.jira.user.ApplicationUserEntity does not implement the interface Serializable. Due to that node1 will fail to replicate this cache invalidation event to other nodes, making them unaware user1 is now called user2.

      Notes

      The specific operation during normal JIRA usage causing a cache flush is still unknown. There is some suspicion on third-party add-ons calling ClearCacheEvent, which could cause this.

      Workaround

      • Perform rolling restarts on all nodes except the one where the user was renamed.

      Attachments

        Issue Links

          Activity

            People

              lwlodarczyk Lukasz Wlodarczyk
              pbugalski Pawel Bugalski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: