Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Bundle Install Hangs on Git Command #5951

Closed
CodingAnarchy opened this issue Aug 17, 2017 · 12 comments
Closed

Bundle Install Hangs on Git Command #5951

CodingAnarchy opened this issue Aug 17, 2017 · 12 comments

Comments

@CodingAnarchy
Copy link

When I am trying to run bundle install on my machine, I am getting it hung in what appears to be a git command.

The result is this:

Running `bundle install --verbose` with bundler 1.15.3
Found changes from the lockfile, re-resolving dependencies because the dependencies in your gemfile changed
^C
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:162:in `call'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:162:in ``'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:162:in `block (2 levels) in git'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:239:in `block in capture_and_filter_stderr'
/Users/vision/.rvm/rubies/ruby-2.2.6/lib/ruby/2.2.0/tempfile.rb:319:in `open'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:237:in `capture_and_filter_stderr'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:162:in `block in git'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:73:in `call'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:73:in `with_clean_git_env'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:161:in `git'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:153:in `block in git_retry'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/retry.rb:39:in `call'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/retry.rb:39:in `run'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/retry.rb:29:in `attempt'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:152:in `git_retry'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:129:in `block in copy_to'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:55:in `chdir'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:55:in `block in chdir'
/Users/vision/.rvm/rubies/ruby-2.2.6/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:54:in `chdir'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git/git_proxy.rb:128:in `copy_to'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/source/git.rb:161:in `specs'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/definition.rb:246:in `block (2 levels) in index'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/definition.rb:244:in `each'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/definition.rb:244:in `block in index'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/index.rb:10:in `build'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/definition.rb:241:in `index'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/definition.rb:235:in `resolve'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/definition.rb:159:in `specs'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/definition.rb:147:in `resolve_remotely!'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/installer.rb:226:in `resolve_if_need'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/installer.rb:78:in `run'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/installer.rb:24:in `install'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/cli/install.rb:68:in `run'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/cli.rb:191:in `block in install'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/settings.rb:92:in `temporary'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/cli.rb:190:in `install'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/cli.rb:22:in `dispatch'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/cli.rb:13:in `start'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/exe/bundle:30:in `block in <top (required)>'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/Users/vision/.rvm/gems/ruby-2.2.6/gems/bundler-1.15.3/exe/bundle:22:in `<top (required)>'
/Users/vision/.rvm/gems/ruby-2.2.6/bin/bundle:22:in `load'
/Users/vision/.rvm/gems/ruby-2.2.6/bin/bundle:22:in `<main>'
/Users/vision/.rvm/gems/ruby-2.2.6/bin/ruby_executable_hooks:15:in `eval'
/Users/vision/.rvm/gems/ruby-2.2.6/bin/ruby_executable_hooks:15:in `<main>'

The output of bundle env is here.

In case it might matter, git is wrapped with hub (although that has never been a problem before, and neither was updated recently):

> git --version
git version 2.14.1
hub version 2.2.9
@segiddins
Copy link
Member

Can you please provide the verbose output and check if the resulting git command success outside of bundler? Thanks!

@CodingAnarchy
Copy link
Author

Unfortunately, that is the --verbose output. I even tried doing it with DEBUG_RESOLVER=1 bundle install --verbose: same result. It hangs before it even prints anything beyond finding changes in the lockfile.

@CodingAnarchy
Copy link
Author

As a result, I'm not certain I can even tell what git command is the one that is failing. Certainly, all the ones I know I'm running work as expected in other tools and direct operation.

@CodingAnarchy
Copy link
Author

Potentially related to ruby-git/ruby-git#171? Providing the .gitignore for potential relation noted in that issue.

/.bundle
/**/.*.swp
/**/*~
/log/*
!/log/.keep
/tmp
tmp
nbproject
config/database.yml
config/secrets.yml
public/assets
public/system
public/GeoLiteCity.dat
.ruby-gemset
.byebug_history
coverage/
/**/*.sql
/**/*.DS_Store
.idea
test
/**/*.dump

# should these be ignored?
app/models/usaepay.rb
app/models/usaepayDriver.rb
app/models/usaepayMappingRegistry.rb
app/models/usaepayServiceClient.rb
.eslintrc
.tern-project
.vscode
node_modules
package.json
typings
**/jsconfig.json
*.dump

# ignore ctags files
.gemtags
.tags
tags
.tags_sorted_by_file
spec/**/examples.txt
*.orig
.bash_profile
*.log
public/uploads

@CodingAnarchy
Copy link
Author

CodingAnarchy commented Aug 18, 2017

After attempting the troubleshooting instructions (except for removing the Gemfile.lock, as I can't re-resolve the whole thing due to production reasons), this is the error that resulted.

Fetching https://github.com/seuros/capistrano-puma.git
error: cannot open .git/FETCH_HEAD: Permission denied
Retrying `git fetch --force --quiet --tags "/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90"` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90"` in directory /Users/vision/.rvm/rubies/ruby-2.2.6/lib/ruby/gems/2.2.0/bundler/gems/capistrano-puma-e18b30c18ace has failed.
If this error persists you could try removing the cache directory '/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90'
error: cannot open .git/FETCH_HEAD: Permission denied
Retrying `git fetch --force --quiet --tags "/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90"` due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90"` in directory /Users/vision/.rvm/rubies/ruby-2.2.6/lib/ruby/gems/2.2.0/bundler/gems/capistrano-puma-e18b30c18ace has failed.
If this error persists you could try removing the cache directory '/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90'
error: cannot open .git/FETCH_HEAD: Permission denied
Retrying `git fetch --force --quiet --tags "/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90"` due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git fetch --force --quiet --tags "/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90"` in directory /Users/vision/.rvm/rubies/ruby-2.2.6/lib/ruby/gems/2.2.0/bundler/gems/capistrano-puma-e18b30c18ace has failed.
If this error persists you could try removing the cache directory '/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90'
error: cannot open .git/FETCH_HEAD: Permission denied
Git error: command `git fetch --force --quiet --tags "/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90"` in directory
/Users/vision/.rvm/rubies/ruby-2.2.6/lib/ruby/gems/2.2.0/bundler/gems/capistrano-puma-e18b30c18ace has failed.
If this error persists you could try removing the cache directory '/Users/vision/.bundle/cache/git/capistrano-puma-09a5dc7ac977bbdb1015c1a66016eca1de387d90'

This directory was created in the bundle run itself.

@segiddins
Copy link
Member

Hmm, this looks like it might be a permissions issue but without a way to reproduce the bug I think we're unlikely to be able to look into it

@CodingAnarchy
Copy link
Author

Looks like the error is /Users/vision/.bundle/cache/git/bootstrap-switch-rails-1cf6d21d2524e4a2c161cdb78d8901f824cd7b01'error: cannot open .git/FETCH_HEAD

But the FETCH_HEAD is actually at .bundle/cache/git/bootstrap-switch-rails-1cf6d21d2524e4a2c161cdb78d8901f824cd7b01/FETCH_HEAD.

It appears to be doing a --bare clone, and then treating it as a normal repository.

@CodingAnarchy
Copy link
Author

Manually issuing the git command in that repository provides a temporary workaround - as long as no repos need to be updated, the issue does not occur.

@segiddins
Copy link
Member

Does the problem go away if you remove the cached repo?

@CodingAnarchy
Copy link
Author

Removing the cached repo doesn't help. It clones down the repository again and then has the same error.

@schneems
Copy link
Contributor

schneems commented Aug 8, 2018

Can you please provide an example app that can reproduce this issue.

@colby-swandale
Copy link
Member

@CodingAnarchy Is this still an issue on the latest version of Bundler?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants