首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Artifactory未遵循git-lfs协议

Artifactory未遵循git-lfs协议
EN

Stack Overflow用户
提问于 2019-12-15 01:56:00
回答 1查看 460关注 0票数 0

我正在努力提高artifactory上git-lfs的可靠性,并分析了客户端和Artifactory之间的协议。

下载对象的第一步是发送api命令。{download,{objectID,size},reply [{OID,size,auth,action[]},{}]问题是操作是一个零长度数组,预期的“下载”信息不在那里。

我跟踪了一个简单的lfs克隆。我也会改名来保护有罪的人。

问题是"_links“新协议使用"actions”

https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md

代码语言:javascript
运行
复制
"objects" : [ {
    "oid" : "8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b",
    "size" : 189,
    "_links" : {
      "download" : {
        "href" : "https://server.org/artifactory/repo/objects/8b/4d/8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b",
        "header" : {
          "Authorization" : "Basic c3lzX21pZ2NpbHg6QVA1NVhjRWExeWhBVGZVRUxoeEpHcGplVktY"
        }
      }
    }
  }

@

代码语言:javascript
运行
复制
 GIT_TRACE=1 GIT_CURL_VERBOSE=1 git lfs clone git@github.com:svsintel/testlfs.git
12:28:42.951804 git.c:576               trace: exec: git-lfs clone git@github.com:svsintel/testlfs.git
12:28:42.951860 run-command.c:646       trace: run_command: git-lfs clone git@github.com:svsintel/testlfs.git
12:28:42.957381 trace git-lfs: run_command: 'git' version
WARNING: 'git lfs clone' is deprecated and will not be updated
          with new flags from 'git clone'

'git clone' has been updated in upstream Git to have comparable
speeds to 'git lfs clone'.
Cloning into 'testlfs'...
X11 forwarding request failed on channel 0
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 9 (delta 0), reused 6 (delta 0), pack-reused 0
Receiving objects: 100% (9/9), done.
12:28:43.728998 trace git-lfs: run_command: 'git' config -l -f /home/savages/DEVEL/testlfs/.lfsconfig
12:28:43.730944 trace git-lfs: run_command: 'git' config -l
12:28:43.733209 trace git-lfs: run_command: '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
12:28:43.735365 trace git-lfs: run_command: '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
12:28:43.737654 trace git-lfs: tq: running as batched queue, batch size of 100
12:28:43.738479 trace git-lfs: run_command: git cat-file --batch
12:28:43.741076 trace git-lfs: fetch javaguidelink.png [8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b]
12:28:43.741198 trace git-lfs: tq: sending batch of size 1
Git LFS: (0 of 1 files) 0 B / 189 B                                            12:28:43.741587 trace git-lfs: api: batch 1 files
12:28:43.741724 trace git-lfs: HTTP: POST https://server.org/repo/objects/batch
> POST /artifactory/api/lfs/repo/objects/batch HTTP/1.1
> Host: server.org
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Content-Length: 122
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.3.4 (GitHub; linux amd64; go 1.8.3)
> 
{"operation":"download","objects":[{"oid":"8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b","size":189}]}12:28:44.552717 trace git-lfs: HTTP: 401


< HTTP/1.1 401 Unauthorized
< Transfer-Encoding: chunked
< Content-Type: application/json
< Date: Tue, 17 Dec 2019 20:28:44 GMT
< Server: Artifactory/5.3.0
< Set-Cookie: BIGipServerlbauto-af01p-ir-https=!lwwF2ZPxFqh78i9ZXUYuw/jzKcOV9bdWzE0rDvzrv7YDwaHF/aePpE4m4YlV0HLmvlOn3f4in6Ea; path=/; Httponly; Secure
< Www-Authenticate: Basic realm="Artifactory Realm"
< X-Artifactory-Id: a4228f8f67d17308ce2e6929fb0d1c96b8fc4fc0
< X-Artifactory-Node-Id: irvapp049
< 
12:28:44.552948 trace git-lfs: HTTP: {
  "errors" : [ {
    "status" : 401,
    "message" : "Authorization Required"
  } ]
}
{
  "errors" : [ {
    "status" : 401,
    "message" : "Authorization Required"
  } ]
}12:28:44.553053 trace git-lfs: setting repository access to basic
12:28:44.553065 trace git-lfs: run_command: 'git' config --replace-all lfs.https://server.org/artifactory/api/lfs/repo.access basic
12:28:44.555768 trace git-lfs: api: http response indicates "basic" authentication. Resubmitting...
12:28:44.555852 trace git-lfs: creds: git credential fill ("https", "server.org", "artifactory/api/lfs/repo")
12:28:44.562949 trace git-lfs: Filled credentials for https://server.org/artifactory/api/lfs/repo
12:28:44.563100 trace git-lfs: HTTP: POST https://server.org/repo/objects/batch
> POST /artifactory/api/lfs/repo/objects/batch HTTP/1.1
> Host: server.org
> Accept: application/vnd.git-lfs+json; charset=utf-8
> Authorization: Basic * * * * *
> Content-Length: 122
> Content-Type: application/vnd.git-lfs+json; charset=utf-8
> User-Agent: git-lfs/2.3.4 (GitHub; linux amd64; go 1.8.3)
> 
{"operation":"download","objects":[{"oid":"8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b","size":189}]}{"operation":"download","objects":[{"oid":"8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b","size":189}]}12:28:46.318344 trace git-lfs: HTTP: 200


< HTTP/1.1 200 OK
< Transfer-Encoding: chunked
< Content-Type: application/vnd.git-lfs+json
< Date: Tue, 17 Dec 2019 20:28:46 GMT
< Server: Artifactory/5.3.0
< Set-Cookie: BIGipServerlbauto-af01p-ir-https=!PuMWH2edbtitYCJZXUYuw/jzKcOV9b83tgCkdCyENMF11Shn6y8h8GdLZf7RA08ntnJe+hDmFL6BoA==; path=/; Httponly; Secure
< X-Artifactory-Id: a4228f8f67d17308ce2e6929fb0d1c96b8fc4fc0
< X-Artifactory-Node-Id: irvapp032
< 
12:28:46.518402 trace git-lfs: HTTP: {
  "objects" : [ {
    "oid" : "8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b",
    "size" : 189,
    "_links" : {
      "download" : {
        "href" : "https://server.org/repo/objects/8b/4d/8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b",
        "header" : {
          "Authorization" : "Basic c3lzX21pZ2NpbHg6QVA1NVhjRWExeWhBVGZVRUxoeEpHcGplVktY"
        }
      }
    }
  } ]
}
{
  "objects" : [ {
    "oid" : "8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b",
    "size" : 189,
    "_links" : {
      "download" : {
        "href" : "https://server.org/repo/objects/8b/4d/8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b",
        "header" : {
          "Authorization" : "Basic c3lzX21pZ2NpbHg6QVA1NVhjRWExeWhBVGZVRUxoeEpHcGplVktY"
        }
      }
    }
  } ]
}12:28:46.518635 trace git-lfs: tq: starting transfer adapter "basic"
Git LFS: (0 of 1 files) 0 B / 189 B                                            12:28:46.519344 trace git-lfs: HTTP: GET https://server.org/artifactory/repo/objects/8b/4d/8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b
> GET /artifactory/repo/objects/8b/4d/8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b HTTP/1.1
> Host: server.org
> Authorization: Basic * * * * *
> User-Agent: git-lfs/2.3.4 (GitHub; linux amd64; go 1.8.3)
> 
Git LFS: (0 of 1 files) 0 B / 189 B                                            12:28:47.326791 trace git-lfs: HTTP: 200

< HTTP/1.1 200 OK
< Content-Length: 189
< Accept-Ranges: bytes
< Content-Disposition: attachment; filename="8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b"; filename*=UTF-8''8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b
< Content-Type: application/octet-stream
< Date: Tue, 17 Dec 2019 20:28:47 GMT
< Etag: b0b31c0cbccf04819012d82385f3966ba0856d18
< Last-Modified: Fri, 02 Aug 2019 09:42:37 GMT
< Server: Artifactory/5.3.0
< Set-Cookie: BIGipServerlbauto-af01p-ir-https=!kfSG8soGK6fsAIdZXUYuw/jzKcOV9czEPoAj80t8OIgyLdw5+B9YrT0o6uFWA5Jp3HDyK32k00JB; path=/; Httponly; Secure
< X-Artifactory-Filename: 8b4d08d6b3a211d6bb09f636ebdfcdc88ade2f20bd0c011954929b4a65aec07b
< X-Artifactory-Id: a4228f8f67d17308ce2e6929fb0d1c96b8fc4fc0
< X-Artifactory-Node-Id: irvapp049
< X-Checksum-Md5: b36c320fa2845b3c75f95685474843c9
< X-Checksum-Sha1: b0b31c0cbccf04819012d82385f3966ba0856d18
< 
Git LFS: (1 of 1 files) 189 B / 189 B                                          
12:28:47.556210 trace git-lfs: Install hook: pre-push, force=false, path=/home/savages/DEVEL/testlfs/.git/hooks/pre-push, upgrading...
12:28:47.556810 trace git-lfs: Install hook: post-checkout, force=false, path=/home/savages/DEVEL/testlfs/.git/hooks/post-checkout, upgrading...
12:28:47.557303 trace git-lfs: Install hook: post-commit, force=false, path=/home/savages/DEVEL/testlfs/.git/hooks/post-commit, upgrading...
12:28:47.558058 trace git-lfs: Install hook: post-merge, force=false, path=/home/savages/DEVEL/testlfs/.git/hooks/post-merge, upgrading...
EN

回答 1

Stack Overflow用户

发布于 2021-07-17 02:45:24

Artifactory V3.9及以上版本支持gitLFS协议。

https://www.jfrog.com/confluence/display/JFROG/Git+LFS+Repositories

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59337693

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档