# Build error: Error while cloning repository

**URL:** <https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801>\
**Category:** Spaces\
**Created:** [October 24, 2024, 4:20pm UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801 "2024-10-24T16:20:23Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Realcat](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/realcat/32/29918_2.png) [@Realcat](https://discuss.huggingface.co/u/Realcat)\
**Post date:** [October 24, 2024, 4:20pm UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/1 "2024-10-24T16:20:23Z")

</div>

I’ve attempted to restart and perform a factory build multiple times, yet the `build error` persists. I’ve also researched and tried solutions from similar issues, but to no avail.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/f/2/f21c25530ea5bde8d3a15a9fd956b792628b9383.png)

Space link: [Image Matching Webui - a Hugging Face Space by Realcat](https://huggingface.co/spaces/Realcat/image-matching-webui)

Thanks for your help:)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 25, 2024, 12:49am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/2 "2024-10-25T00:49:28Z")

</div>

I deleted the Gradio version specification in the requiements.txt file and changed the Gradio version specification in the README.md file to 4.x. The behavior changed a bit, but the git clone still fails…  
I wonder if it has something to do with the fact that the result of Space’s automatic virus scan is **unsafe**? It might not be related.

Edit:  
I’ve looked at the commit history and there doesn’t appear to be any git-related changes in the past month. Something about a spec change in the HF space or a bug.  
I can’t tell **which git clone is failing** , which is a problem to work around.  
I commented out the Dockerfile stuff and it still happens.

I found similar symptoms, but they do not seem to be exactly the same situation.

> [@Error while cloning Space repository - No Build Logs](https://discuss.huggingface.co/t/error-while-cloning-space-repository-no-build-logs/19221):
>
> Hi, I’ve seen this post [Error while cloning Space repository](https://discuss.huggingface.co/t/error-while-cloning-space-repository/16179) and wanted to check if I am experiencing a server error or if I’ve done something wrong. My app was working a few days ago, but when I went to share it with someone I encountered a build error (see below). There are no Build Logs or I’d provide those as well. Any help or guidance would be appreciated.

---

<div class="post-metadata">

**Author:** ![Realcat](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/realcat/32/29918_2.png) [@Realcat](https://discuss.huggingface.co/u/Realcat)\
**Post date:** [October 25, 2024, 10:52am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/3 "2024-10-25T10:52:20Z")

</div>

Thank you for the suggestions. I tried them, but they still aren’t working.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 25, 2024, 11:22am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/4 "2024-10-25T11:22:50Z")

</div>

This is a very troublesome error, I can only get a **“503”** in **Dev mode** , I tried moving it to Zero GPU space and got a build error with no information.  
You might want to ask the staff on the HF Discord.

> [@Join the Hugging Face Discord!](https://discuss.huggingface.co/t/join-the-hugging-face-discord/11263/19):
>
> Hey @John6666 @mmty ! hugs Feel free to try [this link](https://discord.gg/hugging-face-879548962464493619), or alternatively, you can try searching hugging face within Discord. Let me know if it works!

In the case of these strange errors, the cause is usually that something is wrong with the Spaces-related settings or server settings. The user can only work around it by using a roundabout way, not a solution. However, if the error message does not provide this much information, there is no way to work around it…  
Usually error messages are not meant to harass, but to debug…

My guess is that this error is not due to any recent changes you have made to Spaces, but that you got caught up in some change on the HF side. You probably can’t get around it without changing something fundamentally.  
There are plenty of Spaces that use Dockerfile or github resources, so that’s not the only cause. I really don’t know.

---

<div class="post-metadata">

**Author:** ![Realcat](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/realcat/32/29918_2.png) [@Realcat](https://discuss.huggingface.co/u/Realcat)\
**Post date:** [October 25, 2024, 4:05pm UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/5 "2024-10-25T16:05:15Z")

</div>

Thank you very much for your response! I am at my wit’s end and am currently trying to reach out to HF staff for assistance.

---

<div class="post-metadata">

**Author:** ![Realcat](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/realcat/32/29918_2.png) [@Realcat](https://discuss.huggingface.co/u/Realcat)\
**Post date:** [October 26, 2024, 3:59am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/6 "2024-10-26T03:59:07Z")

</div>

Update: I think the issue might be the large LFS files in my original space: [Image Matching Webui - a Hugging Face Space by Realcat](https://huggingface.co/spaces/Realcat/image-matching-webui)

I created a new space with minimal requirements, and it builds successfully:

> **[Imatchui - a Hugging Face Space by Realcat](https://huggingface.co/spaces/Realcat/imatchui)**
>
> Discover amazing ML apps made by the community

But still unsure what to do with the old space…

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 26, 2024, 4:24am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/7 "2024-10-26T04:24:50Z")

</div>

CPU space storage is 50 GB, so large files can cause capacity errors. But in that case, of course, the disk space error will show up first.  
To begin with, this is crashing before the requiements.txt and others are referenced…even if you write a git lfs in packages.txt, the program is not going to download the file. I guess that’s why it’s not going that far.

I guess a workaround would be to **put the large files in the model repo or dataset repo and download them when needed** , but that’s a lot of work if they are in a deep path. If the symptom is this, it’s 90% likely a bug in the Spaces git lfs. I’ve joined Discord too, so I’ll report it there when I get a chance.

---

<div class="post-metadata">

**Author:** ![Realcat](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/realcat/32/29918_2.png) [@Realcat](https://discuss.huggingface.co/u/Realcat)\
**Post date:** [October 26, 2024, 4:49am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/8 "2024-10-26T04:49:10Z")

</div>

Yep, I’m planning to move the large `third_party` and `datasets` to Hugging Face models and datasets. It’s a smart way to keep the space small.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 26, 2024, 4:55am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/9 "2024-10-26T04:55:03Z")

</div>

If it’s a model or dataset repo, you can upload a 50GB file up to 300GB per repo, or even more than 300GB if you get permission, although I don’t know how. And while Spaces storage is slow, model and repo storage is fast. There is no way not to use this. I can’t not use it… but it requires programming… yay more work!

---

<div class="post-metadata">

**Author:** ![Realcat](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/realcat/32/29918_2.png) [@Realcat](https://discuss.huggingface.co/u/Realcat)\
**Post date:** [October 26, 2024, 6:20pm UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/10 "2024-10-26T18:20:21Z")

</div>

Update: Resolved (might be buggy) by moving the large LFS model files from space storage to Huggingface’s model hub for downloads. Keeping the space compact is the key to successful builds.

> **[Image Matching Webui - a Hugging Face Space by Realcat](https://huggingface.co/spaces/Realcat/image-matching-webui)**
>
> Discover amazing ML apps made by the community

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [October 27, 2024, 12:26am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/11 "2024-10-27T00:26:07Z")

</div>

Glad to see it’s working now, but the HF bug is still there…  
Oh well, they’ll fix it eventually.

---

<div class="post-metadata">

**Author:** ![basso4](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@basso4](https://discuss.huggingface.co/u/basso4)\
**Post date:** [November 3, 2024, 6:28pm UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/12 "2024-11-03T18:28:29Z")

</div>

I have the same problem, but my model requires a lot of different model checkpoints. Is there any solution other than hosting on Huggingface’s model hub for download? Thanks.  
[https://huggingface.co/spaces/basso4/FPT\_VTON/tree/main/ckpt](https://huggingface.co/spaces/basso4/FPT_VTON/tree/main/ckpt)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [November 4, 2024, 12:45am UTC](https://discuss.huggingface.co/t/build-error-error-while-cloning-repository/113801/13 "2024-11-04T00:45:57Z")

</div>

None so far. There are at least four more in progress at the same time, along with this issue.

> **[Discord - Group Chat That’s All Fun & Games](https://discord.com/channels/879548962464493619/1295847667515129877)**
>
> Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.
