Search code examples
gitazureazure-devops

Deleting Git Repo on Azure DevOps with Parentheses in the name


I am trying to delete some git repositories on Azure DevOps.

The repository names contain parentheses (). Here is an example for a name:

Repo XY (Abandoned)

Repositories without parentheses in their name can be deleted with no issues. However, as soon as there are parentheses in the name, I get following error:

TFS.WebApi.Exception: TF401019: The Git repository with name or identifier 
123456789 does not exist or you do not have permissions for the operation
you are attempting.

I also have this warning in repositories that have parentheses in their name:

Advanced Security status for this repository can't be retrieved right now. 
Support has been notified. Please try again after a few minutes.

This warning is not shown for repositories without brackets in their name within the same project and I also can delete these repositories without brackets within the same project (no errors).

I have this issue across two individual projects.

According to this page, parentheses are not restricted characters: \ / : * ? " < > ; # $ * { } , + = [ ] |. So I am confused why this only happens to repositories that have parentheses in their names.


Edit: It turns out that the reason for the error are not the parentheses. All abandoned repositories had parentheses but they also had the option Disable Repository enabled.

Please see Ziyang Liu's answer for more details.


Solution

  • Testing on my side, there isn't any issue when deleting a repo which name contains brackets. It seems that the issue is related to your repos themselves.

    Please check whether Disable Repository option has been enabled in your affected repo. If so, please disable it and then delete the repo again. enter image description here

    If there is the same issue after turning off Disable Repository option, please try the followings:

    1. Run REST API Repositories - Get to check the state of your affected repo.

    2. Run REST API Repositories - Delete to delete the affected repos.