rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 2k forks source link

Fatal: No live threads left. Deadlock? #3692

Closed rogierslag closed 9 years ago

rogierslag commented 9 years ago

Might be related to https://github.com/bundler/bundler/issues/2813

We have this problem with our testing infrastructure, where I'm unable to build new Docker containers. Since we test in Docker, in order to keep the testing speed up we have pre-prepared containers, which house all the gems already. In case of a new gem, only a little bit needs to be installed instead of the whole thing (reducing lead time). However, while preparing a new container, Bundle seems to encounter a deadlock.

The following script is used to build this container

#!/bin/bash
#
# Map the application in Docker to `/test`, so we have `/test/Gemfile` and `/test/Gemfile.lock`

# Update everything
sudo apt-get update
sudo apt-get install curl -y
sudo apt-get update && sudo apt-get upgrade -y
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install nodejs build-essential libmysqlclient-dev redis-server postgresql libpq-dev git -y
npm install -g bower

# Install rvm
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source /usr/local/rvm/scripts/rvm

# Check the ruby versions
VERSIONS=('2.2.2')

# Install all dependencies
cd /test
for v in $VERSIONS; do rvm install $v && rvm use $v && gem install bundler && bundle install --system && echo "Installed ruby-${v} and gems correctly"; done

# Clear the container a bit
sudo apt-get autoremove && sudo apt-get clean
rm -rf /var/lib/apt/lists/*

Setting the thread number differently with --jobs=X does not make any difference.

We use the following Gemfile, the most recent addition is the pg gem in order to prepare a switch from MariaDB to Postgresql. However, when using incremental builds, this works on our Vagrant machines.

The exact failure as reported by Bundler is

Error details

    fatal: No live threads left. Deadlock?
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/worker.rb:35:in `pop'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/worker.rb:35:in `deq'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/installer/parallel_installer.rb:94:in `process_specs'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/installer/parallel_installer.rb:75:in `call'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/installer/parallel_installer.rb:57:in `call'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/installer.rb:283:in `install_in_parallel'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/installer.rb:91:in `run'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/installer.rb:18:in `install'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/cli/install.rb:107:in `run'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/cli.rb:158:in `install'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/cli.rb:10:in `start'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/bin/bundle:20:in `block in <top (required)>'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
      /usr/local/rvm/gems/ruby-2.2.2/gems/bundler-1.10.1/bin/bundle:18:in `<top (required)>'
      /usr/local/rvm/gems/ruby-2.2.2/bin/bundle:23:in `load'
      /usr/local/rvm/gems/ruby-2.2.2/bin/bundle:23:in `<main>'
      /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `eval'
      /usr/local/rvm/gems/ruby-2.2.2/bin/ruby_executable_hooks:15:in `<main>'

Environment

    Bundler   1.10.1
    Rubygems  2.4.7
    Ruby      2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
    GEM_HOME  /usr/local/rvm/gems/ruby-2.2.2
    GEM_PATH  /usr/local/rvm/gems/ruby-2.2.2:/usr/local/rvm/gems/ruby-2.2.2@global
    RVM       1.26.11 (latest)
    Git       1.9.1
    rubygems-bundler (1.4.4)

Bundler settings

    jobs
      Set for your local app (/test/.bundle/config): "16"

We use the following Gemfile

source 'https://rubygems.org'

gem 'rails',        '4.1.10'
gem 'sass-rails',   '~> 4.0.3'
gem 'uglifier',     '~> 2.7.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jbuilder',     '~> 2.2'

# For sidekqi WEB ui
gem 'sinatra', :require => nil

gem 'execjs'
gem 'therubyracer'
gem 'capybara'
gem 'pundit'
gem 'pg'
gem 'mysql2'

gem 'sidekiq'
gem 'sidekiq-rate-limiter', :require => 'sidekiq-rate-limiter/server'
gem 'sidekiq-limit_fetch'

gem 'aws-sdk', '~> 2.0'
gem 'mail'

gem 'bcrypt', '~> 3.1.9'

gem 'squeel', '~> 1.2.2' # Improves sql syntax

# Fonts
gem 'font-awesome-sass', '~> 4.3.0'

# Payment gems
gem 'ideal-payment',  '~> 1.0.2'
gem 'buckaroo'
gem 'mollie-api-ruby', '>= 1.1.2'

# Passbook gem
gem 'passbook'

# i18n
gem 'gettext_i18n_rails'

# Facebook
gem 'koala', '~> 2.0.0'

# Validate all the things
gem 'validates_email_format_of'

# Keep versioning of everything in the database
gem 'paper_trail'

# And in ES
gem 'logstasher'
gem 'logstash-logger'

group :development do
  # Auto annotate models
  gem 'annotate'

  gem 'rails-erd'
end

group :development, :test do
  gem 'gettext', '>=3.0.2', require: false
  gem 'pry'
  gem 'thin'
  gem 'coffee-rails-source-maps'
  gem 'sqlite3'
  gem 'poltergeist'
  gem 'konacha'
  gem 'sinon-rails'
  gem 'sinon-chai-rails'
end

group :test do
  gem 'codeclimate-test-reporter'
  gem 'rspec-rails',           '~> 3.1.0'
  gem 'faker',                 '~> 1.4.3'
  gem 'rspec_junit_formatter', '~> 0.2.0'

  gem 'simplecov'
  gem 'simplecov-csv'

  gem 'shoulda-matchers',      '~> 2.7.0'
  gem 'factory_girl_rails',    '~> 4.5.0', require: false
end

group :deploy do
  # Render the templates
  gem 'render_anywhere', '0.0.11', require: false
end

group :staging, :production do
  gem 'puma'
end

# These are for the security monitoring
group :development, :test, :deploy do
  gem 'brakeman', require: false
  gem 'dawnscanner'
end

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end
indirect commented 9 years ago

It's possible that this is fixed in 1.10.2. It's also possible that this isn't present in 1.9.10. Either way, you can completely disable threaded installations by passing --jobs=1. Please let us know if any of those work for you!

rogierslag commented 9 years ago

It works! pompom pompom worshippy pompom pompom

I'll try to keep track whether this is finished in 1.10.2. If not I'll notify you :)

ghallberg commented 9 years ago

This seems to happen with 1.10.2 as well, we've got it happening on our Travis build.

segiddins commented 9 years ago

@ghallberg any chance you can provide us with a reproducible example?

ghallberg commented 9 years ago

I'll try at work tomorrow.

On Tue, Jun 02, 2015 at 08:14:08AM -0700, Samuel E. Giddins wrote:

@ghallberg any chance you can provide us with a reproducible example?


Reply to this email directly or view it on GitHub: https://github.com/bundler/bundler/issues/3692#issuecomment-107987425

envygeeks commented 9 years ago

@segiddins

git clone https://github.com/jekyll/jekyll.git
bundle install --path vendor/bundle -j 12

Error happens. This is on 1.10.3

Environment
    Bundler   1.10.3
    Rubygems  2.4.7
    Ruby      2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
    GEM_HOME  /home/jordon/development/jekyll/jekyll/vendor/bundle/ruby/2.2.0
    GEM_PATH  
    Git       1.9.1

Looking at the source it seems to me like your thread pooling is unsafely popping and pushing onto the queue without taking heed to the need for a mutex to make sure everything is in sync and then when it all goes wrong throwing yourself. I could be wrong though and I'd have to write that file with safety to make sure that's the case.

segiddins commented 9 years ago

The queue itself is thread safe, I believe.

-Samuel E. Giddins

On Jun 9, 2015, at 4:32 PM, Jordon Bedwell notifications@github.com wrote:

@segiddins

git clone https://github.com/jekyll/jekyll.git bundle install --path vendor/bundle -j 12 Error happens. This is on 1.10.3

Environment Bundler 1.10.3 Rubygems 2.4.7 Ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] GEM_HOME /home/jordon/development/jekyll/jekyll/vendor/bundle/ruby/2.2.0 GEM_PATH
Git 1.9.1 Looking at the source it seems to me like your thread pooling is unsafely popping and pushing onto the queue without taking heed to the need for a mutex to make sure everything is in sync and then when it all goes wrong throwing yourself. I could be wrong though and I'd have to write that file with safety to make sure that's the case.

— Reply to this email directly or view it on GitHub.

envygeeks commented 9 years ago

I'm gonna be honest, I don't know since we've never really trusted Ruby in that way, we always lock a result onto anything just to ensure because we are heavily defensive programmers here.

indirect commented 9 years ago

@envygeeks Please read the docs for the Queue class. It's defined inside thread.rb, and is thread-safe by definition.

envygeeks commented 9 years ago

No offense but my distrust of Ruby threading will remain and this bug is a primary reason so.

indirect commented 9 years ago

lol, ok then

envygeeks commented 9 years ago

I agree, random errors caused by bad racing in threads is funny.

pducks32 commented 9 years ago

Could it be that you have set more jobs than you can actually manage?

envygeeks commented 9 years ago

@pducks32 I don't assume so. This is happening on an 8 core server with 32gb of ram and a 1gb internet connection and when it's running it's barely using 10% of the total CPU time available to it.

indirect commented 9 years ago

@envygeeks I suggest trying to run 8 jobs or less on a machine with 8 cores, instead of the 12 jobs you say you're running.

TimMoore commented 9 years ago

Could those of you experiencing this issue include the full output from bundle install? I couldn't reproduce this on my MacBook Pro, even with 100 jobs... has anyone seen this problem on anything other than Linux?

envygeeks commented 9 years ago

@indirect we did, then we slowly incremented down and the only thing that got it to work was one job. But what makes it odd is that we ran another build not too long ago (maybe 20 minutes) and it worked with 24 jobs and 12 jobs. I think this has something more to do with RubyGems than it does with bundler itself in that lately we've been having lots of trouble since they switched to fastly and I have a feeling this might be related to that but bundler somehow is not catching it?

@TimMoore how do I do get bundler to spit out everything possible so I can post it to a gist next time it happens?

TimMoore commented 9 years ago

@envygeeks bundle install --verbose prints out a lot of debugging information

TimMoore commented 9 years ago

My hunch (just that at this point) is that this is a mishandling of an error, and masking the original error, so maybe you're right that the original cause could be related to rubygems.org or some other issue unrelated to the actual multi-threading.

pducks32 commented 9 years ago

That's what I thought. We really should make sure our errors show the whole stack. I've had the problem of bundler hiding the underlying cause/errors a few times now.

TimMoore commented 9 years ago

Of course... nobody does that on purpose, but error-handling code can have bugs, too.

To solve this, we either need to find a way for one of the Bundler maintainers to reproduce the problem, or for someone who can reproduce the problem to help diagnose the cause and fix it.

pducks32 commented 9 years ago

I have a similar setup on one of my projects so I'll see if I can reproduce it.

rogierslag commented 9 years ago

Ill give in a shot to reproduce in a few hours too

rogierslag commented 9 years ago

Ill give in a shot to reproduce in a few hours too

myabc commented 9 years ago

I just started hitting this after a recent merge commit. Hope it's ok to append to this issue.

- What did you do?

  I ran the command `/Users/alexbcoles/.gem/ruby/2.1.5/bin/bundle install`

- What did you expect to happen?

  I expected Bundler to...

- What happened instead?

  Instead, what actually happened was...

Error details

    fatal: No live threads left. Deadlock?
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/worker.rb:35:in `pop'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/worker.rb:35:in `deq'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/installer/parallel_installer.rb:94:in `process_specs'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/installer/parallel_installer.rb:75:in `call'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/installer/parallel_installer.rb:57:in `call'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/installer.rb:274:in `install_in_parallel'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/installer.rb:91:in `run'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/installer.rb:18:in `install'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/cli/install.rb:107:in `run'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/cli.rb:162:in `install'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/cli.rb:10:in `start'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/bin/bundle:20:in `block in <top (required)>'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
      /Users/alexbcoles/.gem/ruby/2.1.5/gems/bundler-1.10.4/bin/bundle:18:in `<top (required)>'
      /Users/alexbcoles/.gem/ruby/2.1.5/bin/bundle:23:in `load'
      /Users/alexbcoles/.gem/ruby/2.1.5/bin/bundle:23:in `<main>'

Environment

    Bundler   1.10.4
    Rubygems  2.2.2
    Ruby      2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
    GEM_HOME  /Users/alexbcoles/.gem/ruby/2.1.5
    GEM_PATH  /Users/alexbcoles/.gem/ruby/2.1.5:/Users/alexbcoles/.rubies/ruby-2.1.5/lib/ruby/gems/2.1.0
    Git       2.3.2 (Apple Git-55)

Bundler settings

    without
      Set for your local app (/Users/alexbcoles/git-repos/openproject/.bundle/config): "mysql2"
    jobs
      Set for your local app (/Users/alexbcoles/git-repos/openproject/.bundle/config): "10"
pasha commented 9 years ago

+1 having the same issue, Bundler version 1.10.5

leonardoeloy commented 9 years ago

It works if you set it to a single job:

bundle install --jobs=1

By default, Travis CI uses --jobs=3, so it might fail over there.

segiddins commented 9 years ago

These stack traces don't help much, so if anyone can reliably reproduce the issue, please share a reproduction script with us so we can hunt this down

kieranklaassen commented 9 years ago

I have the same issue with /Users/kieran/.rvm/gems/ruby-2.2.2/bin/bundle install --without production --jobs=4 with Bundler version 1.10.5 on my Mac. Running bundle install --jobs=1 does work.

envygeeks commented 9 years ago

Please everybody who is having this issue read this comment https://github.com/bundler/bundler/issues/3692#issuecomment-110549664 by @TimMoore and try to replicate it and give the output.

barttenbrinke commented 9 years ago

The jobs workaround works. The problem seems to be with native gems, like mysql2 and nokogiri.

rogierslag commented 9 years ago

This testcase failed when I filed the original issue. It doesnt anymore though...

https://github.com/rogierslag/bundler-test-case-3692

julik commented 9 years ago

Confirmed here when building on a Docker container, bundler-1.10.6, report https://gist.github.com/julik/d9f5dee9b2d281aca1dd

To me it looks like there is some place where Queue#pop and Queue#empty? or some such are used concurrently in blocking mode. They happened when calling "empty?" on a Queue while another thread (or threads) were doing a "pop" or also doing an "empty?". I resorted to using a non-blocking pop which made the issue go away (had this in a few libraries of mine, for real).

Thread.new do
  work = q.pop(non_block=true)
rescue ThreadError # instead of checking for q.empty?
   # The queue has been emptied.
end

Don't have time to dive into the Bundler code atm but maybe this could provide a hint @indirect ?

segiddins commented 9 years ago

I'd like to hope this is fixed by https://github.com/bundler/bundler/issues/3800, but since none of the bundler team has ever been able to reproduce this issue, I'm not really sure what we can do here.

envygeeks commented 9 years ago

@segiddins We can reliably reproduce it on our Docker images so I'll test it out sometime this week, thanks for the heads up!

Justin-Park commented 9 years ago

In my case, (I using on RaspberryPI2) I've resolved that problem. I removed all my bundle and Re-Install

indirect commented 9 years ago

Sounds like this is fixed in the latest version, then. Thanks!

cantino commented 9 years ago

This still happens for me on 1.10.6, unfortunately. Fixed by removing ~/.bundle/config.

--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?

  I ran the command `/Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/bundle `

- What did you expect to happen?

  I expected Bundler to...

- What happened instead?

  Instead, what actually happened was...

Error details

    fatal: No live threads left. Deadlock?
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `pop'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `deq'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:93:in `process_specs'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:74:in `call'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:56:in `call'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer.rb:274:in `install_in_parallel'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer.rb:91:in `run'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/cli/install.rb:107:in `run'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/cli.rb:162:in `install'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/bundle:23:in `load'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/bundle:23:in `<main>'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/ruby_executable_hooks:15:in `eval'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/ruby_executable_hooks:15:in `<main>'

Environment

    Bundler   1.10.6
    Rubygems  2.4.6
    Ruby      2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
    GEM_HOME  /Users/andrew/.rvm/gems/ruby-2.2.0@huginn
    GEM_PATH  /Users/andrew/.rvm/gems/ruby-2.2.0@huginn:/Users/andrew/.rvm/gems/ruby-2.2.0@global
    RVM       1.26.11 (latest)
    Git       2.4.6
    rubygems-bundler (1.4.4)

Bundler settings

    jobs
      Set for the current user (/Users/andrew/.bundle/config): "5"
indirect commented 9 years ago

Can you give us repro steps? Or at least tell us what your config that caused the problem was?

On Fri, Sep 11, 2015 at 8:38 AM, Andrew Cantino notifications@github.com wrote:

This still happens for me on 1.10.6, unfortunately. Fixed by removing ~/.bundle/config.

--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?
  I ran the command `/Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/bundle `
- What did you expect to happen?
  I expected Bundler to...
- What happened instead?
  Instead, what actually happened was...
Error details
    fatal: No live threads left. Deadlock?
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `pop'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `deq'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:93:in `process_specs'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:74:in `call'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:56:in `call'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer.rb:274:in `install_in_parallel'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer.rb:91:in `run'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/cli/install.rb:107:in `run'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/cli.rb:162:in `install'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/bundle:23:in `load'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/bundle:23:in `<main>'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/ruby_executable_hooks:15:in `eval'
      /Users/andrew/.rvm/gems/ruby-2.2.0@huginn/bin/ruby_executable_hooks:15:in `<main>'
Environment
    Bundler   1.10.6
    Rubygems  2.4.6
    Ruby      2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
    GEM_HOME  /Users/andrew/.rvm/gems/ruby-2.2.0@huginn
    GEM_PATH  /Users/andrew/.rvm/gems/ruby-2.2.0@huginn:/Users/andrew/.rvm/gems/ruby-2.2.0@global
    RVM       1.26.11 (latest)
    Git       2.4.6
    rubygems-bundler (1.4.4)
Bundler settings
    jobs
      Set for the current user (/Users/andrew/.bundle/config): "5"

Reply to this email directly or view it on GitHub: https://github.com/bundler/bundler/issues/3692#issuecomment-139578989

cantino commented 9 years ago

Hey André. The only config I had was setting jobs to 5 in ~/.bundle/config. I'm sorry that I don't have more details, and when I set that now and re-run, bundle works, but I think it got past an issue by being set to 1 and then successfully bundling. I'll let you know if recurs, but I suspect this bug isn't 100% fixed yet.

envygeeks commented 9 years ago

It happens much less often for us though. Much less.

lukaso commented 8 years ago

Here is the state of all threads when this happens to me. It is happening inside docker and on my mac. jobs is 4.

/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:38:in `ensure in deq'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:38:in `deq'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:93:in `process_specs'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:74:in `call'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:56:in `call'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer.rb:274:in `install_in_parallel'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer.rb:91:in `run'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/cli/install.rb:107:in `run'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/cli.rb:162:in `install'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
/Users/loberhub/.rbenv/versions/2.1.6/bin/bundle:23:in `load'
/Users/loberhub/.rbenv/versions/2.1.6/bin/bundle:23:in `<main>'
=============
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:52:in `pop'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:52:in `block in process_queue'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:51:in `loop'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:51:in `process_queue'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:22:in `block (2 levels) in initialize'
=============
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:52:in `pop'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:52:in `block in process_queue'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:51:in `loop'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:51:in `process_queue'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:22:in `block (2 levels) in initialize'
=============
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:52:in `pop'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:52:in `block in process_queue'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:51:in `loop'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:51:in `process_queue'
/Users/loberhub/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:22:in `block (2 levels) in initialize'
=============
=> [#<Thread:0x007fc3390cb7d8 run>,
 #<Thread:0x007fc339a8c678 sleep>,
 #<Thread:0x007fc339a8c380 sleep>,
 #<Thread:0x007fc339a87fb0 sleep>]
[5] pry(#<Bundler::Worker>)>

I've tracked down the problem, and it appears there's a dependency that's not been satisfied, but isn't in the spec list. Here's my pry session:

[12] pry(#<ParallelInstaller>)> spec.dependencies.reject {|d| installed_specs.include? d.name }
=> [Gem::Dependency.new("therubyracer", Gem::Requirement.new([">= 0"]), :runtime)]
[13] pry(#<ParallelInstaller>)> spec.state
=> :none
[14] pry(#<ParallelInstaller>)> @specs.select{|s| s.name == 'therubyracer'}
=> []

This allows the worker process to go empty, and nothing to be coming, causing the deadlock.

Still not sure why in the parallel case, a dependency is missed.

etehtsea commented 8 years ago

This issue is still reproducible. Please reopen.

[22:31:19][Step 1/1] --- ERROR REPORT TEMPLATE -------------------------------------------------------
[22:31:19][Step 1/1] - What did you do?
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1]   I ran the command `/opt/rbenv/versions/2.2.2/bin/bundle install --jobs=4`
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] - What did you expect to happen?
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1]   I expected Bundler to...
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] - What happened instead?
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1]   Instead, what actually happened was...
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] Error details
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1]     fatal: No live threads left. Deadlock?
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `pop'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `deq'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:93:in `process_specs'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:74:in `call'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:56:in `call'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/installer.rb:274:in `install_in_parallel'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/installer.rb:91:in `run'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/cli/install.rb:107:in `run'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/cli.rb:162:in `install'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/bin/bundle:23:in `load'
[22:31:19][Step 1/1]       /opt/rbenv/versions/2.2.2/bin/bundle:23:in `<main>'
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] Environment
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1]     Bundler   1.10.6
[22:31:19][Step 1/1]     Rubygems  2.4.5
[22:31:19][Step 1/1]     Ruby      2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[22:31:19][Step 1/1]     GEM_HOME  /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0
[22:31:19][Step 1/1]     GEM_PATH  /opt/rbenv/versions/2.2.2/lib/ruby/gems/2.2.0:/root/.gem/ruby/2.2.0
[22:31:19][Step 1/1]     Git       1.8.3.1
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] Bundler settings
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1]     timeout
[22:31:19][Step 1/1]       Set for the current user (/root/.bundle/config): "30"
[22:31:19][Step 1/1]     build.pg
[22:31:19][Step 1/1]       Set for the current user (/root/.bundle/config): "--with-pg-config=/usr/pgsql-9.4/bin/pg_config"
[22:31:19][Step 1/1]     build.pg_array_parser
[22:31:19][Step 1/1]       Set for the current user (/root/.bundle/config): "--with-pg-config=/usr/pgsql-9.4/bin/pg_config"
[22:31:19][Step 1/1]     jobs
[22:31:19][Step 1/1]       Set for your local app (/root/BuildAgent/work/b90cd4ba3c6d76a7/.bundle/config): 4
[22:31:19][Step 1/1] --- TEMPLATE END ----------------------------------------------------------------
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] Unfortunately, an unexpected error occurred, and Bundler cannot continue.
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] First, try this link to see if there are any existing issue reports for this error:
[22:31:19][Step 1/1] https://github.com/bundler/bundler/search?q=No+live+threads+left.+Deadlock%3F&type=Issues
[22:31:19][Step 1/1] 
[22:31:19][Step 1/1] If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
[22:31:19][Step 1/1] https://github.com/bundler/bundler/issues/new
lukaso commented 8 years ago

The fix is merged on master, but has not been backported to 1.10 as far as I can tell.

ecleel commented 8 years ago

The problem still happen

Error details

fatal: No live threads left. Deadlock?
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `pop'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/worker.rb:35:in `deq'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:93:in `process_specs'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:74:in `call'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer/parallel_installer.rb:56:in `call'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer.rb:274:in `install_in_parallel'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer.rb:91:in `run'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/cli/update.rb:51:in `run'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/cli.rb:187:in `update'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
  /Users/ecleel/.rbenv/versions/2.1.2/bin/bundle:23:in `load'
  /Users/ecleel/.rbenv/versions/2.1.2/bin/bundle:23:in `<main>'

Environment

Bundler   1.10.6
Rubygems  2.4.8
Ruby      2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
GEM_HOME  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0
GEM_PATH  /Users/ecleel/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0:/Users/ecleel/.gem/ruby/2.1.0
Git       2.3.2 (Apple Git-55)

Bundler settings

jobs
  Set for the current user (/Users/ecleel/.bundle/config): "4"
gem.coc
  Set for the current user (/Users/ecleel/.bundle/config): "true"
gem.mit
  Set for the current user (/Users/ecleel/.bundle/config): "true"
gem.test
  Set for the current user (/Users/ecleel/.bundle/config): "minitest"
frozen
  Set for your local app (/Users/ecleel/codes/atraxy/.bundle/config): "1"
bin
  Set for your local app (/Users/ecleel/codes/atraxy/.bundle/config): "vendor/bundle/bin"
lukaso commented 8 years ago

@etehtsea @ecleel To fix this problem (until the fix is backported), make sure that the DEPENDENCIES list in your Gemfile.lock has all the required dependencies in it. If it doesn't, you can manually copy them in. This is usually caused by a bad merge so looking at your commit history on Gemfile.lock might give you some clues.

envygeeks commented 8 years ago

@lukaso this isn't always caused by what you mentioned... we used to get that error all the time and we do not commit Gemfile.lock even on our Rails apps, because it's the build servers job to embed it into the Docker image so developers can always test on the latest.

perlun commented 8 years ago

Just ran into the exact same issue with my app, when using parallel jobs (which work fine on JRuby). When trying to bundle install the same gems on MRI, it failed as above. With 1 job at the same time, it worked flawlessly.

Gaolz commented 8 years ago

I had the same issue, but it works with bundle exec.

sambauers commented 8 years ago

Just saw this issue on my local environment in an app with a lot of gems.

Got the same "No live threads left. Deadlock?" error.

Ran bundle install --jobs=1 just once and it worked. After that I can run bundle install or even bundle install --jobs=4 successfully.

I guess running single-threaded once fixes the Gemfile.lock file, and then after that Bundler is happy to multi-thread again.