Closed rogierslag closed 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!
It works!
I'll try to keep track whether this is finished in 1.10.2
. If not I'll notify you :)
This seems to happen with 1.10.2 as well, we've got it happening on our Travis build.
@ghallberg any chance you can provide us with a reproducible example?
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
@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.
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.
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.
@envygeeks Please read the docs for the Queue class. It's defined inside thread.rb
, and is thread-safe by definition.
No offense but my distrust of Ruby threading will remain and this bug is a primary reason so.
lol, ok then
I agree, random errors caused by bad racing in threads is funny.
Could it be that you have set more jobs than you can actually manage?
@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.
@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.
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?
@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?
@envygeeks bundle install --verbose
prints out a lot of debugging information
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.
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.
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.
I have a similar setup on one of my projects so I'll see if I can reproduce it.
Ill give in a shot to reproduce in a few hours too
Ill give in a shot to reproduce in a few hours too
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"
+1 having the same issue, Bundler version 1.10.5
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.
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
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.
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.
The jobs workaround works. The problem seems to be with native gems, like mysql2 and nokogiri.
This testcase failed when I filed the original issue. It doesnt anymore though...
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 ?
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.
@segiddins We can reliably reproduce it on our Docker images so I'll test it out sometime this week, thanks for the heads up!
In my case, (I using on RaspberryPI2) I've resolved that problem. I removed all my bundle and Re-Install
Sounds like this is fixed in the latest version, then. Thanks!
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"
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
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.
It happens much less often for us though. Much less.
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.
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
The fix is merged on master, but has not been backported to 1.10 as far as I can tell.
The problem still happen
What did you do?
I ran the command /Users/ecleel/.rbenv/versions/2.1.2/bin/bundle update sass
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/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"
@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.
@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.
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.
I had the same issue, but it works with bundle exec.
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.
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
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
We use the following Gemfile