Skip to content

Unable to push with different server hostnames and NTLM authentication #3351

Closed as not planned

Description

@MarkKharitonov

This post contains all the details -
https://stackoverflow.com/questions/53054297/cannot-push-to-server-with-git-lfs

Enabling git trace outputs the following:

16:06:24.410492 trace git-lfs: HTTP: POST http://tfsserver.xyz.com:8080/tfs/defaultcollection/code/_git/xyz.git/info/lfs/objects/batch
16:06:24.423530 trace git-lfs: HTTP: 200
16:06:24.423530 trace git-lfs: HTTP: {"objects":[{"oid":"a081dde9b4f42e7f9e185d4b05cf61e050d202f460a69fe77a6aa334e32afbf7","size":216552,"actions":{"upload":{"href":"http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/a081dde9b4f42e7f9e185d4b05cf61e050d202f460a69fe77a6aa334e32afbf7","header":{"Accept":"application/vnd.git-lfs","Transfer-Encoding":"chunked"}}}},{"oid":"9856362d92389afdb03113d489596be5ac80dfff2a0a57ff415aa60316940c55","size":216376,"actions":{"upload":{"href":"http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/9856362d92389afdb03113d489596be5ac80dfff2a0a57ff415aa60316940c55","header":{"Accept":"application/vnd.git-lfs","Transfer-Encoding":"chunked"}}}},{"oid":"f97a37cbcb6305dfce72b2a6acc3459306ed71a8e12549d51d7aadfa5af5fc32","size":101344,"actions":{"upload":{"href":"http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/f97a37cbcb6305dfce72b2a6acc3459306ed71a8e12549d51d7aadfa5af5fc32","header":{"Accept":"application/vnd.git-lfs","Transfer-Encoding":"chunked"}}}}]}
16:06:24.426495 trace git-lfs: tq: starting transfer adapter "basic"
16:06:24.427495 trace git-lfs: creds: git credential cache ("http", "tfsserver.xyz.com:8080", "")
16:06:24.428496 trace git-lfs: HTTP: PUT http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/a081dde9b4f42e7f9e185d4b05cf61e050d202f460a69fe77a6aa334e32afbf7
16:06:24.437001 trace git-lfs: HTTP: 401
16:06:24.442005 trace git-lfs: tq: refusing to retry "a081dde9b4f42e7f9e185d4b05cf61e050d202f460a69fe77a6aa334e32afbf7", too many retries (8)
16:06:24.442005 trace git-lfs: creds: git credential cache ("http", "tfsserver.xyz.com:8080", "")
16:06:24.443506 trace git-lfs: HTTP: PUT http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/9856362d92389afdb03113d489596be5ac80dfff2a0a57ff415aa60316940c55
16:06:24.450012 trace git-lfs: HTTP: 401
16:06:24.450511 trace git-lfs: HTTP: PUT http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/9856362d92389afdb03113d489596be5ac80dfff2a0a57ff415aa60316940c55
16:06:24.457516 trace git-lfs: HTTP: 401
16:06:24.457516 trace git-lfs: HTTP: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Not Authorized</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Not Authorized</h2>
<hr><p>HTTP Error 401. The requested resource requires user authentication.</p>
</BODY></HTML>

16:06:24.459017 trace git-lfs: tq: refusing to retry "9856362d92389afdb03113d489596be5ac80dfff2a0a57ff415aa60316940c55", too many retries (8)
16:06:24.459017 trace git-lfs: creds: git credential cache ("http", "tfsserver.xyz.com:8080", "")
16:06:24.461018 trace git-lfs: HTTP: PUT http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/f97a37cbcb6305dfce72b2a6acc3459306ed71a8e12549d51d7aadfa5af5fc32
16:06:24.466023 trace git-lfs: HTTP: 401
16:06:24.466524 trace git-lfs: HTTP: PUT http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/f97a37cbcb6305dfce72b2a6acc3459306ed71a8e12549d51d7aadfa5af5fc32
16:06:24.471025 trace git-lfs: tq: refusing to retry "f97a37cbcb6305dfce72b2a6acc3459306ed71a8e12549d51d7aadfa5af5fc32", too many retries (8)
Uploading LFS objects:   0% (0/3), 8.4 MB | 0 B/s, done
LFS: seek D:\xyz\code\.git\lfs\objects\a0\81\a081dde9b4f42e7f9e185d4b05cf61e050d202f460a69fe77a6aa334e32afbf7: file already closed
LFS: seek D:\xyz\code\.git\lfs\objects\98\56\9856362d92389afdb03113d489596be5ac80dfff2a0a57ff415aa60316940c55: file already closed
LFS: Put http://tfsserver:8080/tfs/DefaultCollection/code/_git/xyz/info/lfs/objects/f97a37cbcb6305dfce72b2a6acc3459306ed71a8e12549d51d7aadfa5af5fc32: read D:\xyz\code\.git\lfs\objects\f9\7a\f97a37cbcb6305dfce72b2a6acc3459306ed71a8e12549d51d7aadfa5af5fc32: file already closed
error: failed to push some refs to 'http://tfsserver.xyz.com:8080/tfs/defaultcollection/code/_git/xyz/'

Activity

  1. bk2204 commented on Oct 31, 2018

    @bk2204
    Member

    Hey, sorry you're having trouble. Let me see if I can help out.

    It looks like you're using a credential helper, so can you run the following commands, and make sure they output the same credentials? As a note, they'll output plaintext passwords, so you may want to pipe them to less to avoid displaying them on your terminal.

    • printf 'url=http://tfsserver:8080/\n' | git credential fill
    • printf 'url=http://tfsserver.xyz.com:8080\n' | git credential fill
  2. MarkKharitonov commented on Nov 1, 2018

    @MarkKharitonov
    Author

    Thanks for the info. The guy was able to workaround the issue by connecting to the server without the domain name, so that there are no differences in the URLs.

    I am still very interested to get to the bottom of it, but I need to wait until someone comes with this failure again. Can we keep this issue open on low fire until the opportunity arises to reproduce it?

  3. bk2204 commented on Nov 1, 2018

    @bk2204
    Member

    Sure, I don't see that being a problem. In general, if you can make your credential helper, whatever that might be, do the right thing, then this should resolve itself automatically.

  4. MarkKharitonov commented on Nov 2, 2018

    @MarkKharitonov
    Author

    It is confirmed. Another instance of the same problem. The credential fill returns the same result with domain or without.
    The only difference is that I used the following commands:

    This is because I am using Powershell, not bash. Does it matter?

  5. bk2204 commented on Nov 5, 2018

    @bk2204
    Member

    Can you tell me what version of Git LFS you're using and provide the output of git lfs env?

  6. MarkKharitonov commented on Nov 5, 2018

    @MarkKharitonov
    Author

    PS C:\git\xyz> git lfs env
    git-lfs/2.5.2 (GitHub; windows amd64; go 1.10.3; git 8e3c5c9)
    git version 2.17.1.windows.2

    Endpoint=http://tfsserver:8080/tfs/defaultcollection/code/_git/xyz.git/info/lfs (auth=ntlm)
    LocalWorkingDir=C:\git\xyz
    LocalGitDir=C:\git\xyz.git
    LocalGitStorageDir=C:\git\xyz.git
    LocalMediaDir=C:\git\xyz.git\lfs\objects
    LocalReferenceDirs=
    TempDir=C:\git\xyz.git\lfs\tmp
    ConcurrentTransfers=3
    TusTransfers=false
    BasicTransfersOnly=false
    SkipDownloadErrors=false
    FetchRecentAlways=false
    FetchRecentRefsDays=7
    FetchRecentCommitsDays=0
    FetchRecentRefsIncludeRemotes=true
    PruneOffsetDays=3
    PruneVerifyRemoteAlways=false
    PruneRemoteName=origin
    LfsStorageDir=C:\git\xyz.git\lfs
    AccessDownload=ntlm
    AccessUpload=ntlm
    DownloadTransfers=basic
    UploadTransfers=basic
    GIT_EXEC_PATH=C:/Program Files/Git/mingw64/libexec/git-core
    GIT_LFS_PATH=C:\Program Files\Git LFS
    git config filter.lfs.process = "git-lfs filter-process"
    git config filter.lfs.smudge = "git-lfs smudge -- %f"
    git config filter.lfs.clean = "git-lfs clean -- %f"

  7. bk2204 commented on Nov 5, 2018

    @bk2204
    Member

    Okay, I think this explains the situation. NTLM uses the server name in a challenge, so I believe the client and server need to agree on what that is. This appears to be a configuration issue with how your network is set up with authentication, so you'd probably need to talk to your networking folks about how to get things set up properly.

    Alternatively, you could switch to Basic authentication if your TFS implementation knows how to proxy that to your Active Directory (or other authentication) server.

  8. MarkKharitonov commented on Nov 5, 2018

    @MarkKharitonov
    Author

    Do you know where this is managed? I am not an IT person and frankly cannot speak intelligently about NTLM.

  9. bk2204 commented on Nov 5, 2018

    @bk2204
    Member

    I'm very sorry, but I don't. I don't use Windows, NTLM, or Active Directory, either in my personal or professional life, so unfortunately I can't be of any help in this regard.

    I just looked up the Microsoft NTLMv2 protocol specification, which is how I figured it out. I have very little knowledge of how NTLM actually works beyond having read the protocol docs.

  10. nhatkhai commented on Nov 8, 2018

    @nhatkhai

    I have similar issue with version 2.6.0, and 2.5.0. But it is working fine with version LFS 2.4.2.

    15:56:35.561609 trace git-lfs: tq: enqueue retry #8 for "98939a4f267133b23bc1a390542713e9a1c6b163903038493d9752e7798766a2" (size: 377767)
    15:56:35.561609 trace git-lfs: tq: sending batch of size 1
    15:56:35.562609 trace git-lfs: ssh cache: [email protected] git-lfs-authenticate att/ABC.git upload
    15:56:35.562609 trace git-lfs: api: batch 1 files
    15:56:35.562609 trace git-lfs: HTTP: POST https://stash.XYZ.com/scm/att/ABC.git/info/lfs/objects/batch
    15:56:35.774630 trace git-lfs: HTTP: 200
    15:56:35.774630 trace git-lfs: HTTP: {"objects":[{"oid":"98939a4f267133b23bc1a390542713e9a1c6b163903038493d9752e7798766a2","size":377767,"actions":{"upload"tion":"JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyODA3IiwicmVwbyI6MjM1MCwicXNoIjoiZmZiMDE2OTAzZTllYjYwOTJlNGEwYWU5MTY2YzJhNGE4ZDgzOTM5NzAzNmYzZWQw
    15:56:35.775630 trace git-lfs: HTTP: ZXQtZ2l0LWxmcyIsImNvbnRleHQiOnsidXNlciI6eyJoaWdoZXN0UGVybWlzc2lvbiI6IkxJQ0VOU0VEX1VTRVIiLCJzbHVnIjoibmd1eWVubmgiLCJ1c2VI3AZu-WVjijKw-adLBiBdbSw"}}}}]}
    15:56:35.775630 trace git-lfs: tq: starting transfer adapter "basic"
    15:56:35.776630 trace git-lfs: HTTP: PUT https://stash.XYZ.com/rest/git-lfs/storage/ATT/ABC/98939a4f267133b23bc1a390542713e9a1c6b163903038493d9752e779
    15:56:36.113664 trace git-lfs: HTTP: 500
    15:56:36.113664 trace git-lfs: HTTP: {"message":"null"}
    15:56:36.114664 trace git-lfs: tq: refusing to retry "98939a4f267133b23bc1a390542713e9a1c6b163903038493d9752e7798766a2", too many retries (8)
    Fatal error: nullects:   0% (0/1), 0 B | 0 B/s
    error: failed to push some refs to 'ssh://[email protected]:7999/att/ABC.git'
    

    And here is my lfs env for 2.4.2 (which is the working version)

    git-lfs/2.4.2 (GitHub; windows amd64; go 1.8.3; git 6f4b2e98)
    git version 2.17.0
    
    Endpoint=https://stash.XYZ.com/att/ABC.git/info/lfs (auth=basic)
      [email protected]:att/ABC.git
    LocalWorkingDir=C:\projects\git\EFG\HW\ABC
    LocalGitDir=C:\projects\git\EFG\.git\modules\HW\ABC
    LocalGitStorageDir=C:\projects\git\EFG\.git\modules\HW\ABC
    LocalMediaDir=C:\projects\git\EFG\.git\modules\HW\ABC\lfs\objects
    LocalReferenceDir=
    TempDir=C:\projects\git\EFG\.git\modules\HW\ABC\lfs\tmp
    ConcurrentTransfers=3
    TusTransfers=false
    BasicTransfersOnly=false
    SkipDownloadErrors=false
    FetchRecentAlways=false
    FetchRecentRefsDays=7
    FetchRecentCommitsDays=0
    FetchRecentRefsIncludeRemotes=true
    PruneOffsetDays=3
    PruneVerifyRemoteAlways=false
    PruneRemoteName=origin
    LfsStorageDir=C:\projects\git\EFG\.git\modules\HW\ABC\lfs
    AccessDownload=basic
    AccessUpload=basic
    DownloadTransfers=basic
    UploadTransfers=basic
    GIT_LFS_PATH=C:\Program Files\Git LFS
    git config filter.lfs.process = "git-lfs filter-process"
    git config filter.lfs.smudge = "git-lfs smudge -- %f"
    git config filter.lfs.clean = "git-lfs clean -- %f"
    
  11. bk2204 commented on Nov 8, 2018

    @bk2204
    Member

    @nhatkhai I think what you're seeing is a different issue. You're seeing a 500 error with Basic authentication, whereas the original reporter is seeing a 401 with NTLM authentication. Could you open this as a separate issue, please?

  12. changed the title [-]Unable to push[/-] [+]Unable to push with different server hostnames and NTLM authentication[/+] on Nov 8, 2018
  13. bk2204 commented on Jun 26, 2023

    @bk2204
    Member

    We no longer support NTLM authentication, so we won't be fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions