【问题标题】:gitlab LFS files missing after the repository is reconstructed from an exported file从导出的文件重建存储库后,gitlab LFS 文件丢失
【发布时间】:2021-05-23 01:00:37
【问题描述】:

我想将包含 LFS 文件的 gitlab 存储库从 gitlab 服务器 A 迁移到 gitlab 服务器 B。

这是我已经完成的步骤:

  1. 点击设置->常规->在gitlab服务器A的仓库中导出项目,然后下载导出的文件repo.tar.gz
  2. 使用repo.tar.gz 文件在服务器 B 中创建一个新的存储库。

上述步骤的问题是我无法下载服务器 B 中的 LFS 文件。

当我单击其中一个 LFS 文件的下载按钮时,我收到 404 Page Not Found 错误。

这是gitlab的bug吗?

我的 gitlab 版本是 12.5.2。

我可以成功下载服务器 A 中的 LFS 文件。

如果我使用git clone https://... 下载服务器 B 上的存储库,则会收到以下错误:

Cloning into 'repo-at-server-b'...
remote: Enumerating objects: 248971, done.
remote: Counting objects: 100% (248971/248971), done.
remote: Compressing objects: 100% (163634/163634), done.
remote: Total 248971 (delta 61741), reused 248971 (delta 61741)
Receiving objects: 100% (248971/248971), 1.60 GiB | 42.92 MiB/s, done.
Resolving deltas: 100% (61741/61741), done.
Checking out files: 100% (226626/226626), done.
Downloading lfs_files/art.tar.xz (7.0 MB)
Error downloading object: lfs_files/art.tar.xz (b0d6758): Smudge error: Error downloading lfs_files/art.tar.xz (b0d67582c9a992b4f8a01fdde0f96999385435b98763251e64520e263e76ac0d): [b0d67582c9a992b4f8a01fdde0f96999385435b98763251e64520e263e76ac0d] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it

Errors logged to /data-disk/debug_git_lfs/repo-at-server-b/.git/lfs/logs/20210220T110106.03414397.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: lfs_files/art.tar.xz: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

从服务器 A 导出存储库或导入服务器 B 时似乎出现问题。

我尝试了the answer in this post,但在git lfs pull 命令失败。

我从git lfs pull 得到的错误信息是[c889004e16f35973ac3d695f7939e388060c425fd98d708e5076aefb67q15065] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it

【问题讨论】:

    标签: git gitlab git-lfs


    【解决方案1】:

    我只能说 Atlassian 的 bitbucket——不是 gitlab,但我猜原理行为是一样的,因为 LFS 是一个常见的 git 扩展。 LFS 对象将存储在文件系统上的一个单独区域(对于 bitbucket,例如 /data/git-lfs/storage),而普通存储库存储在不同的位置(bitbucket:/data/repositories) 当一个大文件将被推送到存储库时,那么对象本身将被存储在 git-lfs 存储区中,在存储库中的文件本身只有一个使用 SHA256 哈希的对象的指针。 当您现在导出存储库时,只会导出存储库原样,这意味着仅对 LFS 对象的引用而不是对象本身。

    有关如何正确迁移的过程,只需像 'moving GIT lfs between hosts''git lfs migrate example' 一样 google 并检查是否有针对 gitlab 描述的解决方案

    【讨论】:

      猜你喜欢
      • 2021-03-13
      • 1970-01-01
      • 1970-01-01
      • 2021-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多