Feature #12853
open
Removing git branch result of database inconsistencies
Added by Daniel Dehennin almost 12 years ago.
Updated about 1 year ago.
Description
Hello,
Following my comment on #1273, I unblocked a project by removing the git repository and re-adding it (which duplicates fixes :-/).
Now, that project is causing troubles again, the only thing I did is to delete a temporary branch.
The garbage collector of git removes commits not linking to a branch or tag, which seems to be the causes of inconsistencies in the database.
Branch deletion should be tracked to remove the commits from the database.
Regards.
The problem comes from the Repository.extra_info["heads"]
.
I'm using a solution from #1273:
sudo -u www-data ruby script/console production
>> repo = Repository.first(:conditions => {:project_id => Project.find('project_name').id})
>> repo.extra_info["heads"] = []
>> repo.save
>> repo.fetch_changesets
- Has duplicate Defect #15306: No database update on git history rewrite added
- Has duplicate Defect #22010: Git: Outdated Commits are not existing anymore, but are saved in Redmines cache added
I can confirm this problem still exists: If a branch is removed from the git repo, the state gets broken and further indexing of te repo fails with errors like this:
App 189 output: fatal: bad object baf819411e93c8edce158c15f28eeb3b06dada13
App 189 output: E, [2023-11-07T17:26:41.220346 #189] ERROR -- : git log error: git exited with non-zero status: 128
Also available in: Atom
PDF