Skip to content

When a repository is broken but git repository could be open, then mark it as normal #34443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

lunny
Copy link
Member

@lunny lunny commented May 13, 2025

Some repositories will be marked as broken because of temporary disk access problems and can not be recovered except to update the database.

This PR will mark a broken repository as normal if the git repository could be open normally.

Try to fix #34424

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 13, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label May 13, 2025
@wxiaoguang
Copy link
Contributor

I do not think you should patch it again.

image

@wxiaoguang
Copy link
Contributor

-> Fix repo broken check #34444

@hiifong
Copy link
Member

hiifong commented May 13, 2025

Recently, because of the lack of hard disk space on my gitea server, I took a backup of all my gitea data via scp, but when I restore gitea again via scp, I get the same type of situation, and opening the repository gives me an error: "The Git data underlying this repository cannot be read. Contact the administrator of this instance or delete this repository.", part of the repository has this problem, if you query the repository directly from the database with a status of 3, you can't find a single piece of data. Only when you open a repository on the web page with this error, and then go to the database to query the status of 3 can be found, my solution is to write a script to re-initialize all the repositories (git init ---bare) once, and if the punch card repository in the emergence of this problem, then manually change the status of the database from 3 to 0.

I've been busy with work lately, so I may not have time to look at it.

@lunny lunny closed this May 13, 2025
@lunny lunny deleted the lunny/mark_broken_as_normal branch May 13, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken repo - don't understand why and how to fix
4 participants