0

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.

Steinbitglis
  • 183
  • 1
  • 8
  • 1
    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. – larsks May 04 '23 at 11:49
  • 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 May 04 '23 at 12:00
  • It seems completely on point. There needs to be another server in between that supports the api that git lfs requires. – Steinbitglis May 04 '23 at 12:03

0 Answers0