简体   繁体   English

gitlab 从导出的文件重建存储库后 LFS 文件丢失

[英]gitlab LFS files missing after the repository is reconstructed from an exported file

I want to migrate a gitlab repository that contains LFS files from gitlab server A to gitlab server B.我想将包含 LFS 文件的 gitlab 存储库从 gitlab 服务器 A 迁移到 gitlab 服务器 B。

Here're the steps I've done:这是我已经完成的步骤:

  1. Click Settings -> General -> Export project in the repository at gitlab server A. Then download the exported file repo.tar.gz .在 gitlab 服务器 A 的仓库中点击 Settings -> General -> Export project。然后下载导出的文件repo.tar.gz
  2. Create a new repository in server B using repo.tar.gz file.使用repo.tar.gz文件在服务器 B 中创建一个新的存储库。

The problem I have with the above steps is that I can't download the LFS files in server B.上述步骤的问题是我无法在服务器 B 中下载 LFS 文件。

When I click the download button of one of the LFS files, I get a 404 Page Not Found error.当我单击其中一个 LFS 文件的下载按钮时,我收到 404 Page Not Found 错误。

在此处输入图像描述

Is this a bug of gitlab?这是 gitlab 的错误吗?

My gitlab version is 12.5.2.我的 gitlab 版本是 12.5.2。

I can successfully download the LFS files in server A.我可以成功下载服务器 A 中的 LFS 文件。

If I use git clone https://... to download the repository at server B, I get the following error:如果我使用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'

It looks like that something went wrong when exporting the repository from server A, or when importing into server B.从服务器 A 导出存储库或导入服务器 B 时,似乎出了点问题。

I've tried the answer in this post , but fail at git lfs pull command.在这篇文章中尝试了答案,但在git lfs pull命令失败。

The error message I get from git lfs pull is [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 The error message I get from git lfs pull is [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

I can only speak about Atlassian's bitbucket - not gitlab, but I guess the principle behavior is the same, since LFS is a common git extension.我只能说 Atlassian 的 bitbucket - 不是 gitlab,但我猜原理行为是相同的,因为 LFS 是常见的 git 扩展。 LFS objects will be stored in a separate area on the file system (for bitbucket eg /data/git-lfs/storage) whereas normal repositories are stored in a different place (bitbucket:/data/repositories) When a large file will be pushed to the repository, then the object itself will be stored in the git-lfs storage area, in the file in the repository itself only a pointer to the object using a SHA256 hash. LFS 对象将存储在文件系统上的一个单独区域(对于 bitbucket,例如 /data/git-lfs/storage),而普通存储库存储在不同的位置(bitbucket:/data/repositories)当一个大文件将被推送时到存储库,那么object本身会被存储在git-lfs存储区,在存储库本身的文件中只有一个指向object的指针使用SHA256 Z0800FC577294C34E0B28AD28394359 When you now export your repository, only the repository will be exported as it is, which means only the reference to your LFS object but not the object itself.当您现在导出存储库时,只会导出存储库原样,这意味着仅引用您的 LFS object 而不是 object 本身。

For a procedure how to properly migrate, just google like 'moving GIT lfs between hosts' or 'git lfs migrate example' and check if there are solutions described for gitlab有关如何正确迁移的过程,只需 google,例如'moving GIT lfs between hosts''git lfs migrate example' ,并检查是否有针对 gitlab 描述的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM