Gitlab存储库错误找不到包条目 [英] Gitlab repository error failed to find pack entry

查看:24
本文介绍了Gitlab存储库错误找不到包条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Gitlab 存储库已损坏.在前端收到 500 个内部服务器错误.

Gitlab repository corrupted. getting 500 internal server error on frontend.

Started GET "/" for 127.0.0.1 at 2016-04-11 16:22:02 +0530
Processing by DashboardController#show as HTML
Read fragment views/projects/44-20160408141103000000000/dashboard/show/cc53ca8d7b83612d3f40df2a690c7950 (0.1ms)
Completed 500 Internal Server Error in 27ms

ActionView::Template::Error (Object not found - failed to find pack entry (509db335d2df02b878c18e1a6fe84393da6978c1)):
    2:   = link_to project_path(project), class: dom_class(project) do
    3:     - if avatar
    4:       .dash-project-avatar
    5:         = project_icon(project, alt: '', class: 'avatar project-avatar s40')
    6:     .dash-project-access-icon
    7:       = visibility_level_icon(project.visibility_level)
    8:     %span.str-truncated
  app/models/repository.rb:8:in `new'

推荐答案

执行以下步骤

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>

Done your code updated successfully !!!

这篇关于Gitlab存储库错误找不到包条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆