Score:0

How do I give "git lfs" access my self-hosted MinIO instance?

us flag

I have a MinIO server that I have set up as follows (docker compose):

services:
  minio:
    image: minio/minio
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      MINIO_ACCESS_KEY: <your-access-key>
      MINIO_SECRET_KEY: <your-secret-key>
    volumes:
      - ./data:/data
    command: server /data --console-address :9001

As far as I can see, so far so good. I have created a bucket with the name git-lfs, and I can test the thing as follows:

$ ~/Downloads/mc.exe ls my-minio
[2023-05-03 09:35:41 CEST]     0B git-lfs/

It seems as if I have access.

I have the following section in my git config:

[lfs]
        locksverify = false
        storage = minio
        url = http://10.0.10.196:9000/git-lfs
        accesskey = <your-access-key>
        secretkey = <your-secret-key>
        repositoryformatversion = 0
[filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge --skip -- %f
        process = git-lfs filter-process --skip
        required = true

The access key and secret key have been redacted from this post.

So... the trouble is, that whenever I try to push anything that should go onto the lfs server, I get the following response:

$ git push origin lfsstuff
Uploading LFS objects:   0% (0/6), 0 B | 0 B/s, done.
batch response: Client error: http://10.0.10.196:9000/git-lfs/objects/batch
error: failed to push some refs to 'git+ssh://my-git-server-here/~/Repositories/ProjectHere.git'

The bucket is still empty, and the response I get from http://10.0.10.196:9000/git-lfs/objects/batch is:

<Error>
  <script/>
  <Code>NoSuchKey</Code>
  <Message>The specified key does not exist.</Message>
  <Key>objects/batch</Key>
  <BucketName>git-lfs</BucketName>
  <Resource>/git-lfs/objects/batch</Resource>
  <RequestId>175BEAF87C025894</RequestId>
  <HostId>e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</HostId>
</Error>

So, clearly something is up with either the write access, or a missing key. But I don't know how to move on to debug or fixing it. From all the documentation I can find, this should already be working.. it just isn't. Any pointers you can give will be highly appreciated.

EDIT:

As larsks suggests, MinIO doesn't actually support the git lfs api.

I would love to put a compatible server in between, like outlined here (jasonwhite/rudolfs on github), but I can't seem to get that to work. I've added a question in rudolfs discussions on github.

pt flag
Is that a valid configuration? From my reading of the documentation, `lfs.url` needs to point at something that implements the LFS API. The "[Implementations](https://github.com/git-lfs/git-lfs/wiki/Implementations)" page lists a variety of LFS API implementations, including some that have S3 support.
Steinbitglis avatar
us flag
Good question! I don't know. I might have misplaced my trust in AI on this point. I really just want git lfs to be working in our self hosted environment, so I will need some server, and preferably one that is easy to spin up from a container or something.
Steinbitglis avatar
us flag
It seems completely on point. There needs to be another server in between that supports the api that git lfs requires.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.