Support Forums

Not able to clone repository due to infinite 401 error loop

Hi there,

I recently added LFS to my website. Everything went well until I got Git synchronisation errors. I couldn’t pull any changes and therefor I removed the Git repository and cloned it again. Now I got syncing problems again. It seems to be stuck at the LFS part again:

10:49:11.668626 trace git-lfs: HTTP: POST https://65146f80-0dc6-46a2-a52d-24cb1c381e70.netlify.com/.netlify/large-media/objects/batch
10:49:11.809704 trace git-lfs: HTTP: 401
10:49:11.810461 trace git-lfs: HTTP: {“code”:401,“msg”:“Expected the Base64 encoded string”}

I tried “netlify logout” and “netlify login”, re-entering the credentials after removing them from the Windows Credential manager but nothing seems to work.

Any thoughts on this? Thanks in advance!


Hi @marcveens, have you already gone through the debugging in [Common Issue] Troubleshooting your Netlify Large Media Configuration ? if you have, please let us know what your results were. Thanks.

I thought I followed every step of the requirements, but it appears to be fixed by running netlify plugins:install netlify-lm-plugin and netlify lm:install (again?). I seemed that there was something wrong with the Netlify’s Git credential helper. Anyway, it works now. Thanks for your time @futuregerald!


Ok I might have cheered a little too early. It still seems I cannot push to the remote origin.

The output of the netlify lm:info command:
√ Checking Git version [2.20.1.windows.1]
√ Checking Git LFS version [2.6.1]
√ Checking Git LFS filters
√ Checking Netlify’s Git Credentials version [0.1.8]

And the output of GIT_TRACE=1 GIT_CURL_VERBOSE=1 git lfs push --all origin:
08:38:10.871556 trace git-lfs: Filled credentials for https://65146f80-0dc6-46a2-a52d-24cb1c381e70.netlify.com/.netlify/large-media
08:38:10.877557 trace git-lfs: HTTP: POST https://65146f80-0dc6-46a2-a52d-24cb1c381e70.netlify.com/.netlify/large-media/locks/verify
> POST /.netlify/large-media/locks/verify HTTP/1.1
> Host: 65146f80-0dc6-46a2-a52d-24cb1c381e70.netlify.com
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Authorization: Basic * * * * *
> Content-Length: 46
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.6.1 (GitHub; windows amd64; go 1.11.1; git dc072c3e)
08:38:11.173556 trace git-lfs: HTTP: 401

< HTTP/1.1 401 Unauthorized
< Content-Length: 55
< Age: 0
< Alt-Svc: clear
< Connection: keep-alive
< Content-Type: application/json
< Date: Thu, 19 Dec 2019 07:38:11 GMT
< Server: Netlify
< Vary: Origin
< Via: 1.1 google
< X-Nf-Request-Id: eab56a74-8760-4801-b02c-af4b886e9cd1-1256238
08:38:11.173556 trace git-lfs: HTTP: {“code”:401,“msg”:“Expected the Base64 encoded string”}
{“code”:401,“msg”:“Expected the Base64 encoded string”}
08:38:11.203570 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
08:38:11.205557 git.c:418 trace: built-in: git credential reject
08:38:11.205557 run-command.c:643 trace: run_command: ‘git credential-manager erase’
08:38:11.365563 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
08:38:11.366558 git.c:675 trace: exec: git-credential-manager erase
08:38:11.366558 run-command.c:643 trace: run_command: git-credential-manager erase
08:38:11.595588 run-command.c:643 trace: run_command: ‘git credential-netlify erase’
08:38:11.744556 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
08:38:11.765571 git.c:675 trace: exec: git-credential-netlify erase
08:38:11.765571 run-command.c:643 trace: run_command: git-credential-netlify erase
time=“2019-12-19T08:38:11+01:00” level=debug msg=“Initializing Netlify credential helper” args="[git-credential-netlify erase]"
08:38:11.816606 trace git-lfs: api: http response indicates “basic” authentication. Resubmitting…
08:38:11.816606 trace git-lfs: creds: git credential fill (“https”, “65146f80-0dc6-46a2-a52d-24cb1c381e70.netlify.com”, “”)
08:38:11.844583 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
08:38:11.845582 git.c:418 trace: built-in: git credential fill
08:38:11.846583 run-command.c:643 trace: run_command: ‘git credential-manager get’
08:38:12.010591 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
08:38:12.012580 git.c:675 trace: exec: git-credential-manager get
08:38:12.012580 run-command.c:643 trace: run_command: git-credential-manager get

And after that, it starts the same thing over again :frowning:. There seems to be something wrong while authenticating, but I can’t seem to figure out what it is exactly. Btw it’s correct that currently no LFS files are stated in the POST request, since I only changed some other files.

Was this repo previously linked to another Netlify site? When you first setup netlify large media was it using the same netlify user account and repo as you’re trying to use now?