Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock errors in clone or commit #131

Closed
ben-marsh opened this issue Oct 2, 2014 · 6 comments
Closed

Lock errors in clone or commit #131

ben-marsh opened this issue Oct 2, 2014 · 6 comments

Comments

@ben-marsh
Copy link

I'm not having much success cloning or committing using git-media on Windows (I'm using the prebuilt 0.3.1 AMD64 binaries; I tried building from source but got fed up trying to get the scripts working pretty quick).

Cloning git-media-test gives me this error:

D:\>git clone https://github.com/github/git-media-test
Cloning into 'git-media-test'...
remote: Counting objects: 42, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 42 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (42/42), done.
Checking connectivity... done.
Unable to write link file rename D:\git-media-test\.git\media\objects\c6\c3756551aa32e3ac86027700025977d408bff9.lock D:\git-media-test\.git\media\objects\c6\c3756551aa32e3ac86027700025977d408bff9: Can
not create a file when that file already exists.

Errors logged to D:\git-media-test\.git\media\logs\20141002T152202.1525843.log.
Use `git media logs last` to view the log.
error: external filter git media smudge %f failed 2
error: external filter git media smudge %f failed
fatal: video/video.mp4: smudge filter media failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'


D:\>git media logs last
No logs to show

D:\>type D:\git-media-test\.git\media\logs\20141002T152202.1525843.log
> git-media smudge video/video.mp4
LocalWorkingDir=D:\git-media-test
LocalGitDir=D:\git-media-test\.git
LocalMediaDir=D:\git-media-test\.git\media
TempDir=D:\git-media-test\.git\media\tmp
GIT_DIR=.git
GIT_INSTALL_ROOT=C:\Users\Ben.Marsh\AppData\Local\GitHub\PortableGit_7eaa994416ae7b397b2628033ac45f8ff6ac2010

Unable to write link file rename D:\git-media-test\.git\media\objects\c6\c3756551aa32e3ac86027700025977d408bff9.lock D:\git-media-test\.git\media\objects\c6\c3756551aa32e3ac86027700025977d408bff9: Can
not create a file when that file already exists.

rename D:\git-media-test\.git\media\objects\c6\c3756551aa32e3ac86027700025977d408bff9.lock D:\git-media-test\.git\media\objects\c6\c3756551aa32e3ac86027700025977d408bff9: Cannot create a file when tha
t file already exists.
goroutine 16 [running]:
github.com/github/git-media/gitmedia.Stack(0x0, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/gitmedia/errors.go:83 +0x90
github.com/github/git-media/commands.logPanic(0x130950, 0xc08200a980, 0xc082057900, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:148 +0xf1e
github.com/github/git-media/commands.handlePanic(0x130950, 0xc08200a980, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:100 +0x73
github.com/github/git-media/commands.LoggedError(0x130950, 0xc08200a980, 0x7e7210, 0x1c, 0xc082057c70, 0x1, 0x1)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:65 +0x90
github.com/github/git-media/commands.Panic(0x130950, 0xc08200a980, 0x7e7210, 0x1c, 0xc082057c70, 0x1, 0x1)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:75 +0x6f
github.com/github/git-media/commands.smudgeCommand(0x98c180, 0xc082000d70, 0x1, 0x1)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/command_smudge.go:66 +0x91d
github.com/spf13/cobra.(*Command).execute(0x98c180, 0xc082000d60, 0x1, 0x1, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/spf13/cobra/command.go:355 +0x183
github.com/spf13/cobra.(*Command).findAndExecute(0x98c480, 0xc082007d50, 0x2, 0x2, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/spf13/cobra/command.go:334 +0xda
github.com/spf13/cobra.(*Command).Execute(0x98c480, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/spf13/cobra/command.go:408 +0x7b7
github.com/github/git-media/commands.Run()
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:80 +0x31
main.main()
        /Users/scott/src/gocode/src/github.com/github/git-media/cmd/git-media.go:8 +0x21

Creating a new repo and committing to that is similar:

D:\git-media-test-2>git init
Initialized empty Git repository in D:/git-media-test-2/.git/

D:\git-media-test-2>copy \git-media-test\camb1.gif
        1 file(s) copied.

D:\git-media-test-2>git media path add *.gif
Adding path *.gif

D:\git-media-test-2>git add .
warning: LF will be replaced by CRLF in .gitattributes.
The file will have its original line endings in your working directory.

D:\git-media-test-2>git commit -m "First commit"
[master (root-commit) 4a897f4] First commit
warning: LF will be replaced by CRLF in .gitattributes.
The file will have its original line endings in your working directory.
Unable to write link file rename D:\git-media-test-2\.git\media\objects\03\f044990bf9f3760d591ad4550a5546a1278f58.lock D:\git-media-test-2\.git\media\objects\03\f044990bf9f3760d591ad4550a5546a1278f58:
 Cannot create a file when that file already exists.

Errors logged to D:\git-media-test-2\.git\media\logs\20141002T154438.4131968.log.
Use `git media logs last` to view the log.
error: external filter git media clean %f failed 2
error: external filter git media clean %f failed
fatal: camb1.gif: clean filter 'media' failed

D:\git-media-test-2>type D:\git-media-test-2\.git\media\logs\20141002T154438.4131968.log
> git-media clean camb1.gif
LocalWorkingDir=D:\git-media-test-2
LocalGitDir=D:\git-media-test-2\.git
LocalMediaDir=D:\git-media-test-2\.git\media
TempDir=D:\git-media-test-2\.git\media\tmp
GIT_AUTHOR_DATE=@1412279078 -0400
GIT_AUTHOR_EMAIL=ben-marsh@users.noreply.github.com
GIT_AUTHOR_NAME=Ben Marsh
GIT_DIR=.git
GIT_INSTALL_ROOT=C:\Users\Ben.Marsh\AppData\Local\GitHub\PortableGit_7eaa994416ae7b397b2628033ac45f8ff6ac2010
GIT_PREFIX=

Unable to write link file rename D:\git-media-test-2\.git\media\objects\03\f044990bf9f3760d591ad4550a5546a1278f58.lock D:\git-media-test-2\.git\media\objects\03\f044990bf9f3760d591ad4550a5546a1278f58:
 Cannot create a file when that file already exists.

rename D:\git-media-test-2\.git\media\objects\03\f044990bf9f3760d591ad4550a5546a1278f58.lock D:\git-media-test-2\.git\media\objects\03\f044990bf9f3760d591ad4550a5546a1278f58: Cannot create a file when
 that file already exists.
goroutine 16 [running]:
github.com/github/git-media/gitmedia.Stack(0x0, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/gitmedia/errors.go:83 +0x90
github.com/github/git-media/commands.logPanic(0x130950, 0xc08200aa40, 0xc082057a00, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:148 +0xf1e
github.com/github/git-media/commands.handlePanic(0x130950, 0xc08200aa40, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:100 +0x73
github.com/github/git-media/commands.LoggedError(0x130950, 0xc08200aa40, 0x7e7210, 0x1c, 0xc082057c88, 0x1, 0x1)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:65 +0x90
github.com/github/git-media/commands.Panic(0x130950, 0xc08200aa40, 0x7e7210, 0x1c, 0xc082057c88, 0x1, 0x1)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:75 +0x6f
github.com/github/git-media/commands.cleanCommand(0x98b380, 0xc082000e80, 0x1, 0x1)
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/command_clean.go:74 +0x6da
github.com/spf13/cobra.(*Command).execute(0x98b380, 0xc082000e50, 0x1, 0x1, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/spf13/cobra/command.go:355 +0x183
github.com/spf13/cobra.(*Command).findAndExecute(0x98c480, 0xc082007d80, 0x2, 0x2, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/spf13/cobra/command.go:334 +0xda
github.com/spf13/cobra.(*Command).Execute(0x98c480, 0x0, 0x0)
        /Users/scott/github/git-media/.vendor/src/github.com/spf13/cobra/command.go:408 +0x7b7
github.com/github/git-media/commands.Run()
        /Users/scott/github/git-media/.vendor/src/github.com/github/git-media/commands/commands.go:80 +0x31
main.main()
        /Users/scott/src/gocode/src/github.com/github/git-media/cmd/git-media.go:8 +0x21

Any ideas?

@technoweenie
Copy link
Contributor

First: what's git media version say?

@ben-marsh
Copy link
Author

git-media/0.3.1 (GitHub; windows amd64; git 1.9.4.msysgit.1; go 1.3)

@technoweenie
Copy link
Contributor

Cool, thanks. It looks like this is difference in behavior between unix and windows file systems. We should be able to get a fix out shortly. As we get nearer to launching, we really want to work on better cross platform testing to catch this stuff earlier.

@anaisbetts
Copy link

@technoweenie Throw in an extra file delete before you do the move and it should be fine. libgit2 got bit by this exact difference too.

@rubyist
Copy link
Contributor

rubyist commented Oct 2, 2014

Yep, that's exactly what I'm adding 😄

@rubyist
Copy link
Contributor

rubyist commented Oct 2, 2014

@ben-marsh thanks for the report! The issue should be fixed in release 0.3.2

@rubyist rubyist closed this as completed Oct 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@technoweenie @rubyist @anaisbetts @ben-marsh and others