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

Deleting repository data (including temporary data) can fail on Windows

XMLWordPrintable

      Issue Summary

      Git creates loose objects and pack files on Windows with the read-only flag set. As Bitbucket Server has migrated from Java's File API (which clears the read-only flag in delete()) to Path, many different codepaths can now fail to delete files. The majority of these File to Path changes shipped in Bitbucket Server 6.4.0.

      These failures typically do not cause the overall operation to fail. Instead, the most common side effect is that the failure leaves temporary files behind that should have been cleaned up. These can eventually accumulate to a point where they take a considerable amount of disk space, and will only ever be removed if done so manually by an admin.

      Steps to Reproduce

      Some examples of codepaths affected (or potentially affected) by this issue:

      1. Deleting a repository
        • This is probably the most severe case, as it doesn't "just" leak temporary files; instead, it can leave "deleted" repository contents on disk forever
      2. Editing files via the browser
      3. Merging a pull request
      4. Rebasing a pull request

      Expected Results

      • Operations that produce temporary files should correctly clean up after themselves without requiring administrator intervention
      • Repositories should be deleted from disk when they're removed from the system

      Actual Results

      In some cases, files may be "leaked".

      • For repository deletion, this will produce errors in the logs with messages like "The following repository directory could not be deleted"
      • For temporary files, generally there is no logging to indicate deletion was unsuccessful; the failure is silently ignored

      Workaround

      Manually delete files from disk. The most common location for such files is %BITBUCKET_HOME%\tmp.

            Unassigned Unassigned
            bturner Bryan Turner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: