Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-13261

Git throws an intermittent 500 CacheException error when cloning

XMLWordPrintable

      Issue Summary

      Post upgrade from 6.10 to Bitbucket 7.x, git intermittently fails with a 500 CacheException when performing git operations such as clones. Through investigation, these failures, which are successful if rerun, occur shortly after a repository is deleted.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create a BB 7.x instance with Postgres or Oracle as the database
      2. Create 6k repositories and assign to a single user (user A)
      3. Perform the two actions simultaneously:
        1. Continuously create repos, assign permissions (to user A or any user with a 6k or more permissions set), and then delete the repository
        2. Continuously perform a git clone of any of the previously created 6k repos

      Expected Results

      As before 7.x, the git clone would be successful.

      Actual Results

      The below exception is thrown in the atlassian-bitbucket.log file:

      2022-04-20 18:10:42,372 ERROR \[http-nio-7101-exec-9] \*166VK1Qx1090x178617x0 127.0.0.1 "POST /mvc/error500 HTTP/1.1" c.a.s.i.web.ErrorPageController There was an unhandled exception loading \[/scm/pk/repo-3201.git/git-upload-pack]
      com.atlassian.cache.CacheException: javax.persistence.EntityNotFoundException: No row with the given identifier exists: \[com.atlassian.stash.internal.repository.InternalRepository#375849]
      	at com.atlassian.cache.memory.DelegatingCache.get(DelegatingCache.java:212\)
      	at com.atlassian.cache.memory.DelegatingCache.get(DelegatingCache.java:163\)
      	at com.atlassian.cache.hazelcast.HazelcastAsyncHybridCache.get(HazelcastAsyncHybridCache.java:79\)
      	at com.atlassian.stash.internal.permission.DefaultGrantedPermissionVoterProvider.getUserPermissions(DefaultGrantedPermissionVoterProvider.java:288\)
      	at com.atlassian.stash.internal.permission.DefaultGrantedPermissionVoterProvider.access$600(DefaultGrantedPermissionVoterProvider.java:78\)
      	at 
      

      OR

      2022-04-20 13:25:44,963 ERROR [http-nio-7101-exec-81]  o.a.c.c.C.[.[.[/].[default] Servlet.service() for servlet [default] in context with path [] threw exception
      com.atlassian.cache.CacheException: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.atlassian.stash.internal.repository.InternalRepository#426182]
      
      

      Both are CacheExceptions. One states that the entity is not found, while the other states that no object is found.

      Workaround

      Rerunning the clone or CI job will lead to success, but this will not alleviate the failure itself.

      The issue may also be worked around by restricting the number of repositories a group or user has explicit permissions to. One of the ways to do this is to roll up a group's permissions from the repository to the project level.

              7adba17237c7 James Adams
              mwilliams@atlassian.com Mark A.
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: