Skip to content

if git-credential does not exist, git push fails to upload LFS files #878

@tpdownes

Description

@tpdownes

On a computing cluster running Debian 7, which has git 1.7 by default. It turns out that git 1.7 as packaged for Debian 7 does not include a git-credential binary.

Without realizing this, I setup a credential helper (globally) to help https operations. Normal git operations were not affected by this vestigial configuration. I didn't notice it wasn't working because my operations were less frequent than the timeout.

[credential]
        helper = cache --timeout 900

But... with this configuration, git push in a repository with LFS tracking files fails to even attempt a file upload.

In some sense, this is user error since the config has a section that can't help, but git LFS should fail gracefully to interactive prompts when git-credential fails so the bug may have wider applicability. I was able to resolve the error by installing a backported version of git 1.9 which includes the git-credential binary.

git-lfs/1.1.0 (GitHub; linux amd64; go 1.5.1)
git version 1.7.10.4

$ git-lfs smudge large/git-lfs_1.1.0_amd64.deb
Error accessing media: large/git-lfs_1.1.0_amd64.deb (b4403d3b939557fa802c09b3b27d0e6cc80a34798a8c6f35cfe84167e0b49208)

Git credentials for https://my.host/my-name/lfs-test.git not found:
'git credential fill' error: exit status 1

goroutine 1 [running]:
github.com/github/git-lfs/lfs.Stack(0x0, 0x0, 0x0)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/lfs/errors.go:557 +0x80
github.com/github/git-lfs/commands.logPanicToWriter(0x7f3eff4451e8, 0xc820144078, 0x7f3eff4471a8, 0xc8204603a0)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/commands/commands.go:184 +0xf7f
github.com/github/git-lfs/commands.logPanic(0x7f3eff4471a8, 0xc8204603a0, 0x0, 0x0)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/commands/commands.go:148 +0x421
github.com/github/git-lfs/commands.handlePanic(0x7f3eff4471a8, 0xc8204603a0, 0x0, 0x0)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/commands/commands.go:123 +0x4e
github.com/github/git-lfs/commands.LoggedError(0x7f3eff4471a8, 0xc8204603a0, 0x95d2c0, 0x1e, 0xc82011fc98, 0x2, 0x2)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/commands/commands.go:73 +0x82
github.com/github/git-lfs/commands.smudgeCommand(0xb5a1e0, 0xc820011a70, 0x1, 0x1)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/commands/command_smudge.go:77 +0xd89
github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).execute(0xb5a1e0, 0xc8200119c0, 0x1, 0x1, 0x0, 0x0)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra/command.go:477 +0x403
github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra.(*Command).Execute(0xb5b220, 0x0, 0x0)
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra/command.go:551 +0x46a
github.com/github/git-lfs/commands.Run()
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/commands/commands.go:88 +0x23
main.main()
    /tmp/docker_run/git-lfs/obj-x86_64-linux-gnu/src/github.com/github/git-lfs/git-lfs.go:34 +0x12e

ENV:
LocalWorkingDir=/home/tpdownes/repos/lfs-test
LocalGitDir=.git
LocalGitStorageDir=.git
LocalMediaDir=.git/lfs/objects
TempDir=.git/lfs/tmp
ConcurrentTransfers=3
BatchTransfer=true
GIT_DIR=.git
GIT_PREFIX=
GIT_INTERNAL_GETTEXT_SH_SCHEME=gnu
GIT_SSH=/usr/bin/gsissh
GIT_REFLOG_ACTION=pull

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