Home
Support Forums

Remote "origin" does not support the LFS locking API. Consider disabling it

When I enable Netlify Large Media on my test site and try to git push I get the following error:

Remote "origin" does not support the LFS locking API. Consider disabling it with:
  $ git config lfs.https://[SITE_ID].netlify.com/.netlify/large-media.locksverify false
batch response: Expected json type, got: "text/plain; charset=utf-8"
Uploading LFS objects:   0% (0/1), 0 B | 0 B/s, done.
error: failed to push some refs to 'git@github.com:[ORG]/[REPO].git'

Here is a more detailed msg with GIT_CURL_VERBOSE=1:

14:22:36.566995 trace git-lfs: exec: git 'version'
14:22:36.611997 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
14:22:36.799008 trace git-lfs: exec: git 'config' '-l'
14:22:36.822009 trace git-lfs: exec: git 'config' '-l' '-f' 'path/to/.lfsconfig'
14:22:36.843010 trace git-lfs: pre-push: refs/heads/master [HASH] refs/heads/master [HASH]
14:22:38.002077 trace git-lfs: HTTP: POST https://[SITE_ID].netlify.com/.netlify/large-media/locks/verify
> POST /.netlify/large-media/locks/verify HTTP/1.1
> Host: [SITE_ID].netlify.com
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Content-Length: 36
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.9.2 (GitHub; windows amd64; go 1.12.7; git 0274d856)
>
{ "ref": { "name": "refs/heads/master" }}

14:22:38.234090 trace git-lfs: HTTP: 200


< HTTP/2.0 200 OK
< Content-Length: 1367
< Age: 1
< Cache-Control: public, max-age=0, must-revalidate
< Content-Type: text/plain; charset=utf-8
< Date: Thu, 05 Mar 2020 22:22:40 GMT
< Server: Netlify
< X-Bb-Proxy: https://lm.services.netlify.com/lfs/locks/verify
< X-Bb-Proxy-Version: v2
< X-Nf-Request-Id: ece0346c-c552-4138-af32-41e6b0844f7a-11882974
< X-Robots-Tag: noindex
<
Remote "origin" does not support the LFS locking API. Consider disabling it with:
  $ git config lfs.https://[SITE_ID].netlify.com/.netlify/large-media.locksverify false
14:22:38.236090 trace git-lfs: tq: running as batched queue, batch size of 100
14:22:38.237090 trace git-lfs: run_command: git rev-list --stdin --objects --not --remotes=origin --
14:22:38.295093 trace git-lfs: tq: sending batch of size 1
14:22:38.295093 trace git-lfs: api: batch 1 files
14:22:38.296093 trace git-lfs: HTTP: POST https://[SITE_ID].netlify.com/.netlify/large-media/objects/batch
> POST /.netlify/large-media/objects/batch HTTP/1.1
> Host: [SITE_ID].netlify.com
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Content-Length: 201
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.9.2 (GitHub; windows amd64; go 1.12.7; git 0274d856)
>
{
   "operation": "upload",
   "objects": [ 
      {
         "oid": [HASH],
         "size": [SIZE]
      }
   ],
   "transfers": [ "lfs-standalone-file", "basic" ],
   "ref": { "name": "refs/heads/master" }
}

14:22:38.410100 trace git-lfs: HTTP: 200

< HTTP/2.0 200 OK
< Content-Length: 1367
< Age: 0
< Cache-Control: public, max-age=0, must-revalidate
< Content-Type: text/plain; charset=utf-8
< Date: Thu, 05 Mar 2020 22:22:40 GMT
< Server: Netlify
< X-Bb-Proxy: https://lm.services.netlify.com/lfs/objects/batch
< X-Bb-Proxy-Version: v2
< X-Nf-Request-Id: ece0346c-c552-4138-af32-41e6b0844f7a-11882987
< X-Robots-Tag: noindex
<

Uploading LFS objects:   0% (0/1), 0 B | 0 B/s, done.
batch response: Expected json type, got: "text/plain; charset=utf-8"
error: failed to push some refs to 'git@github.com:[ORG[/[REPO].git'

I was wondering if disabling the lfs lock is an expected behavior. If so, I think it should be documented in the Netlify Large Media documents/guides.

Disabling the lfs lock by running the following command does work:

git config lfs.https://[SITE_ID].netlify.com/.netlify/large-media.locksverify false

Disabling the lfs lock by running the following command solves the issue:

git config lfs.https://[SITE_ID].netlify.com/.netlify/large-media.locksverify false

This is also mentioned here:

hi there, thanks for this! We’ll take a closer look at this. :muscle:

1 Like

Also looks I had to delete and recreate my site for the lfs lock config to take effect.
If I have the site already created and linked to my local repository with linked GitHub repo, and then I add the git config lfs. ... false I would still get errors. Although those errors don’t mention anything about lfs lock.

Sample errors when disabling lfs lock after the site had already been created and linked:

batch response: Expected json type, got: "text/plain; charset=utf-8"
error: failed to push some refs to 'git@github.com:[ORG[/[REPO].git'

Hi, @saw-mon_and_natalie, it would be great to better highlight that LFS locking isn’t supported by NLM

One of the things we consider with our documentation is how much information is too much information. It isn’t that this isn’t important information (it is), but that it is an edge case which most users won’t experience and so finding a place for it in the public documentation becomes more complicated.

I’m hoping to update the Netlify Large Media troubleshooting “common issue” topic with all that has been learned since it was written and I’ll be sure to highlight this there when I do.

Thanks @luke. I don’t think it would be an edge case relative to the NLM setup documentation section. Since this error would be experienced by anyone trying out #netlify-large-media-nlm.

Other suggestion would be to include

$ git config lfs.https://[SITE_ID].netlify.com/.netlify/large-media.locksverify false

as part of the netlify lm:setup command. This would eliminate the need to show the error on the first place or mentioning the LFS locking in the docs.

@saw-mon_and_natalie, thank you for finding the solution for this error and sharing your knowledge here in the community.

In our experience very few people use the LFS locking feature. Because of this, details about LFS locking will not be relevant to most users of the feature and are a potential source of confusion for most people (as they won’t apply to them).

We won’t be adding this to the documentation pages at this time for the reason above. If the frequency of LFS locking use were to change (and LFS locking use were to become the norm instead of the exception), we will revisit this decision.

These considerations regarding the LFS locking feature and Netlify Large Media are now documented in this community topic. This topic is searchable so there is now documentation of a sort - documentation which has been created primarily by you if I’m being honest. :+1:

Your suggestions and solutions are detailed, helpfu,l and clear. Thanks to you all that information can be found here now. This is topic the first result returned if you search community for that error (or search Google for that error + “netlify”).

I hope it is clear that we do think this information is important and why we are not updating our documentation at this time (even though it is important).

1 Like