Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR: bitbucket gi did not send all necessary objects

pedrox5 June 17, 2024

I'm getting the following error on one of our repositorys. I keep deleting the local and checking out a fresh instance and it works for about 10 commits and then it throws the error and keeps me from working. Any thoughts?

here is the error. 

fatal: bad object refs/heads/val [conflicted 4] error: https://bitbucket.org/workspace-id/repo.git did not send all necessary objects

 

[Edit: URL sanitized for privacy]

2 answers

1 vote
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2024

Hi and welcome to the community!

I ran a git fsck on your repo and there is no corruption on the remote repo. So, the corruption seems to occur on your local repo only. It's hard to say what is causing it, though, as we don't have access to your local clone, and we don't know what operations you are performing.

If you check the references in the directory .git/refs/heads in your local clone, do the file names there match with the names of your branches (when the issue occurs)?

Kind regards,
Theodora

pedrox5 June 21, 2024

it appears in this folder I have two instances of our staging "val" and they both have bracket title additions [conflicted 4] and [conflicted 5]

 

Thanks for your help!

Peter

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 24, 2024

Hi Peter,

You may be able to fix this in one of the following two ways (emphasis on "may", as I don't have access to your clone directory and I don't know the state of the rest of the objects). Please take a backup before you proceed (copy the clone directory and paste it elsewhere on that computer), in case these attempts corrupt the repo further.

 

1. If the branch named val exists on the remote repo, and you did not make locally any additional commits on this branch, and if the currently checked out branch in the clone is different than val, you can try deleting the files .git/refs/heads/val [conflicted 4] and .git/refs/heads/val [conflicted 5].

I also suggest checking the files inside .git/logs/refs/heads to see if there are similar conflicted files in there. If there are, delete these as well.

Then, do a git fetch. If you want to create a local branch val from the remote, you can run

git checkout -b val origin/val

 

2. Alternatively, you can try fixing the references inside the conflicted files. If you made commits locally on val branch that don't exist on the remote, you need to know the hash of the last commit on val.

First, remove the file .git/refs/heads/val [conflicted 5]. Then, rename the file .git/refs/heads/val [conflicted 4] to .git/refs/heads/val. The content of the val file should be the hash of the latest commit on val branch.

You can try leaving the content of the file .git/refs/heads/val as is or, if this doesn't work, changing it to the content of the file .git/refs/heads/val [conflicted 5] (check your backup).

If there are logs in the folder .git/logs/refs/heads, specifically .git/logs/refs/heads/val, you can also check that file to find the last commit hash on val branch.

Kind regards,
Theodora

1 vote
Nicolas Grossi
Banned
June 17, 2024
pedrox5 June 21, 2024

Thank you Nic, I will take a look and see if i can get off the rocks. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events