You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GitLab LFS环境下文件存在仍报File not found错误求助

Troubleshooting Git LFS "File Not Found" on GitLab Server During make test

Hey there! Let's walk through figuring out why your LFS-tracked file works locally but throws a "File not found" error when running make test on your GitLab server. Since local tests pass, this is almost definitely related to how Git LFS is set up or initialized on the server side. Here are the steps to check:

  • First, confirm Git LFS is installed on the GitLab server
    SSH into your server and run git lfs version. If you get a "command not found" error, you'll need to install Git LFS first. For example, on Ubuntu/Debian:

    sudo apt update && sudo apt install git-lfs
    

    On RHEL/CentOS:

    sudo yum install git-lfs
    

    After installation, run git lfs install to initialize it system-wide.

  • Pull LFS objects manually on the server
    Sometimes when cloning a repo on the server, Git doesn't automatically pull LFS files by default. Navigate to your project directory on the server and run:

    git lfs pull
    

    This will download all LFS-tracked files to the server. After running this, check if the missing file exists with ls path/to/your/file.

  • Check your GitLab CI/CD configuration (if using CI to run tests)
    If you're using GitLab's CI/CD pipeline to execute make test, you need to ensure the pipeline pulls LFS files before running tests. Add a step in your .gitlab-ci.yml to handle this:

    before_script:
      - git lfs pull
    

    Alternatively, use git lfs clone instead of the standard git clone when fetching the repo in your CI script.

  • Verify file path consistency
    Double-check that the file path referenced in your Makefile matches exactly with the path on the server. Operating systems like Linux are case-sensitive, so a path like ./assets/MyLargeFile.zip on your local machine might be ./assets/mylargefile.zip on the server if there was a case mismatch during commit. Use find . -name "your-filename.ext" on the server to locate the exact path.

  • Check if LFS objects are properly tracked and downloaded
    Run git lfs ls-files in your server's project directory. Look for your file—if it shows a - instead of a * next to the filename, that means the LFS object hasn't been downloaded. Re-run git lfs pull to fetch it, or check if the LFS object exists on your GitLab server (you mentioned it's downloadable, so this is less likely, but worth confirming).

Give these steps a try—chances are one of them will fix the "File not found" error. Let me know if you hit any snags!

内容的提问来源于stack exchange,提问作者kushal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 07:37:48