Repository/Project deletion failed and unable to add new users/groups in repositories

I have installed stash 3.2 and added the evaluation license for testing purpose. i created a project and created the repository. I was testing the various functionalities by deleting a repository and project which failed. I tried to add group to repo which also failed. seeing the below in log

2014-08-20 11:09:09,490 INFO [http-bio-17993 exec-2] admin @L9VJK8x669x260x0 gnwktx 10.178.23.278 "GET /projects/MON/repos/testing/settings HTTP/1.1" c.a.s.i.w.a.RepositoryAdminController Failed to resolve default branch. Cause: refs/heads/master is set as the default branch, but this branch does not exist

2014-08-20 11:18:04,549 INFO [http-bio-17993-exec-4] admin @L9VJK8x678x404x0 gnwktx 10.178.23.278 "GET /projects/MON/repos/testing/settings HTTP/1.1" c.a.s.i.w.a.RepositoryAdminController Failed to resolve default branch. Cause: refs/heads/master is set as the default branch, but this branch does not exist

i get the below pop up while trying to add group(permission) for a particular repo

Something went wrong while trying to serve your request. Try reloading the page.

2 answers

1 accepted

Accepted Answer
0 votes

Hi,

The log confirms that the default branch does not exist.

c.a.s.i.w.a.RepositoryAdminController Failed to resolve default branch. Cause: refs/heads/master is set as the default branch, but this branch does not exist

In this example, the default branch has been set to be "master".

 

Troubleshooting

The following git commands can be used to confirm if the branch is available in a local clone of the repository and/or on Bitbucket Server:

# Retrieving only local branches
git branch
# Retrieving all remote branches
git branch -r

Identify who deleted the branch and restore it

If the branch existed previously and you suspect that it has been deleted, you can follow the instructions on the How to identify a deleted branch to confirm that and identify the user who deleted the branch. Note that this only applies to branches deleted via Git commands and not via the User interface.

We can still detect if a branch was deleted via the user interface if the audit log was set to LOW.

Once the deleted branches have been identified, it can be restored by following the instructions on the How to restore a deleted branch.

 

Cheers,

Caterina - Atlassian

0 votes

Hi NMohan

In the repository settings you can choose which branch should be the default one. Apparently you have the master branch selected but it doesn't exist. Something is inconsistent.

Would you be able to try to select a valid branch and attempt to delete the repo again?

If that doesn't work, I advise you to raise a support issue with us so we can investigate further.

Best regards,

Thiago Bomfim

Atlassian Support

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

2,391 views 9 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you