gitlab 500 server error

http://stackoverflow.com/questions/36546774/gitlab-repository-corrupted-showing-500-error-on-frontend

 

1. # cd gitlab/repositories/<namespace>/<reponame>.git 

2. # git fsck
If any error like below
error: object file objects/11/fbf0dfb1a54283e84044b5e99230efbafd77d8 is empty
error: object file objects/11/fbf0dfb1a54283e84044b5e99230efbafd77d8 is empty
fatal: loose object 11fbf0dfb1a54283e84044b5e99230efbafd77d8 (stored in objects/11/fbf0dfb1a54283e84044b5e99230efbafd77d8) is corrupt

3.  # find . –size 0 –delete  
This will delete all files which has 0 byte size and corrupt

4.  # git fsck
Checking object directories: 100% (256/256), done.
Checking objects: 100% (4970/4970), done.
error: HEAD: not a commit
error: refs/heads/master: not a commit
dangling commit de516dd3d99d13147b6e2f946fe5b8c0660e4eed

5.   Try to push code from local without add and commit 
# git push origin <branch>
If got below error
remote: error: Could not read 5329f756010fad47026f112dc7126bdaa2f9ad7f
remote: fatal: Failed to traverse parents of commit  8eecd866caa916a3b2e8550153f0bb5a54a28919
remote: aborting due to possible repository corruption on the remote side.
fatal: protocol error: bad pack header

6.  Go to cd gitlab/repositories/<namespace>/<reponame>.git
# rm –fr ref/head/<branchname>
# git fsck
notice: HEAD points to an unborn branch (master)
Checking object directories: 100% (256/256), done.
notice: No default references
dangling commit eb84ebc9010ea3d3d5646b4eab1bacd358178fbd

7.  Try to push code from local without add and commit 
# git push origin <branch>

具体执行指令如下:

df -h
 2000  cd /var/
 2001  ls
 2002  cd opt/
 2003  ls
 2004  cd gitlab/
 2005  ls
 2006  cd git-data/
 2007  ls
 2008  cd repositories/
 2009  ls
 2010  cd htk-app/
 2011  ls
 2012  ls -l
 2013  ls -ll
 2014  cd ios.git/
 2015  ls
 2016  ls -ll
 2017  git fsck
 2018  find . –size 0 –delete
 2019  git fsck
 2020  find . -size 0 -delete
 2021  git fsck
 2022  git push origin
 2023  ls
 2024  pwd
 2025  cd refs/heads/
 2026  cd ..
 2027  cd head
 2028  cd heads
 2029  ls
 2030  cd ../..
 2031  ls
 2032  rm -fr refs/heads/develop1.1 
 2033  git fsck
 2034  git push origin develop1.1
 2035  git push origin
 2036  history

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326550178&siteId=291194637