# Spaces force push getting "Repository storage limit reached"

**URL:** <https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269>\
**Category:** Spaces\
**Created:** [December 9, 2024, 10:18pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269 "2024-12-09T22:18:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlthome](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/carlthome/32/31253_2.png) [@carlthome](https://discuss.huggingface.co/u/carlthome)\
**Post date:** [December 9, 2024, 10:18pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/1 "2024-12-09T22:18:59Z")

</div>

I have a Hugging Face Spaces app that I deploy to via GitHub Actions ([as per the documentation](https://huggingface.co/docs/hub/spaces-github-actions)) which contains a few example data of ~100 MB. I do a clean force push every time so there’s only a single commit on the Spaces repo. However, recently I started getting failing pushes. I assume this is because the LFS tracked assets are duplicated every force push, and not garbage collected internally. How can I repair this?

```auto
Uploading LFS objects: 0% (0/1), 0 B | 0 B/s, done.
batch response: Repository storage limit reached (Max: 1 GB)

```

---

<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:** [December 10, 2024, 1:03am UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/2 "2024-12-10T01:03:46Z")

</div>

At the moment, the solution is unknown, but it seems that deleting large files in Spaces may be able to avoid the problem in some cases.

> [@Freeing memory of my space](https://discuss.huggingface.co/t/freeing-memory-of-my-space/128894):
>
> Hi I am getting the error: Repository storage limit reached (Max: 1 GB) So I want to delete some files from the space but the platform is not allowing me… Could someone help me to delete the files please? Thanks Rosa

---

<div class="post-metadata">

**Author:** ![carlthome](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/carlthome/32/31253_2.png) [@carlthome](https://discuss.huggingface.co/u/carlthome)\
**Post date:** [December 10, 2024, 12:54pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/3 "2024-12-10T12:54:13Z")

</div>

> deleting large files in Spaces

This sounds good! I’m not finding how to do that however since the git commit history is clean and only contains a few MBs of assets.

---

<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:** [December 10, 2024, 12:57pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/4 "2024-12-10T12:57:49Z")

</div>

If that’s the case, the cause is different…🤔  
To be honest, I think this is more like a bug than a restriction, so the conditions for it to occur are not certain.  
There have been quite a few reports on HF Discord and in the forums, so I think it will be dealt with eventually…

Speaking of which, I don’t know if it’s related or not, but there’s been a bug for a while now where the upload process crashes when you try to upload a 0-byte file.

---

<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:** [January 4, 2025, 5:00pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/5 "2025-01-04T17:00:56Z")

</div>

> [@John6666](#):
>
> e solution is unknown, but it seems that deleting large files in Spaces may be able to avoid the problem in some cases.

Facing the same issue with my space again: [Image Matching Webui - a Hugging Face Space by Realcat](https://huggingface.co/spaces/Realcat/image-matching-webui). I made some minor changes, but the `storage limit` error occurred

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/4/7/47dee2a2f0658d37595a29b271e97fe7dfa07b11.png)

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

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/9/9/995bb610d10b940d8b6d98f9e2239d47b7241fb2.png)

---

<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:** [January 4, 2025, 5:07pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/6 "2025-01-04T17:07:29Z")

</div>

Unlike the previous bug, that one is probably a new specification. There has been no major announcement from HF, so it’s hard to say for sure…

> <https://github.com/huggingface/huggingface_hub/issues/2693#issuecomment-2520380926>
>
> \### Describe the bug
> 
> from HF Forum:
> https://discuss.huggingface.co/t/upload-…large-folder-issue-with-uploading-to-spaces/129326
> 
> If you run \`upload\_large\_folder()\` with a non-existent \`space\`, you will get an error from \`create\_repo()\`. This is because \[\`create\_repo\`()'s \`space\_sdk\` is \`optional\`, but if it is not there, an error will occur\](https://github.com/huggingface/huggingface\_hub/blob/v0.26.3/src/huggingface\_hub/hf\_api.py#L3478).
> 
> https://github.com/huggingface/huggingface\_hub/blob/v0.26.3/src/huggingface\_hub/\_upload\_large\_folder.py#L92
> 
> \### Reproduction
> 
> HF\_TOKEN = "hf\_\*\*\*\*\*\*\*\*\*"
> from huggingface\_hub import HfApi
> api = HfApi(token=HF\_TOKEN)
> api.upload\_large\_folder("John6666/lftest", folder\_path="test\_folder", repo\_type="space", private=True)
> 
> 
> \### Logs
> 
> \`\`\`shell
> File "w:\\TEMP\\test\\upload\_large\_folder\_test.py", line 4, in \<module\>
> api.upload\_large\_folder("John6666/lftest", folder\_path="test\_folder", repo\_type="space", private=True)
> File "c:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\huggingface\_hub\\hf\_api.py", line 5473, in upload\_large\_folder
> return upload\_large\_folder\_internal(
> File "c:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\huggingface\_hub\\\_upload\_large\_folder.py", line 92, in upload\_large\_folder\_internal
> repo\_url = api.create\_repo(repo\_id=repo\_id, repo\_type=repo\_type, private=private, exist\_ok=True)
> File "c:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\huggingface\_hub\\utils\\\_validators.py", line 114, in \_inner\_fn
> return fn(\*args, \*\*kwargs)
> File "c:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\huggingface\_hub\\hf\_api.py", line 3479, in create\_repo
> raise ValueError(
> ValueError: No space\_sdk provided. \`create\_repo\` expects space\_sdk to be one of \['gradio', 'streamlit', 'docker', 'static'\] when repo\_type is 'space'\`
> \`\`\`
> 
> 
> \### System info
> 
> \`\`\`shell
> \- huggingface\_hub version: 0.26.2
> \- Platform: Windows-10-10.0.19045-SP0
> \- Python version: 3.9.13
> \- Running in iPython ?: No
> \- Running in notebook ?: No
> \- Running in Google Colab ?: No
> \- Running in Google Colab Enterprise ?: No
> \- Token path ?: w:\\hf\\misc\\token
> \- Has saved token ?: False
> \- Configured git credential helpers: manager
> \- FastAI: N/A
> \- Tensorflow: N/A
> \- Torch: 2.4.0+cu124
> \- Jinja2: 3.1.4
> \- Graphviz: N/A
> \- keras: N/A
> \- Pydot: N/A
> \- Pillow: 11.0.0
> \- hf\_transfer: N/A
> \- gradio: 4.44.1
> \- tensorboard: 2.6.2.2
> \- numpy: 1.23.5
> \- pydantic: 2.8.2
> \- aiohttp: 3.9.5
> \- ENDPOINT: https://huggingface.co
> \- HF\_HUB\_CACHE: w:\\hf\\misc\\hub
> \- HF\_ASSETS\_CACHE: w:\\hf\\misc\\assets
> \- HF\_TOKEN\_PATH: w:\\hf\\misc\\token
> \- HF\_STORED\_TOKENS\_PATH: w:\\hf\\misc\\stored\_tokens
> \- HF\_HUB\_OFFLINE: False
> \- HF\_HUB\_DISABLE\_TELEMETRY: False
> \- HF\_HUB\_DISABLE\_PROGRESS\_BARS: None
> \- HF\_HUB\_DISABLE\_SYMLINKS\_WARNING: False
> \- HF\_HUB\_DISABLE\_EXPERIMENTAL\_WARNING: False
> \- HF\_HUB\_DISABLE\_IMPLICIT\_TOKEN: False
> \- HF\_HUB\_ENABLE\_HF\_TRANSFER: False
> \- HF\_HUB\_ETAG\_TIMEOUT: 10
> \- HF\_HUB\_DOWNLOAD\_TIMEOUT: 10
> \`\`\`

It doesn’t seem like there’s any point in putting large files in the git in Spaces. It seems better to download them after starting up.  
It’s a pain that the old spaces stop working without modification…🥶

---

<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:** [January 4, 2025, 11:03pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/7 "2025-01-04T23:03:00Z")

</div>

Yes, it’s frustrating. I’m not sure why, but a small codebase works fine:

> **[Realcat/imcui-dev at main](https://huggingface.co/spaces/Realcat/imcui-dev/tree/main)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

I am considering removing large files from the commit history in the original repository.

---

<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:** [January 12, 2025, 1:16pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/8 "2025-01-12T13:16:53Z")

</div>

@carlthome @John6666 I’ve finally found a solution: I deleted the LFS storage on Hugging Face, then re-pushed the changes. It worked! I encourage you both to give it a try.  
For some context, the size of the LFS storage went from 10.2GB down to 699MB.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/4/9/49ae696bc794a586ed35ed9b8cf7c58f57becf97.png)

---

<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:** [January 12, 2025, 1:24pm UTC](https://discuss.huggingface.co/t/spaces-force-push-getting-repository-storage-limit-reached/130269/9 "2025-01-12T13:24:13Z")

</div>

> ### anakin87 2025/01/09 20:44
> 
> Fixed in [LFS Storage Used not updated after calling `super_squash_history` · Issue #1566 · huggingface/hub-docs · GitHub](https://github.com/huggingface/hub-docs/issues/1566) Thank you everyone!

From Discord. I wonder if your symptoms were cured at the same time… Anyway, I’m glad it’s fixed!
