-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Hi!
I am not sure if I have configuration issue or something is actually wrong. I want to test git lfs against lfs-test-server locally on my linux box in my home dir. It works until the point where I finally want to push commits that contain lfs tracked files. Similar to git-lfs/lfs-test-server#81.
My setup consists of:
> git --version
git version 2.23.0
I have cloned the lfs-test-server git-hub repo and compiled the current head commit ID git-lfs/lfs-test-server@bf4c40b with go 1.12.12. Unfortuantely there is nothing like make test to see if it actually works. When I run it with
> LFS_ADMINUSER=admin LFS_ADMINPASS=admin ./lfs-test-server
I can access the mgmt interface via http://localhost:8080/mgmt and add users. So for the moment I assume lfs-test-server is working. It is running under my user account in a folder in my home dir. So lfs-content and lfs.db should be writable.
Then I create the new repo via
> cd ~/repos
> git init --bare foobar
Initialized empty Git repository in /home/laube/repos/foobar/
Now lets pretend that this is somewhere safe on a server and I actually work in a local clone, like so:
> mkdir -p ~/tmp
> cd ~/tmp
> git clone ~/repos/foobar
Cloning into 'foobar'...
warning: You appear to have cloned an empty repository.
done.
> cd foobar
> git lfs install
Updated git hooks
Git LFS initialized.
Without any further config changes I have:
> git lfs env
git-lfs/2.9.0 (GitHub; linux amd64; go 1.13.1; git dca80d40)
git version 2.23.0
Endpoint=file:///home/laube/repos/foobar/.git/info/lfs (auth=none)
LocalWorkingDir=/home/laube/tmp/foobar
LocalGitDir=/home/laube/tmp/foobar/.git
LocalGitStorageDir=/home/laube/tmp/foobar/.git
LocalMediaDir=/home/laube/tmp/foobar/.git/lfs/objects
LocalReferenceDirs=
TempDir=/home/laube/tmp/foobar/.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=/home/laube/tmp/foobar/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_EXEC_PATH=/usr/lib/git
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"
Thus I have to adjust this to point git-lfs to the lfs-test-server running locally:
> git config -f .lfsconfig lfs.url http://localhost:8080/foobar
> git add .
> git commit -m 'created .lfsconfig'
[master (root-commit) 3e4308a] created .lfsconfig
1 file changed, 2 insertions(+)
create mode 100644 .lfsconfig
> git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 260 bytes | 260.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/laube/repos/foobar
* [new branch] master -> master
So pushing from the clone into the bare repo worked as expected. The config now is
> git lfs env
git-lfs/2.9.0 (GitHub; linux amd64; go 1.13.1; git dca80d40)
git version 2.23.0
Endpoint=http://localhost:8080/foobar (auth=none)
LocalWorkingDir=/home/laube/tmp/foobar
LocalGitDir=/home/laube/tmp/foobar/.git
LocalGitStorageDir=/home/laube/tmp/foobar/.git
LocalMediaDir=/home/laube/tmp/foobar/.git/lfs/objects
LocalReferenceDirs=
TempDir=/home/laube/tmp/foobar/.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=/home/laube/tmp/foobar/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_EXEC_PATH=/usr/lib/git
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"
Now I can set up the tracking:
> git lfs track '*.bin'
Tracking "*.bin"
> git add .
> git commit -m 'lfs track data files via *.bin'
[master c9c1557] lfs track data files via *.bin
1 file changed, 1 insertion(+)
create mode 100644 .gitattributes
> git push origin master
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 333 bytes | 333.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To /home/laube/repos/foobar
541d630..c9c1557 master -> master
> git lfs track
Listing tracked patterns
*.bin (.gitattributes)
Listing excluded patterns
That worked as expected too. The bare repo and the clone now both have two commits and the log of lfs-test-server is still empty. Let's change that:
> head -c 1M /dev/urandom > baz.bin
> git add .
> git commit -m 'add binary file'
[master 5c1c7e1] add binary file
1 file changed, 3 insertions(+)
create mode 100644 baz.bin
> git lfs ls-files
9417197878 * baz.bin
Again that all worked as expected. But now
> git push origin master
EOFoading LFS objects: 100% (1/1), 1.0 MB | 0 B/s
error: failed to push some refs to '/home/laube/repos/foobar'
fails. There is no output in the lfs-test-server log. So it looks like a config or client side problem. With more tracing enabled:
> GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_TRANSFER_TRACE=1 git push origin master
20:59:00.182349 git.c:440 trace: built-in: git push origin master
20:59:00.182586 run-command.c:663 trace: run_command: unset GIT_PREFIX; 'git-receive-pack '\''/home/laube/repos/foobar'\'''
20:59:00.184137 git.c:440 trace: built-in: git receive-pack /home/laube/repos/foobar
20:59:00.184489 run-command.c:663 trace: run_command: .git/hooks/pre-push origin /home/laube/repos/foobar
20:59:00.186107 git.c:703 trace: exec: git-lfs pre-push origin /home/laube/repos/foobar
20:59:00.186125 run-command.c:663 trace: run_command: git-lfs pre-push origin /home/laube/repos/foobar
20:59:00.188229 trace git-lfs: exec: git 'version'
20:59:00.189826 trace git-lfs: exec: 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'
20:59:00.191502 trace git-lfs: exec: git 'config' '-l'
20:59:00.192255 trace git-lfs: exec: git 'config' '-l' '-f' '/home/laube/tmp/foobar/.lfsconfig'
20:59:00.193096 trace git-lfs: pre-push: refs/heads/master 5c1c7e1381dc2f1681c608f2655e4ad60b9e4990 refs/heads/master c9c1557ef9c382c8bbae659cfaef378ad4afaac0 A
20:59:00.198129 trace git-lfs: tq: running as batched queue, batch size of 100
20:59:00.198227 trace git-lfs: run_command: git rev-list --stdin --objects --not --remotes=origin --
20:59:00.200326 trace git-lfs: tq: sending batch of size 1
20:59:00.200356 trace git-lfs: tq: starting transfer adapter "lfs-standalone-file"
20:59:00.200417 trace git-lfs: xfer: adapter "lfs-standalone-file" Begin() with 1 workers
20:59:00.200422 trace git-lfs: xfer: starting up custom transfer process "lfs-standalone-file" for worker 0
20:59:00.200646 trace git-lfs: xfer: Custom adapter worker 0 sending message: {"event":"init","operation":"upload","remote":"origin","concurrent":false,"concurrenttransfers":8}
20:59:00.204101 trace git-lfs: xfer[git-lfs]: 20:59:00.204011 trace git-lfs: exec: git 'version'
20:59:00.206208 trace git-lfs: xfer[git-lfs]: 20:59:00.206176 trace git-lfs: exec: git 'config' '-l'
20:59:00.207266 trace git-lfs: xfer[git-lfs]: 20:59:00.207236 trace git-lfs: exec: git 'config' '-l' '-f' '/home/laube/tmp/foobar/.lfsconfig'
20:59:00.208458 trace git-lfs: xfer[git-lfs]: error creating handler: no valid file:// URLs found
20:59:00.208815 trace git-lfs: xfer: Aborting worker process: 0
EOFoading LFS objects: 100% (1/1), 1.0 MB | 0 B/s
error: failed to push some refs to '/home/laube/repos/foobar'
Why is it complaining about a file:// URL? There was one such URL in the output of the very first git lfs env output. That was replaced by setting lfs.url, wasn't it? And LFS_SCHEME defaults to http according to the README.md. Likewise https://github.com/git-lfs/git-lfs/wiki/Tutorial says
Note: only http:// https:// endpoints are supported by the git-lfs client.
So I am not expecting to see a file:// URL here at all. If I move the information from .lfsconfig to my ~/.gifconfig I get the same git lfs env output and the same error when I try to push. What am I overlooking?