Skip to content

Error accessing media: unsupported protocol scheme "" #930

Closed

Description

@cmaumet

When trying to pull from https://github.com/incf-nidash/nidmresults-examples, we get the following error:

$ git pull
Updating 17d5080..ff51e6d
Downloading spm_explicit_mask/explicit_mask_2.nii (579.34 KB)
Error accessing media: spm_explicit_mask/explicit_mask_2.nii (a543db67399ab02aefbf3dd2aad2f4e2980c9a026b657498c79f3573ac821952)

Errors logged to .git/lfs/objects/logs/20160112T102310.547408339.log
Use `git lfs logs last` to view the log.
error: external filter git-lfs smudge %f failed 2
error: external filter git-lfs smudge %f failed
fatal: spm_explicit_mask/explicit_mask_2.nii: smudge filter lfs failed

Full log:

$ git lfs logs last
git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1)
git version 2.6.3

$ git-lfs smudge spm_explicit_mask/explicit_mask_2.nii
Error accessing media: spm_explicit_mask/explicit_mask_2.nii (a543db67399ab02aefbf3dd2aad2f4e2980c9a026b657498c79f3573ac821952)

Post objects/batch: unsupported protocol scheme ""
goroutine 1 [running]:
github.com/github/git-lfs/lfs.Stack(0x0, 0x0, 0x0)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/src/github.com/github/git-lfs/lfs/errors.go:557 +0x80
github.com/github/git-lfs/commands.logPanicToWriter(0xb641c0, 0xc820082228, 0xb64de0, 0xc82012a480)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/src/github.com/github/git-lfs/commands/commands.go:184 +0xf7f
github.com/github/git-lfs/commands.logPanic(0xb64de0, 0xc82012a480, 0x0, 0x0)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/src/github.com/github/git-lfs/commands/commands.go:148 +0x421
github.com/github/git-lfs/commands.handlePanic(0xb64de0, 0xc82012a480, 0x0, 0x0)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/src/github.com/github/git-lfs/commands/commands.go:123 +0x4e
github.com/github/git-lfs/commands.LoggedError(0xb64de0, 0xc82012a480, 0x55a640, 0x1e, 0xc820127c98, 0x2, 0x2)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/src/github.com/github/git-lfs/commands/commands.go:73 +0x82
github.com/github/git-lfs/commands.smudgeCommand(0x75e040, 0xc820071970, 0x1, 0x1)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/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(0x75e040, 0xc8200718c0, 0x1, 0x1, 0x0, 0x0)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/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(0x75f080, 0x0, 0x0)
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/src/github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra/command.go:551 +0x46a
github.com/github/git-lfs/commands.Run()
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/src/github.com/github/git-lfs/commands/commands.go:88 +0x23
main.main()
    /private/tmp/git-lfs20151202-15548-y7a9pj/git-lfs-1.1.0/git-lfs.go:34 +0x12e

ENV:
LocalWorkingDir=.
LocalGitDir=.git
LocalGitStorageDir=.git
LocalMediaDir=.git/lfs/objects
TempDir=.git/lfs/tmp
ConcurrentTransfers=3
BatchTransfer=true
GIT_DIR=.git
GIT_REFLOG_ACTION=pull
GIT_WORK_TREE=.
GIT_PREFIX=

Cloning the repository from scratch does work but the same issue re-appear when we try to pull again (the error is raised when the first file stored with git-lfs is pulled). Could you help us tracking this down? Thank you!

The repository contains a lot of files tracked with git-lfs. Might this be an issue?

Activity

  1. cmaumet commented on Jan 12, 2016

    @cmaumet
    Author

    You will find below the output of git lfs env:

    $ git lfs env
    git-lfs/1.1.0 (GitHub; darwin amd64; go 1.5.1)
    git version 2.6.3
    
    Endpoint (upstream)=https://github.com/incf-nidash/nidmresults-examples.git/info/lfs (auth=basic)
      [email protected]:incf-nidash/nidmresults-examples.git
    LocalWorkingDir=/Users/cmaumet/Projects/Data_sharing/dev/new_nidm_ex/nidmresults-examples
    LocalGitDir=/Users/cmaumet/Projects/Data_sharing/dev/new_nidm_ex/nidmresults-examples/.git
    LocalGitStorageDir=/Users/cmaumet/Projects/Data_sharing/dev/new_nidm_ex/nidmresults-examples/.git
    LocalMediaDir=/Users/cmaumet/Projects/Data_sharing/dev/new_nidm_ex/nidmresults-examples/.git/lfs/objects
    TempDir=/Users/cmaumet/Projects/Data_sharing/dev/new_nidm_ex/nidmresults-examples/.git/lfs/tmp
    ConcurrentTransfers=3
    BatchTransfer=true
    git config filter.lfs.smudge = "git-lfs smudge %f"
    git config filter.lfs.clean = "git-lfs clean %f"
    
  2. technoweenie commented on Jan 12, 2016

    @technoweenie
    Contributor

    Ah, I think it's because your ref is called "upstream", and not "origin". Easiest thing right now is to change it, but there's probably something better that Git LFS can do to support uncommon remote names. You may also have better luck specifying git pull upstream master.

  3. cmaumet commented on Jan 12, 2016

    @cmaumet
    Author

    Thank you for this quick feedback!

    git pull upstream master raises the same error:

    $ git pull upstream master
    From github.com:incf-nidash/nidmresults-examples
     * branch            master     -> FETCH_HEAD
    Updating 17d5080..ff51e6d
    Downloading spm_explicit_mask/explicit_mask_2.nii (579.34 KB)
    Error accessing media: spm_explicit_mask/explicit_mask_2.nii (a543db67399ab02aefbf3dd2aad2f4e2980c9a026b657498c79f3573ac821952)
    
    Errors logged to .git/lfs/objects/logs/20160112T161716.232928972.log
    Use `git lfs logs last` to view the log.
    error: external filter git-lfs smudge %f failed 2
    error: external filter git-lfs smudge %f failed
    fatal: spm_explicit_mask/explicit_mask_2.nii: smudge filter lfs failed
    

    But renaming upstream into origin seems to solve the issue:

    $ git remote rename upstream origin
    $ git remote -v
    origin  [email protected]:incf-nidash/nidmresults-examples.git (fetch)
    origin  [email protected]:incf-nidash/nidmresults-examples.git (push)
    $ git pull origin master
    From github.com:incf-nidash/nidmresults-examples
     * branch            master     -> FETCH_HEAD
    Updating 17d5080..ff51e6d
    Downloading spm_explicit_mask/explicit_mask_2.nii (579.34 KB)
    Fast-forward
     spm_explicit_mask/explicit_mask_2.nii | 3 +++
     1 file changed, 3 insertions(+)
     create mode 100644 spm_explicit_mask/explicit_mask_2.nii
    
  4. technoweenie commented on Jan 12, 2016

    @technoweenie
    Contributor

    Cool, thanks for the confirmation. Does your git config have any relevant settings? Anything that sets upstream as your preferred default remote?

  5. cmaumet commented on Jan 13, 2016

    @cmaumet
    Author

    No... I have just changed the remote name manually using git remote rename.

  6. c5f commented on Jan 22, 2016

    @c5f

    I also receive this error from remotes configured with a SSH config alias:

    git push
    Git LFS: (0 of <some> files) 0 B / <some> MB
    Post github:<user|org>/<repo>.git/info/lfs: unsupported protocol scheme "github"
    

    Changing the remote config to use [email protected]:<user|org>/<repo>.git solved the issue for me, but I use the github SSH alias on most of my local projects.

  7. stoneStyle commented on Jan 29, 2016

    @stoneStyle

    and i meet this bug when i try to add a subtree floder in my project;
    at first i name that subtree project "configserver", so i receive the error ,then i rename it to origin,
    it works....

  8. DirkReiners commented on Feb 6, 2016

    @DirkReiners

    +1 for the SSH config alias problem.

    As a workaround we manually set the lfs.url for the repo, but it's a bit painful.

  9. iacopy commented on May 12, 2016

    @iacopy

    I also have the OP issue. Work-arounded succesfully by changing my remote name from upstream to origin:
    git remote rename upstream origin

  10. ygoe commented on Aug 15, 2016

    @ygoe

    Please make the error message say "I'm stupid and you must name your remote 'origin' to use LFS." to help people resolve this error more quickly than I could just do it. Or fix the bug, whichever is easier.

  11. technoweenie commented on Aug 15, 2016

    @technoweenie
    Contributor

    The reason LFS needs an origin remote for downloads is that by the time Git calls the smudge filter, the knowledge of what git remote should be used is lost. Your workarounds are either:

    1. Rename your remote to origin
    2. Turn off the smudge filter with git lfs install --skip-smudge. Now you'll have to run git lfs pull {origin-name} to replace the LFS pointers with files. The downloads will be much faster, and you'll have more control over where your LFS content lives.
  12. ygoe commented on Aug 15, 2016

    @ygoe

    Okay, but could you please try to make the error message helpful, because this limitation is far from obvious and people will raise that issue again as long as they're left clueless with that unsupported protocol scheme "", whatever that is. I, for one, don't usually use the name "origin" because I don't know where that is. I have many different repositories with different remotes, some internal, some public, and I'd like to be certain before I push anything somewhere. If specifying the LFS URL for the repository helps (haven't tried that yet), that might also be mentioned in the error message.

  13. doudou commented on Aug 24, 2016

    @doudou

    I was going with the --skip-smudge solution ... but it is global, right ?

    I would like to be able to not touch the global setting, but set it while cloning. Once my repositorie's cloned, I can obviously set it up in the git configuration, but how can I force git-lfs to avoid smudging when I clone (regardless of the global setting)

  14. technoweenie commented on Aug 24, 2016

    @technoweenie
    Contributor

    @doudou:

    I was going with the --skip-smudge solution ... but it is global, right ?

    You can run git lfs install --skip-smudge --local to apply to a repository's local git config.

    how can I force git-lfs to avoid smudging when I clone (regardless of the global setting)

    Use git lfs clone .... It's a wrapper around git clone that disables smudging (regardless of your global git config), clones the repo, and then runs git lfs pull. Highly recommended for all clones for Git LFS repositories.

  15. r0ssIV commented on Apr 10, 2017

    @r0ssIV

    OMG, so much time passed, and nobody bothered with the bug

  16. adiroiban commented on Jun 23, 2017

    @adiroiban

    I am getting this error when using git-lfs with Buildbot as it does not creates any remotes.

    Setting lfs.url solved the issue

  17. kavehv commented on Jul 18, 2017

    @kavehv

    Why was this closed? I thought it was slated to be fixed in 2.2.x. It seems poor design to expect the remote to be named 'origin' in all cases and just blindly fail when it's not.

  18. technoweenie commented on Jul 18, 2017

    @technoweenie
    Contributor

    Unfortunately, we're at the mercy of git's hooks here. We're open to suggestions on fixing it, but until then you can use the workaround described in #930 (comment).

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions