# Git LFS problem ? Error 255

**URL:** <https://discuss.huggingface.co/t/git-lfs-problem-error-255/68093>\
**Category:** Spaces\
**Created:** [January 5, 2024, 5:33pm UTC](https://discuss.huggingface.co/t/git-lfs-problem-error-255/68093 "2024-01-05T17:33:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaijobuAI](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@DaijobuAI](https://discuss.huggingface.co/u/DaijobuAI)\
**Post date:** [January 5, 2024, 5:33pm UTC](https://discuss.huggingface.co/t/git-lfs-problem-error-255/68093/1 "2024-01-05T17:33:32Z")

</div>

Dear all,

I’m encountering problems in pushing my model.pkl on my space.

Here is the error message after I tried push.git

> batchrequest: [git@hf.co](mailto:git@hf.co): Permission denied (publickey).: exit status 255  
> Uploading LFS objects: 0% (0/1), 0 B | 0 B/s, done.  
> error: failed to push some refs to '[hf.co](http://hf.co):spaces/DaijobuAI/spaceName

I am using SSH authentification. If I try ssh -T [git@hf.co](mailto:git@hf.co), I’m authenticated without problem:

> Hi DaijobuAI, welcome to Hugging Face.

All my previous pushes (without the model) worked.

I tried this solution : [Git LFS fail for Spaces with Github Workflow - #7 by Clatonh](https://discuss.huggingface.co/t/git-lfs-fail-for-spaces-with-github-workflow/16642/7)  
The model.pkl file is removed and pushing works again. If I copy the file again, it fails again.

On the first try of pushing my model, I got this error:

> Remote “origin” does not support the Git LFS locking API. Consider disabling it with:  
> $ git config lfs.[https://hf.co/spaces/DaijobuAI/spaceName.git/info/lfs.locksverify](https://hf.co/spaces/DaijobuAI/spaceName.git/info/lfs.locksverify) false

And I run the command.

Here are the other commands I tried:

> $ git lfs track .\model.pkl  
> “model.pkl” already supported
> 
> $ git lfs install  
> Updated Git hooks.  
> Git LFS initialized.

I also tried to restart from scratch with a fresh space/depo.

The file is about 110M, I am using VSCode on Windows 11 and the commands are run in VSCode Terminal. I updated Git to its latest version (2.43.0).

Any clue to help me ?

Thanks !

Daij

_Edited to sanitize_

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [January 5, 2024, 7:09pm UTC](https://discuss.huggingface.co/t/git-lfs-problem-error-255/68093/2 "2024-01-05T19:09:47Z")

</div>

hi @DaijobuAI ,  
Please double check if you haven’t committed the `.pkl` file to your git repot without LFS, this is a very common error.

---

<div class="post-metadata">

**Author:** ![DaijobuAI](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@DaijobuAI](https://discuss.huggingface.co/u/DaijobuAI)\
**Post date:** [January 6, 2024, 10:28am UTC](https://discuss.huggingface.co/t/git-lfs-problem-error-255/68093/4 "2024-01-06T10:28:14Z")

</div>

Hi Radames,

Thanks for your help !

The .pkl file is commited with LFS. Here is the` git show` response

> commit 9f86def6ed8c75e55f12b8fadd7c0261dc292f7d (HEAD → main)  
> Author: gotDaijobu [141064187+gotDaijobu@users.noreply.github.com](mailto:141064187+gotDaijobu@users.noreply.github.com)  
> Date: Fri Jan 5 18:20:51 2024 +0100
> 
> ```
> model
> 
> ```
> 
> diff --git a/model.pkl b/model.pkl  
> new file mode 100644  
> index 0000000…19010b0  
> — /dev/null  
> +++ b/model.pkl  
> @@ -0,0 +1,3 @@  
> +version http[s]://git-lfs.github.com/spec/v1  
> +oid sha256:2a62e5f45a23cb41bcfbad5d08f3affabb120842d5b66f9afc429a4ac691d91b  
> +size 114828705

Also, the response to` git-lfs env`

> Endpoint=[https://hf.co/spaces/DaijobuAI/spaceName.git/info/lfs](https://hf.co/spaces/DaijobuAI/spaceName.git/info/lfs) (auth=basic)  
> [SSH=git@hf.co](mailto:SSH=git@hf.co):spaces/DaijobuAI/spaceName  
> LocalWorkingDir=C:\Sites\spaceName  
> LocalGitDir=C:\Sites\spaceName.git  
> LocalGitStorageDir=C:\Sites\spaceName.git  
> LocalMediaDir=C:\Sites\spaceName.git\lfs\objects  
> LocalReferenceDirs=  
> TempDir=C:\Sites\spaceName.git\lfs\tmp  
> ConcurrentTransfers=8  
> TusTransfers=false  
> BasicTransfersOnly=false  
> SkipDownloadErrors=false  
> FetchRecentAlways=false  
> FetchRecentRefsDays=7  
> FetchRecentCommitsDays=0  
> FetchRecentRefsIncludeRemotes=true  
> PruneOffsetDays=3  
> PruneVerifyRemoteAlways=false  
> PruneRemoteName=origin  
> LfsStorageDir=C:\Sites\spaceName.git\lfs  
> AccessDownload=basic  
> AccessUpload=basic  
> DownloadTransfers=basic,lfs-standalone-file,ssh  
> UploadTransfers=basic,lfs-standalone-file,ssh  
> GIT\_LFS\_PATH=C:\Program Files\Git LFS  
> GIT\_ASKPASS=c:\Users\DaijobuAI\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\git\dist\askpass.sh  
> git config filter.lfs.process = “git-lfs filter-process”  
> git config filter.lfs.smudge = “git-lfs smudge – %f”  
> git config filter.lfs.clean = “git-lfs clean – %f”

It really seem that the authentification problem is only with git-lfs, but I can’t figure why. My guess - from a lot of readings in the past 2 days - is that it has something to do with the terminal’s ssh-agent but I can’t find how to fix it.

Alternatively, I tried to used spaces over https instead of ssh but I couldn’t make it work. In my config file, the remote should be:

> [remote “origin”]  
> url = https://\<USERNAME\>:\<TOKEN\>@huggingface.co/spaces/DaijobuAI/spaceName

Where Username is DaijobuAI and token an access token generated here : [Hugging Face – The AI community building the future.](https://huggingface.co/settings/tokens). No quotes.

Is that right ? When I do, I get a “Repository not found” error TT

Thanks again for your help.

Daij
