Unable to delete Git repositories due to 'Repository currently not available'
Asked by Config Sync CI Bot:

The repository \`bookstorereposynce0228a\` in the \`config-sync-ci-20240328\` workspace failed to be deleted recently.

Below listed some timestamps for the deletion:

2024-05-30 02:06:00.01638308 +0000 UTC Deleting the following repos: bookstorereposynce0228a....  
2024-05-30 02:06:00.167536217 +0000 UTC ERROR: Repository currently not available.

Before deleting that repo, there was another error occurred while deleting other repos:  
2024-05-29 22:05:06.728802914 +0000 UTC Deleting the following repos: configmanagementsystemrootsync18c9a74...., configmanagementsystemrootsync345890....., configmanagementsystemrootsync0c499a...., configmanagementsystemrootsyncc569d9....., bookstorereposync400c.... testnsrstest1d634...., testnsrstest2ddab.... configmanagementsystemroottest3f387ae...., testnsrstestaf76035...., configmanagementsystemrr174dd....  
2024-05-29 22:05:09.383426365 +0000 UTC ERROR: {"type": "error", "error": {"message": "You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}; {"type": "error", "error": {"message": "You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}; {"type": "error", "error": {"message": "You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}; {"type": "error", "error": {"message": "You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}; {"type": "error", "error": {"message": "You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}; {"type": "error", "error": {"message": "You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}; {"type": "error", "error": {"message": "You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}

All the repos on the list seemed to be deleted successfully. Hence, I'm not sure if they are related.

<br />

Please take a look and let us know what might cause the deletion error. Thanks in advance!


Answers:
author: Syahrul
body: G'day, [@Config Sync CI Bot](/t5/user/viewprofilepage/user-id/5360064)

I am unable to locate any repository name "bookstorereposynce0228a," so can you confirm with me if this repo does exist by searching on your workspace or accessing it directly?

Regards,  
Syahrul

comments: author: Config Sync CI Bot
body: Hi Syahrul, thanks for looking into the issue. The full repo name is \`bookstorereposynce0228a6c2ea6419c8268da45aad9ce8b\`.


author: Syahrul
body: Hey [@Config Sync CI Bot](/t5/user/viewprofilepage/user-id/5360064)

It appears an issue with that repository getting stuck during creation prevented you from deleting it. I manually deleted the repository from our end since it's impossible to delete them from the UI.

Regards,  
Syahrul


author: Config Sync CI Bot
body: Thanks for deleting it.

<br />

It's weird that it was in the creating state, because we deleted this repo without re-creating it. Not sure why it got stuck in the state.  

The issue occurred a few times in the past. How can we prevent it from happening again in the future?  


author: Syahrul
body: Hey [@Config Sync CI Bot](/t5/user/viewprofilepage/user-id/5360064)

It's likely been like that since the repository was first created, not because you were re-creating it.

Unfortunately, this issue occurs randomly, and it's hard to say what causes it. The only way around it is to let us know so we can manually delete it as the repository won't work.

Regards,  
Syahrul


author: Config Sync CI Bot
body: Thanks.

FYI, we have seen it twice in the past 3 months.

The last occurrence was on March 27th: <https://community.atlassian.com/t5/Bitbucket-questions/Unable-to-delete-Git-repositories-due-to-Repository-currently/qaq-p/2654436#M103055>.


author: Syahrul
body: Hey [@Config Sync CI Bot](/t5/user/viewprofilepage/user-id/5360064)

I got it. The issue is likely caused by the script you're using to create or delete the repository.

If there's a connection issue during the process, it may leave the repository in the state creating/deleting state. If you are doing this in bulk, I recommend doing it incrementally rather than all at once. This should help prevent it from happening again.

Regards,  
Syahrul


author: Config Sync CI Bot
body: Hi [@Syahrul](/t5/user/viewprofilepage/user-id/744536) ,

We just got another occurrence 2 days ago.

The repo name is \`testnsrstestc5b14acbaa804b00ad07f420777cbb47\` and it is in the same workspace \`config-sync-ci-20240328\`. Please help delete in from your end.

For the root cause, I don't think we created a lot repos in bulk. It was around 15 in total. We're adding timestamps for the exact creation time. Hopefully, that would help to identify the issue. Will share more with you later.


author: Syahrul
body: Hi there,

Noted. I have deleted the repository. Let me know how it goes.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud