【问题标题】:git clone to NFS disk error: fatal: write error: Bad file descriptorgit clone to NFS 磁盘错误:致命:写入错误:文件描述符错误
【发布时间】:2018-09-10 14:41:43
【问题描述】:

我有一个NFS服务器,和几个主机共享一个磁盘(没有ssd缓存),当用户从我们的gitlab git clone到这个NFS磁盘时,总是出现这样的错误:

remote: Compressing objects: 100% (430/430), done.
fatal: write error: Bad file descriptor.61 MiB | 453.00 KiB/s     
fatal: index-pack failed

如果只有一个人 git clone 会成功,如果多人同时 git 会报错。 这是我们 NFS 服务器的配置:

/data/proj 192.168.1.0/24(rw,no_root_squash,sync,no_subtree_check)

这是主机挂载信息:

192.168.1.10:/data/proj on /proj type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.211,local_lock=none,addr=192.168.1.10)

我尝试像异步一样更改 NFS 服务器配置,但它不起作用,更改 .gitconfig 设置不起作用。 我认为这个问题更像是在 NFS-server 配置中,但我不知道如何解决它,请帮助!

【问题讨论】:

    标签: git clone nfs


    【解决方案1】:

    我认为您使用带有“同步”选项的导出文件配置 NFS 服务器。
    要修复它,也许可以尝试如下文件 /etc/exports:

    <<folder share nfs>> <<your network>> (rw,**async**)
    

    示例:/home/abc 172.33.32.0/255.255.224.0 (rw,async)

    在 Nfs 客户端上:重新挂载 nfs。

    【讨论】:

      【解决方案2】:

      我在 nfs 挂载上遇到了类似的 git 问题。但我收到了不同的错误消息:

      Cloning into 'tileserver-gl'...
      remote: Counting objects: 2179, done.
      remote: Compressing objects: 100% (813/813), done.
      remote: Total 2179 (delta 1357), reused 2179 (delta 1357)
      Receiving objects: 100% (2179/2179), 3.04 MiB | 22.72 MiB/s, done.
      fatal: premature end of pack file, 83 bytes missing
      warning: die() called many times. Recursion error or racy threaded death!
      fatal: premature end of pack file, 81 bytes missing
      fatal: index-pack failed
      

      修复实际上与 Cao Cự Bảo 的答案完全相反。解决方案是将sync 选项添加到/etc/fstab 的挂载选项中。

      添加后 git clone 按预期工作。

      【讨论】:

        【解决方案3】:

        检查您是否有对 git-repository 的写入权限。

        【讨论】:

        • 提问者说只有几个用户同时git clone才会出现问题,所以你的回答似乎无关紧要。此外,这只是一个评论,因此应该作为评论而不是答案发布。
        • 在问题中:If only one man git clone, it will be done, if many peoples git at the same time, will get errors 写访问不是问题。
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-03-25
        相关资源
        最近更新 更多