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
Create a New Repository fails #3036
Comments
@rudifa thanks for the log file! The Can you tell me about the folder you are using to initialize the repository? We also only do a The log file shows this error that is very interesting:
Two things stand out:
cc @technoweenie for what else we might need to troubleshoot |
On this form we check whether the folder is part of a repository by asking Git:
For example, when I run this against a path under the Desktop repo on machine, it tells me the root of the repository:
If you run that with the folder you provided to the form (it's hard to say from here what you were seeing), what does it return? |
The That error and stack trace points to this: It's just sequentially calling a function callback for any file entries. However, if you dive into some of the private funcs, it is spawning goroutines to scan subdirectories: My hunch is that the directory tree is so wide and/or deep that it's spinning up too many goroutines. There should probably be a limit. If I created a custom lfs build for debugging, how easy would it be to run it and send me the log? I'd be really curious to see how big the tree is. |
Hey @rudifa, would you be willing to run this custom build in your terminal? I updated the file walker to limit how many concurrent goroutines it spawns. git-lfs-darwin-amd64-2.3.3.tar.gz You can just unzip this anywhere and run it directly. This won't impact your current git/lfs/Desktop installs. First, run with a limit of 1. This will be the slowest, but it shouldn't crash: ~p/linux git:(master) $ time WG_LIMIT=1 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:38:08.901286 trace git-lfs: run_command: 'git' version
12:38:08.911844 trace git-lfs: run_command: 'git' config -l
12:38:08.917185 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:38:08.917490 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:38:08.917772 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:38:08.918043 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:38:08.918230 trace git-lfs: START: buffer=1
12:38:09.847900 trace git-lfs: END: queued=1, run=4424
WG_LIMIT=1 GIT_TRACE=1 track 0.86s user 0.45s system 137% cpu 0.957 total Running with a limit of 2 should be faster: ~p/linux git:(master) $ time WG_LIMIT=2 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:39:34.488115 trace git-lfs: run_command: 'git' version
12:39:34.498840 trace git-lfs: run_command: 'git' config -l
12:39:34.503783 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:39:34.506362 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:39:34.507333 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:39:34.508247 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:39:34.508911 trace git-lfs: START: buffer=2
12:39:35.006166 trace git-lfs: END: queued=236, run=4189
WG_LIMIT=2 GIT_TRACE=1 track 0.85s user 0.40s system 228% cpu 0.545 total The new default in the custom build is based on how many CPUs you have: ~p/linux git:(master) $ time WG_LIMIT=0 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:40:19.310186 trace git-lfs: run_command: 'git' version
12:40:19.329865 trace git-lfs: run_command: 'git' config -l
12:40:19.335427 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:40:19.336050 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:40:19.336519 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:40:19.336984 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:40:19.337418 trace git-lfs: START: buffer=8
12:40:19.584892 trace git-lfs: END: queued=1943, run=2482
WG_LIMIT=0 GIT_TRACE=1 track 1.31s user 0.41s system 601% cpu 0.286 total You can even try a higher limit. It doesn't impact the speed in my tests, but hopefully it still doesn't crash: ~p/linux git:(master) ✗$ time WG_LIMIT=256 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:42:51.054553 trace git-lfs: run_command: 'git' version
12:42:51.064480 trace git-lfs: run_command: 'git' config -l
12:42:51.070579 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:42:51.070882 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:42:51.071097 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:42:51.071321 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:42:51.071490 trace git-lfs: START: buffer=256
12:42:51.301909 trace git-lfs: END: queued=4051, run=374
WG_LIMIT=256 GIT_TRACE=1 track 1.25s user 0.37s system 622% cpu 0.260 total The If you could run that, it'd really help me out :) EDIT: Feel free to sanitize the output too. The only lines I care about are the ones with |
Hi @shiftkey & @technoweenie I did not find the time yet to try out the modified file walker. However, I could add several observations to clarify what I reported in Create a New Repository fails #3036, see @rudifa update 2017-10-15. I also intend to submit suggestions for making the dialog Create a New Repository more informative. |
@rudifa: Here's a posted build, based on an official PR for LFS: git-lfs/git-lfs#2672. git-lfs-darwin-amd64-2.3.3.tar.gz If you still haven't run the debug build above, I'd appreciate trying the above build on your repository. No special env vars or debug values necessary: ~p/linux git:(master)$ time ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
git lfs track 1.32s user 0.39s system 641% cpu 0.267 total If you don't have time to run this, I totally understand :) |
Hi risk danger olson
I installed and ran your *git-lfs*. Are the results below of any use?
If you want me to do something more, or differently, please let me know.
Best regards
Rudi Farkas
POSTSCRIPTUM: I just realised that I never sent you this email, prepared
2-3 days ago.
I will run the new version of your tool asap. Should I run it from anywhere
on my disk, e.g. from my home directory?
*1. Unzipped the goods*
*git-lfs-2.3.3 $ pwd*
/Users/rudifarkas/Downloads/git-lfs-2.3.3
*git-lfs-2.3.3 $ ls -al*
total 16776
drwxr-xr-x@ 6 rudifarkas staff 204 Oct 13 20:32 .
drwx------ 5 rudifarkas staff 170 Oct 16 13:22 ..
…-rw-r--r--@ 1 rudifarkas staff 41320 Oct 13 20:32 CHANGELOG.md
-rw-r--r--@ 1 rudifarkas staff 5688 Oct 16 13:23 README.md
-rwxr-xr-x@ 1 rudifarkas staff 8525460 Oct 13 20:32 git-lfs
-rwxr-xr-x@ 1 rudifarkas staff 389 Oct 13 20:32 install.sh
*2. ran the install script*
*git-lfs-2.3.3 $ install.sh*
Updated git hooks.
Git LFS initialized.
*3. cd'd to my local clone of desktop*
*desktop $ pwd*
/Users/rudifarkas/GitHub/desktop
*desktop $ ls*
CODE_OF_CONDUCT.md README.md changelog.json gemoji
package.json
tslint-rules
CONTRIBUTING.md app circle.yml node_modules
script tslint.json
LICENSE appveyor.yml docs out
tsconfig.json
*4. ran git-lfs 4 times as you suggested*
*desktop $ time WG_LIMIT=1 GIT_TRACE=1 ~/Downloads/git-lfs-2.3.3/git-lfs
track*
13:43:10.526015 trace git-lfs: run_command: 'git' version
13:43:11.084220 trace git-lfs: run_command: 'git' config -l
13:43:11.172728 trace git-lfs: Install hook: pre-push, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/pre-push
13:43:11.176463 trace git-lfs: Install hook: post-checkout, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-checkout
13:43:11.177829 trace git-lfs: Install hook: post-commit, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-commit
13:43:11.179089 trace git-lfs: Install hook: post-merge, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-merge
13:43:11.180191 trace git-lfs: START: buffer=1
13:43:11.811525 trace git-lfs: END: queued=1, run=334
real 0m1.309s
user 0m0.075s
sys 0m0.220s
*desktop $ time WG_LIMIT=2 GIT_TRACE=1 ~/Downloads/git-lfs-2.3.3/git-lfs
track*
13:45:17.451356 trace git-lfs: run_command: 'git' version
13:45:17.471804 trace git-lfs: run_command: 'git' config -l
13:45:17.482229 trace git-lfs: Install hook: pre-push, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/pre-push, upgrading...
13:45:17.485482 trace git-lfs: Install hook: post-checkout, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-checkout, upgrading...
13:45:17.487412 trace git-lfs: Install hook: post-commit, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-commit, upgrading...
13:45:17.489243 trace git-lfs: Install hook: post-merge, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-merge, upgrading...
13:45:17.490959 trace git-lfs: START: buffer=2
13:45:17.537265 trace git-lfs: END: queued=59, run=276
real 0m0.106s
user 0m0.052s
sys 0m0.071s
*desktop $ time WG_LIMIT=0 GIT_TRACE=1 ~/Downloads/git-lfs-2.3.3/git-lfs
track*
13:46:04.816072 trace git-lfs: run_command: 'git' version
13:46:04.840276 trace git-lfs: run_command: 'git' config -l
13:46:04.852072 trace git-lfs: Install hook: pre-push, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/pre-push, upgrading...
13:46:04.855754 trace git-lfs: Install hook: post-checkout, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-checkout, upgrading...
13:46:04.857774 trace git-lfs: Install hook: post-commit, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-commit, upgrading...
13:46:04.859779 trace git-lfs: Install hook: post-merge, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-merge, upgrading...
13:46:04.861585 trace git-lfs: START: buffer=2
13:46:04.926925 trace git-lfs: END: queued=20, run=315
real 0m0.135s
user 0m0.054s
sys 0m0.073s
*desktop $ time WG_LIMIT=256 GIT_TRACE=1 ~/Downloads/git-lfs-2.3.3/git-lfs
track*
13:46:29.478397 trace git-lfs: run_command: 'git' version
13:46:29.511368 trace git-lfs: run_command: 'git' config -l
13:46:29.521603 trace git-lfs: Install hook: pre-push, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/pre-push, upgrading...
13:46:29.523845 trace git-lfs: Install hook: post-checkout, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-checkout, upgrading...
13:46:29.526047 trace git-lfs: Install hook: post-commit, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-commit, upgrading...
13:46:29.527890 trace git-lfs: Install hook: post-merge, force=false,
path=/Users/rudifarkas/GitHub/desktop/.git/hooks/post-merge, upgrading...
13:46:29.529654 trace git-lfs: START: buffer=256
13:46:29.595044 trace git-lfs: END: queued=335, run=0
real 0m0.147s
user 0m0.057s
sys 0m0.075s
On Fri, Oct 13, 2017 at 8:45 PM, risk danger olson ***@***.*** > wrote:
Hey @rudifa <https://github.com/rudifa>, would you be willing to run this
custom build in your terminal? I updated
<https://github.com/git-lfs/git-lfs/compare/fastwalk-depth> the file
walker to limit how many concurrent goroutines it spawns.
git-lfs-darwin-amd64-2.3.3.tar.gz
<https://github.com/desktop/desktop/files/1383614/git-lfs-darwin-amd64-2.3.3.tar.gz>
You can just unzip this anywhere and run it directly. This won't impact
your current git/lfs/Desktop installs.
First, run with a limit of 1. This will be the slowest, but it shouldn't
crash:
~p/linux git:(master) $ time WG_LIMIT=1 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:38:08.901286 trace git-lfs: run_command: 'git' version
12:38:08.911844 trace git-lfs: run_command: 'git' config -l
12:38:08.917185 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:38:08.917490 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:38:08.917772 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:38:08.918043 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:38:08.918230 trace git-lfs: START: buffer=1
12:38:09.847900 trace git-lfs: END: queued=1, run=4424
WG_LIMIT=1 GIT_TRACE=1 track 0.86s user 0.45s system 137% cpu 0.957 total
Running with a limit of 2 should be faster:
~p/linux git:(master) $ time WG_LIMIT=2 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:39:34.488115 trace git-lfs: run_command: 'git' version
12:39:34.498840 trace git-lfs: run_command: 'git' config -l
12:39:34.503783 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:39:34.506362 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:39:34.507333 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:39:34.508247 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:39:34.508911 trace git-lfs: START: buffer=2
12:39:35.006166 trace git-lfs: END: queued=236, run=4189
WG_LIMIT=2 GIT_TRACE=1 track 0.85s user 0.40s system 228% cpu 0.545 total
The new default in the custom build is based on how many CPUs you have:
~p/linux git:(master) $ time WG_LIMIT=0 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:40:19.310186 trace git-lfs: run_command: 'git' version
12:40:19.329865 trace git-lfs: run_command: 'git' config -l
12:40:19.335427 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:40:19.336050 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:40:19.336519 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:40:19.336984 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:40:19.337418 trace git-lfs: START: buffer=8
12:40:19.584892 trace git-lfs: END: queued=1943, run=2482
WG_LIMIT=0 GIT_TRACE=1 track 1.31s user 0.41s system 601% cpu 0.286 total
You can even try a higher limit. It doesn't impact the speed in my tests,
but hopefully it still doesn't crash:
~p/linux git:(master) ✗$ time WG_LIMIT=256 GIT_TRACE=1 ~p/git-lfs/bin/releases/darwin-amd64/git-lfs-2.3.3/git-lfs track
12:42:51.054553 trace git-lfs: run_command: 'git' version
12:42:51.064480 trace git-lfs: run_command: 'git' config -l
12:42:51.070579 trace git-lfs: Install hook: pre-push, force=false, path=/Users/rick/p/linux/.git/hooks/pre-push, upgrading...
12:42:51.070882 trace git-lfs: Install hook: post-checkout, force=false, path=/Users/rick/p/linux/.git/hooks/post-checkout, upgrading...
12:42:51.071097 trace git-lfs: Install hook: post-commit, force=false, path=/Users/rick/p/linux/.git/hooks/post-commit, upgrading...
12:42:51.071321 trace git-lfs: Install hook: post-merge, force=false, path=/Users/rick/p/linux/.git/hooks/post-merge, upgrading...
12:42:51.071490 trace git-lfs: START: buffer=256
12:42:51.301909 trace git-lfs: END: queued=4051, run=374
WG_LIMIT=256 GIT_TRACE=1 track 1.25s user 0.37s system 622% cpu 0.260 total
The queued and run values track how many times it spawns a go routine, vs
running inline. The sum of the two values should be the number of
directories and subdirectories in your project.
If you could run that, it'd really help me out :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3036 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKhdNkE_RRaVdgk-8EvsSPS-sFxZ-Jmks5sr6_QgaJpZM4P3s0c>
.
|
@rudifa Thanks a lot! To explain the output:
This run processed 20 groups of files in the 2 parallel goroutines. 315 groups of files were run sequentially so that it doesn't go over the max of 2 parallel goroutines.
With a max limit of 256 parallel goroutines, it spawned new goroutines for 335 groups of files, never reaching the max. Did you run this on the same repository? Those numbers don't indicate a huge repository, so I may be wrong about the original error that @shiftkey found.
Based on more googling, you could have run out of file descriptors, or hit some bug with some "cgo" code. LFS doesn't use cgo, but the Go runtime can use it for some things like DNS resolution. At any rate, thanks so much for running my experimental code on your repository. I just merged a fix for this in git-lfs/git-lfs#2672, and will prepare a new release for the Desktop team this week. I hope it solves your issues :) |
#3078 (comment) also talks about using a folder with a large amount of files, which feels like the first issue you encountered. Once LFS is updated I'll close this out and address that error with the repro steps provided in #3078. |
Description
a. The dialog "Create a New Repository" seems to hang.
b. It displays "This directory appears to be a Git repository. Would you like to add this repository instead?" whether the directory contains a git repository or not (see 1st screenshot).
c. Button "Create repository" never changes the color to dark blue (I suppose that it should do so when ready to create).
d. Click on "Cancel" sometimes produces an Error dialog that suggests to increase the options.maxBuffer (which I did not try; see the 2nd screenshot).
e. Attached logfile 23:23 2017-10-12.desktop.production.log grew to 11.5 MB and some sequences suggest infinite loops.
Version
GitHub Desktop version: 1.0.3
OS version: OS X 10.11.6
Steps to Reproduce
Expected behavior: Desktop should create an empty repository and select it as Current.
Actual misbehavior: See above Description.
Reproduces how often: 100%
Logs
2017-10-12.desktop.production.log
Additional Information
Workaround: $ git init
@rudifa update 2017-10-15
After I submitted this bug report, I made several observations on my computer, as follows:
The root cause of behaviors that I observed was the presence of a
.git
directory in my home directory/Users/rudifarkas
. This.git
was forgotten there since 2013, and I don't know why and how I copied it there, probably by mistake. It contains 2032 items, 73.4 MB.For this reason, an attempt to Create a New Repository in any of my subdirectories produces the message ""This directory appears to be a Git repository. Would you like to add this repository instead?" with the button "Create repository" disabled.
In this situation, a click on the "add this repository" adds the "repository"
rudifarkas
, which is the intended behavior.The additional buggy behavior (Error dialog shown above, as well as presence, after a while, of tens of process instances of
git
on the computer) was 100% reproducible when I wrote the bug report (2017-10-12).Today (after I rebooted my computer 2 days ago), I tried to reproduce these errors, by repeatedly trying to Create a New Repository (with that
~/.git
still present), and clicking on Cancel or on "add this repository". I did get the above Error box a few times, and the log below does contain agit lfs track exited with an unexpected code: 2.
, and a sequence ofgoroutine
logs, within a 5 second interval.2017-10-15.desktop.production.log
The text was updated successfully, but these errors were encountered: