Deletion of a forked repository with fork syncing enabled fails silently when the upstream repository is under heavy load.

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • None
    • Affects Version/s: 9.4.16
    • None
    • Severity 3 - Minor

      Issue Summary

      Deletion of a forked repository with fork syncing enabled fails silently when the upstream repository is under heavy load.

      Steps to Reproduce

      1. In Bitbucket, identify a busy repository UPSTREAM_REPO with frequent changes.
      2. Create a fork FORK_REPO from UPSTREAM_REPO with Enable fork syncing checked.
      3. Allow some time for activity on UPSTREAM_REPO (pushes, branch updates, possibly ongoing fork sync operations).
      4. While the upstream repository remains busy / actively changing:
        1. Navigate to Settings → Repository details of FORK_REPO.
        2. Click Delete repository.

      Expected Results

      • The forked repository FORK_REPO is deleted successfully.
      • The user sees:
        • A confirmation message in the UI, and/or
        • A clear error message if deletion cannot proceed (e.g. “Repository cannot be deleted because fork sync is in progress” or similar).
      • No residual references to the deleted fork remain (in UI or logs) once deletion completes.

      Actual Results

      No error message is shown to the user on UI and the following exception is thrown in the atlassian-bitbucket.log file:

      "DELETE /users/123456/repos/repo10 HTTP/1.1" o.h.e.jdbc.spi.SqlExceptionHelper ERROR: update or delete on table "repository" violates foreign key constraint "fk_sta_repo_activity_repo" on table "sta_repo_activity" Detail: Key (id)=(54321) is still referenced from table "sta_repo_activity". 

      Workaround

      • Disable Fork syncing on the fork and wait for any ongoing sync operations to finish, then attempt deletion again.
      • Alternatively, archive the repository first, which will make the repository ready only then attempt deletion. 

              Assignee:
              Unassigned
              Reporter:
              Kalyan Kumar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: