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

Deadlock detected in ancient Rails app. #5378

Closed
darrint opened this issue Jan 28, 2017 · 8 comments · Fixed by #5571
Closed

Deadlock detected in ancient Rails app. #5378

darrint opened this issue Jan 28, 2017 · 8 comments · Fixed by #5571

Comments

@darrint
Copy link

darrint commented Jan 28, 2017

Error Report

Questions

Please fill out answers to these questions, it'll help us figure out
why things are going wrong.

  • What did you do?

    I ran the command /home/darrint/.rvm/gems/ruby-1.9.3-p551/bin/bundle install

  • What did you expect to happen?

    I expected Bundler to install dependencies for this ancient rails app.

  • What happened instead?

    Deadlock detected error.

  • Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?

    I tried messing with the jobs setting and removing the bundle and reinstalling.

  • Have you read our issues document, https://github.com/bundler/bundler/blob/master/ISSUES.md?

    Yep
    ...

Backtrace

fatal: deadlock detected
  /home/darrint/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/thread.rb:189:in `sleep'
  /home/darrint/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/thread.rb:189:in `block in pop'
  <internal:prelude>:10:in `synchronize'
  /home/darrint/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/thread.rb:184:in `pop'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/worker.rb:43:in `deq'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/installer/parallel_installer.rb:131:in `proc
ess_specs'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/installer/parallel_installer.rb:102:in `call
'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/installer/parallel_installer.rb:77:in `call'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/installer.rb:199:in `install_in_parallel'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/installer.rb:166:in `install'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/installer.rb:80:in `run'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/installer.rb:24:in `install'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/cli/install.rb:70:in `run'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/cli.rb:181:in `block in install'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/settings.rb:99:in `temporary'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/cli.rb:180:in `install'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `i
nvoke_command'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/cli.rb:20:in `dispatch'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/cli.rb:11:in `start'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/exe/bundle:32:in `block in <top (required)>'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/lib/bundler/friendly_errors.rb:121:in `with_friendly_err
ors'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/gems/bundler-1.14.3/exe/bundle:24:in `<top (required)>'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/bin/bundle:22:in `load'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/bin/bundle:22:in `<main>'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval'
  /home/darrint/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'

Environment

Bundler   1.14.3
Rubygems  2.6.10
Ruby      1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
GEM_HOME  /home/darrint/herring/bundle/ruby/1.9.1
GEM_PATH
RVM       1.28.0 (latest)
Git       2.11.0
Platform  x86_64-linux
OpenSSL   OpenSSL 1.0.2k  26 Jan 2017

Bundler settings

jobs
  Set for the current user (/home/darrint/.bundle/config): "1"
path
  Set for your local app (/home/darrint/herring/upload/.bundle/config): "../bundle"
#bundle_disable_shared_gems
  You have not configured a value for `#bundle_disable_shared_gems`
disable_shared_gems
  Set for your local app (/home/darrint/herring/upload/.bundle/config): true
@segiddins
Copy link
Member

Can you please also include your Gemfile & lockfile so we can attempt to reproduce the issue? Thanks!

@darrint
Copy link
Author

darrint commented Jan 28, 2017

Gemfile:

source 'https://rubygems.org'
#gem "rails", "2.3.8"
gem "rails", "~> 3.0"
gem "sqlite3-ruby", "1.2.5"
gem "mysql2"
gem "paperclip"
gem "flt", "1.1.1"
gem "dynamic_form", "~> 1.0"
gem "yaml_db"
gem "parslet"
gem "httpclient"
gem "rubyntlm"
gem "mini_backtrace"
gem "comma", "~> 3.0"
gem "tzinfo", "~> 0.3.31"
gem "validates_timeliness", "~> 3.0.2"
gem "kaminari", "~> 0.14.1"

gem "rails-latex", :git => "https://github.com/jacott/rails-latex.git",
    :ref => "b9831420"
gem "spork-testunit",
    :git => "https://github.com/sporkrb/spork-testunit.git",
    :ref => "349119cd"
gem "spork", "~> 0.9.0.rc9"

gem "tiny_tds", "0.5.1"
gem "activerecord-sqlserver-adapter", "3.0.14"
gem "activerecord-sybase-adapter",
    :git => "https://github.com/ifad/activerecord-sybase-adapter.git",
    :ref => "0cf32d0c56"

gem "arel-sybase-visitor",
    :git => "https://github.com/ifad/arel-sybase-visitor.git",
    :ref => "c81cde86f0"

group :development, :test do
  gem "ruby-prof"
  # Don't require factory girl to avoid problems with spork.
  gem "factory_girl_rails", :require => false
  gem "vlad", "2.0.0"
  gem "vlad-hg", "2.0.2"
end

Gemfile.lock

GIT
  remote: git://github.com/ifad/activerecord-sybase-adapter.git
  revision: 0cf32d0c563e1fcc8d8466aa19815a0f2d206f04
  ref: 0cf32d0c56
  specs:
    activerecord-sybase-adapter (3.0.0)
      tiny_tds (~> 0.5)

GIT
  remote: git://github.com/ifad/arel-sybase-visitor.git
  revision: c81cde86f01eae9445de6a04e91b744393733d63
  ref: c81cde86f0
  specs:
    arel-sybase-visitor (0.1.0)

GIT
  remote: git://github.com/jacott/rails-latex.git
  revision: b9831420b929ae408f87ec43296304ffebc11f69
  ref: b9831420
  specs:
    rails-latex (1.0.1)
      rails (>= 3.0.0)

GIT
  remote: git://github.com/sporkrb/spork-testunit.git
  revision: 349119cd1518564ab00731739078eee95b93934f
  ref: 349119cd
  specs:
    spork-testunit (0.0.7)
      spork (>= 0.6.0)

GEM
  remote: http://rubygems.org/
  specs:
    abstract (1.0.0)
    actionmailer (3.0.4)
      actionpack (= 3.0.4)
      mail (~> 2.2.15)
    actionpack (3.0.4)
      activemodel (= 3.0.4)
      activesupport (= 3.0.4)
      builder (~> 2.1.2)
      erubis (~> 2.6.6)
      i18n (~> 0.4)
      rack (~> 1.2.1)
      rack-mount (~> 0.6.13)
      rack-test (~> 0.5.7)
      tzinfo (~> 0.3.23)
    activemodel (3.0.4)
      activesupport (= 3.0.4)
      builder (~> 2.1.2)
      i18n (~> 0.4)
    activerecord (3.0.4)
      activemodel (= 3.0.4)
      activesupport (= 3.0.4)
      arel (~> 2.0.2)
      tzinfo (~> 0.3.23)
    activerecord-sqlserver-adapter (3.0.14)
      activerecord (~> 3.0.3)
      arel (~> 2.0.7)
    activeresource (3.0.4)
      activemodel (= 3.0.4)
      activesupport (= 3.0.4)
    activesupport (3.0.4)
    arel (2.0.8)
    blankslate (2.1.2.3)
    builder (2.1.2)
    comma (3.0.3)
    dynamic_form (1.1.3)
    erubis (2.6.6)
      abstract (>= 1.0.0)
    factory_girl (1.3.3)
    factory_girl_rails (1.0.1)
      factory_girl (~> 1.3)
      railties (>= 3.0.0)
    flt (1.1.1)
    httpclient (2.2.0)
    i18n (0.5.0)
    kaminari (0.14.1)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    mail (2.2.15)
      activesupport (>= 2.3.6)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.16)
    mini_backtrace (0.1.1)
      minitest (> 1.2.0)
      rails (> 2.3.2)
    minitest (2.2.2)
    mysql2 (0.2.6)
    open4 (0.9.6)
    paperclip (2.3.8)
      activerecord
      activesupport
    parslet (1.1.1)
      blankslate (~> 2.0)
    polyglot (0.3.1)
    rack (1.2.1)
    rack-mount (0.6.13)
      rack (>= 1.0.0)
    rack-test (0.5.7)
      rack (>= 1.0)
    rails (3.0.4)
      actionmailer (= 3.0.4)
      actionpack (= 3.0.4)
      activerecord (= 3.0.4)
      activeresource (= 3.0.4)
      activesupport (= 3.0.4)
      bundler (~> 1.0)
      railties (= 3.0.4)
    railties (3.0.4)
      actionpack (= 3.0.4)
      activesupport (= 3.0.4)
      rake (>= 0.8.7)
      thor (~> 0.14.4)
    rake (0.8.7)
    ruby-prof (0.9.2)
    rubyntlm (0.1.1)
    spork (0.9.0.rc9)
    sqlite3-ruby (1.2.5)
    thor (0.14.6)
    timeliness (0.3.6)
    tiny_tds (0.5.1)
    treetop (1.4.9)
      polyglot (>= 0.3.1)
    tzinfo (0.3.33)
    validates_timeliness (3.0.12)
      timeliness (~> 0.3.6)
    vlad (2.0.0)
      open4 (~> 0.9.0)
      rake (~> 0.8.0)
    vlad-hg (2.0.2)
    yaml_db (0.2.0)

PLATFORMS
  ruby

DEPENDENCIES
  activerecord-sqlserver-adapter (= 3.0.14)
  activerecord-sybase-adapter!
  arel-sybase-visitor!
  comma (~> 3.0)
  dynamic_form (~> 1.0)
  factory_girl_rails
  flt (= 1.1.1)
  httpclient
  kaminari (~> 0.14.1)
  mini_backtrace
  mysql2
  paperclip
  parslet
  rails (~> 3.0)
  rails-latex!
  ruby-prof
  rubyntlm
  spork (~> 0.9.0.rc9)
  spork-testunit!
  sqlite3-ruby (= 1.2.5)
  tiny_tds (= 0.5.1)
  tzinfo (~> 0.3.31)
  validates_timeliness (~> 3.0.2)
  vlad (= 2.0.0)
  vlad-hg (= 2.0.2)
  yaml_db

@TheKevJames
Copy link

Chiming in with more info to hopefully help debug this: I've been recently getting this issue on all of my attempted test runs here on travis. These tests show the same error on rubies 1.9.3, 2.2.5, and 2.3.1, on OSX 10.10, 10.11, and 10.12. Haven't really started diving into these issues yet, but hopefully these runs will be of help.

@TheKevJames
Copy link

A couple other notes: looks like this may or may not be a re-surfacing of issue #3692. As noted in that thread, the issue was (maybe?) fixed for bundler 1.11 but seems to still be reproducible after the fact. My linked builds, at least show this error across bundler versions 1.9.8, 1.13.2, and 1.14.3 (maybe more -- I did not check version for each test run).

For anyone hit by the same bug: the linked thread recommended --jobs 1 as a workaround.

@segiddins
Copy link
Member

See https://travis-ci.org/TheKevJames/puppet-homebrew/jobs/195761209#L108 -- this is the same as another recent issue opened about facter but I don't have the link handy right now

@darrint
Copy link
Author

darrint commented Jan 30, 2017

@segiddins Are you saying if I manage to address the warning the deadlock will go away?

@segiddins
Copy link
Member

No it's a bug in bundler but it's related to another issue we have open

@segiddins
Copy link
Member

Probably the same root cause as #5339

bundlerbot added a commit that referenced this issue Apr 14, 2017
Avoid deadlocking when installing with a lockfile missing dependencies

Closes #5378.
Closes #5480.
Closes #5519.
Closes #5526.
Closes #5529.
Closes #5549.
Closes #5572.

Not the ideal fix (the error message could be more helpful in pointing out which issue is being faced), but overall better than deadlocking.
philipefarias added a commit to dleemoo/rc-images that referenced this issue Jun 12, 2017
Changes since last version used (1.14.6):

== 1.15.1 (2017-06-02)

Bugfixes:

  - `bundle lock --update GEM` will fail gracefully when the gem is not in the lockfile (rubygems/bundler#5693, @segiddins)
  - `bundle init --gemspec` will fail gracefully when the gemspec is invalid (@colby-swandale)
  - `bundle install --force` works when the gemfile contains git gems (rubygems/bundler#5678, @segiddins)
  - `bundle env` will print well-formed markdown when there are no settings (rubygems/bundler#5677, @segiddins)

== 1.15.0 (2017-05-19)

This space intentionally left blank.

== 1.15.0.pre.4 (2017-05-10)

Bugfixes:

  - avoid conflicts when `Gem.finish_resolve` is called after the bundle has been set up (@segiddins)
  - ensure that `Gem::Specification.find_by_name` always returns an object that can have `#to_spec` called on it (rubygems/bundler#5592, @jules2689)

== 1.15.0.pre.3 (2017-04-30)

Bugfixes:

  - avoid redundant blank lines in the readme generated by `bundle gem` (@koic)
  - ensure that `open-uri` is not loaded after `bundle exec` (@segiddins)
  - print a helpful error message when an activated default gem conflicts with
    a gem in the gemfile (@segiddins)
  - only shorten `ref` option for git gems when it is a SHA (rubygems/bundler#5620, @segiddins)

== 1.15.0.pre.2 (2017-04-23)

Bugfixes:

  - ensure pre-existing fit caches are updated from remote sources (rubygems/bundler#5423, @alextaylor000)
  - avoid duplicating specs in the lockfile after updating with the gem uninstalled (rubygems/bundler#5599, @segiddins)
  - ensure git gems have their extensions available at runtime (rubygems/bundler#5594, @jules2689, @segiddins)

== 1.15.0.pre.1 (2017-04-16)

Features:

  - print a notification when a newer version of bundler is available (rubygems/bundler#4683, @segiddins)
  - add man pages for all bundler commands (rubygems/bundler#4988, @feministy)
  - add the `bundle info` command (@fredrb, @colby-swandale)
  - all files created with `bundle gem` comply with the bundler style guide (@zachahn)
  - if installing a gem fails, print out the reason the gem needed to be installed (rubygems/bundler#5078, @segiddins)
  - allow setting `gem.push_key` to set the key used when running `rake release` (@DTrierweiler)
  - print gem versions that are regressing during `bundle update` in yellow (rubygems/bundler#5506, @brchristian)
  - avoid printing extraneous dependencies when the resolver encounters a conflict (@segiddins)
  - add the `bundle issue` command that prints instructions for reporting issues (rubygems/bundler#4871, @jonathanpike)
  - add `--source` and `--group` options to the `bundle inject` command (rubygems/bundler#5452, @Shekharrajak)
  - add the `bundle add` command to add a gem to the gemfile (@denniss)
  - add the `bundle pristine` command to re-install gems from cached `.gem` files (rubygems/bundler#4509, @denniss)
  - add a `--parseable` option for `bundle config` (@JuanitoFatas, @colby-swandale)

Performance:

  - speed up gemfile initialization by storing locked dependencies as a hash (@jules2689)
  - speed up gemfile initialization by making locked dependency comparison lazy, avoiding object allocation (@jules2689)
  - only validate git gems when they are downloaded, instead of every time `Bundler.setup` is run (@segiddins)
  - avoid regenerating the lockfile when nothing has changed (@segiddins)
  - avoid diffing large arrays when no sources in the gemfile have changed (@segiddins)
  - avoid evaluating full gemspecs when running with RubyGems 2.5+ (@segiddins)

Bugfixes:

  - fix cases where `bundle update` would print a resolver conflict instead of updating the selected gems (rubygems/bundler#5031, rubygems/bundler#5095, @segiddins)
  - print out a stack trace after an interrupt when running in debug mode (@segiddins)
  - print out when bundler starts fetching a gem from a remote server (@segiddins)
  - fix `bundle gem` failing when `git` is unavailable (rubygems/bundler#5458, @Shekharrajak, @colby-swandale)
  - suggest the appropriate command to unfreeze a bundle (rubygems/bundler#5009, @denniss)
  - ensure nested calls to `bundle exec` resolve default gems correctly (rubygems/bundler#5500, @segiddins)
  - ensure that a plugin failing to install doesn't uninstall other plugins (@kerrizor, @roseaboveit)
  - ensure `socket` is required before being referenced (rubygems/bundler#5533, @rafaelfranca)
  - allow running `bundle outdated` when gems aren't installed locally (rubygems/bundler#5553, @segiddins)
  - print a helpful error when `bundle exec`ing to a gem that isn't included in the bundle (rubygems/bundler#5487, @segiddins)
  - print an error message when a non-git gem is given a `branch` option (rubygems/bundler#5530, @colby-swandale)
  - allow interrupts to exit the process after gems have been installed (@segiddins)
  - print the underlying error when downloading gem metadata fails (rubygems/bundler#5579, @segiddins)
  - avoid deadlocking when installing with a lockfile that is missing dependencies (rubygems/bundler#5378, rubygems/bundler#5480, rubygems/bundler#5519, rubygems/bundler#5526, rubygems/bundler#5529, rubygems/bundler#5549, rubygems/bundler#5572, @segiddins)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants