aces / cbrain

CBRAIN is a flexible Ruby on Rails framework for accessing and processing of large data on high-performance computing infrastructures.
GNU General Public License v3.0
71 stars 43 forks source link

Bourreau could not be started: cgroup_entry (LoadError) #1005

Open DaveMtl opened 4 years ago

DaveMtl commented 4 years ago

Hi, I'm setting up a development environment on a local machine and I get an error when starting the Bourreau.

[2020-09-04 12:30:20 EDT] Remote control command for my_bourreau_app failed.
Command: cd /home/cbrain/cbrain/Bourreau; bundle exec ruby /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl start -e development -p 1026 2>&1
Output:
---Start Of Output---
/home/cbrain/.rvm/rubies/ruby-2.4.9/lib/ruby/site_ruby/2.4.0/sys/proctable.rb:2:in 'require_relative': cannot load such file -- /home/cbrain/.rvm/rubies/ruby-2.4.9/lib/ruby/site_ruby/2.4.0/sys/proctable/cgroup_entry (LoadError)
from /home/cbrain/.rvm/rubies/ruby-2.4.9/lib/ruby/site_ruby/2.4.0/sys/proctable.rb:2:in '<top (required)>'
from /home/cbrain/cbrain/Bourreau/lib/ssh_master.rb:31:in 'require'
from /home/cbrain/cbrain/Bourreau/lib/ssh_master.rb:31:in '<top (required)>'
from /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl:71:in 'require'
from /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl:71:in '<main>'
---End Of Output---

As suggested in #265, I tried changing the version of proctable in the Gemfile of Bourreau to:

gem "sys-proctable", :git => 'git://github.com/djberg96/sys-proctable.git', :ref => "ac047b6"

but the error remained, (I did run the command bundle install).

Since the Bourreau and BrainPortal runs on the same machine, I also tried to change it in the Gemfile of BrainPortal but then BrainPortal won't start because it can't find cgroup_entry...

Bundle list for Bourreau is:

Using rake 13.0.1
Using concurrent-ruby 1.1.7
Using i18n 1.8.5
Using minitest 5.14.2
Using thread_safe 0.3.6
Using tzinfo 1.2.7
Using activesupport 5.0.7.2
Using builder 3.2.4
Using erubis 2.7.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.10
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.7.0
Using rails-html-sanitizer 1.3.0
Using actionview 5.0.7.2
Using rack 2.2.3
Using rack-test 0.6.3
Using actionpack 5.0.7.2
Using nio4r 2.5.2
Using websocket-extensions 0.1.5
Using websocket-driver 0.6.5
Using actioncable 5.0.7.2
Using globalid 0.4.2
Using activejob 5.0.7.2
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailer 5.0.7.2
Using method_source 1.0.0
Using thor 1.0.1
Using railties 5.0.7.2
Using actionpack-xml_parser 2.0.1
Using activemodel 5.0.7.2
Using activemodel-serializers-xml 1.0.2
Using arel 7.1.4
Using activerecord 5.0.7.2
Using activeresource 5.1.1
Using public_suffix 4.0.6
Using addressable 2.7.0
Using aws-eventstream 1.1.0
Using aws-partitions 1.364.0
Using aws-sigv4 1.2.2
Using jmespath 1.4.0
Using aws-sdk-core 3.105.0
Using aws-sdk-kms 1.37.0
Using aws-sdk-s3 1.79.1
Using bcrypt_pbkdf 1.0.1
Using bundler 1.17.3
Using byebug 11.1.3
Using coderay 1.1.3
Using database_cleaner 1.8.5
Using diff-lcs 1.4.4
Using ed25519 1.2.4
Using factory_bot 5.2.0
Using factory_bot_rails 5.2.0
Using ffi 1.13.1
Using hirb 0.7.3
Using json-schema 2.8.1
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using listen 3.0.8
Using log4r 1.1.10
Using looksee 4.2.0
Using mysql2 0.4.10
Using net-ssh 6.1.0
Using net-sftp 3.0.0
Using pbkdf2-ruby 0.2.1
Using pry 0.13.1
Using pry-byebug 3.9.0
Using puma 4.3.5
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.0.7.2
Using rails-controller-testing 1.0.5
Using rbnacl 7.1.1
Using rbnacl-libsodium 1.0.16
Using rspec-support 3.9.3
Using rspec-core 3.9.2
Using rspec-expectations 3.9.2
Using rspec-mocks 3.9.1
Using rspec 3.9.0
Using rspec-activemodel-mocks 1.1.0
Using rspec-collection_matchers 1.2.0
Using rspec-rails 4.0.1
Using sys-proctable 1.2.6
Using wirble 0.1.3

rvm info returns:

ruby-2.4.9:

  system:
    uname:        "Linux cbrain-VirtualBox 5.4.0-45-generic #49~18.04.2-Ubuntu SMP Wed Aug 26 16:29:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux"
    name:         "Ubuntu"
    version:      "18.04"
    architecture: "x86_64"
    bash:         "/bin/bash => GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)"
    zsh:          " => not installed"
    remote_path:  "ubuntu/18.04/x86_64"

  rvm:
    version:      "1.29.10 (latest)"
    updated:      "21 hours 20 minutes 54 seconds ago"
    path:         "/home/cbrain/.rvm"
    autolibs:     "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

  ruby:
    interpreter:  "ruby"
    version:      "2.4.9p362"
    date:         "2019-10-02"
    platform:     "x86_64-linux"
    patchlevel:   "2019-10-02 revision 67824"
    full_version: "ruby 2.4.9p362 (2019-10-02 revision 67824) [x86_64-linux]"

  homes:
    gem:          "/home/cbrain/.rvm/gems/ruby-2.4.9"
    ruby:         "/home/cbrain/.rvm/rubies/ruby-2.4.9"

  binaries:
    ruby:         "/home/cbrain/.rvm/rubies/ruby-2.4.9/bin/ruby"
    irb:          "/home/cbrain/.rvm/rubies/ruby-2.4.9/bin/irb"
    gem:          "/home/cbrain/.rvm/rubies/ruby-2.4.9/bin/gem"
    rake:         "/home/cbrain/.rvm/gems/ruby-2.4.9/bin/rake"

  environment:
    PATH:         "/home/cbrain/.rvm/gems/ruby-2.4.9/bin:/home/cbrain/.rvm/gems/ruby-2.4.9@global/bin:/home/cbrain/.rvm/rubies/ruby-2.4.9/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/cbrain/.rvm/bin:/home/cbrain/.rvm/bin:/home/cbrain/.rvm/bin"
    GEM_HOME:     "/home/cbrain/.rvm/gems/ruby-2.4.9"
    GEM_PATH:     "/home/cbrain/.rvm/gems/ruby-2.4.9:/home/cbrain/.rvm/gems/ruby-2.4.9@global"
    MY_RUBY_HOME: "/home/cbrain/.rvm/rubies/ruby-2.4.9"
    IRBRC:        "/home/cbrain/.rvm/rubies/ruby-2.4.9/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
natacha-beck commented 4 years ago

Have you tried the following:

  bundle show sys-proctable
  (copy the directory shown)
  cd /to/that/directory
  rake install

Source: https://github.com/aces/cbrain/wiki/Common-Setup#iv-gems

prioux commented 4 years ago

Yeah, that was my first suggestion. The Sys::Proctable gem requires a manual installation step that can cause exactly that problem if it's skipped.

First, cd to the Bourreau subdirectory then type bundle show sys-proctable; it will tell you where the bundler installed the gem. Go there, and run 'rake install`.

DaveMtl commented 4 years ago

Thanks for the fast answer.

I still have the same problem after trying the solution.

Maybe I just missed another step. I'll try reinstalling from scratch and see if works better.

prioux commented 4 years ago

cgroup_entry.rb is just one of the ruby files in the sys-proctable gem, it seems weird that it can't load it after installation.

DaveMtl commented 4 years ago

Sorry for closing the issue, that was a misclick...

I'm not familiar with Ruby and I had a few hiccups while following the installation so I might have done something I shouldn't have. I'll let you know how it goes after trying again.

Thanks for the help.

DaveMtl commented 4 years ago

Hi again,

I reinstalled everything from scratch and still have the same problem:

[2020-09-04 16:21:05 EDT] Remote control command for BourreauSimpleApp failed.
Command: cd /home/cbrain/cbrain/Bourreau; bundle exec ruby /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl start -e development -p 1026 2>&1
Output:
---Start Of Output---
/home/cbrain/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/sys/proctable.rb:2:in `require_relative': cannot load such file -- /home/cbrain/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/sys/proctable/cgroup_entry (LoadError)
from /home/cbrain/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/sys/proctable.rb:2:in `<top (required)>'
from /home/cbrain/cbrain/Bourreau/lib/ssh_master.rb:31:in `require'
from /home/cbrain/cbrain/Bourreau/lib/ssh_master.rb:31:in `<top (required)>'
from /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl:71:in `require'
from /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl:71:in `<main>'
---End Of Output---

Any other suggestions?

prioux commented 4 years ago

OK, I'm going to suggest some more 'clean up and try again' commands. You can type the following commands exactly as they are, they don't need any adjustments.

These commands only attempt to clean up the gems directories, they won't affect the CBRAIN codebase itself.

cd  /home/cbrain/cbrain/BrainPortal
bundle clean --force

cd /home/cbrain/cbrain/Bourreau
bundle clean --force

cd  /home/cbrain/cbrain/BrainPortal
rm Gemfile.lock
gem uninstall sys-proctable
bundle install
cd $(bundle show sys-proctable)
rake install

cd /home/cbrain/cbrain/Bourreau
rm Gemfile.lock
bundle install
cd $(bundle show sys-proctable)
rake install
DaveMtl commented 4 years ago

Thanks again,

I get the same error:

[2020-09-04 17:03:39 EDT] Remote control command for BourreauSimpleApp failed.
Command: cd /home/cbrain/cbrain/Bourreau; bundle exec ruby /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl start -e development -p 1026 2>&1
Output:
---Start Of Output---
/home/cbrain/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/sys/proctable.rb:2:in `require_relative': cannot load such file -- /home/cbrain/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/sys/proctable/cgroup_entry (LoadError)
from /home/cbrain/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/sys/proctable.rb:2:in `<top (required)>'
from /home/cbrain/cbrain/Bourreau/lib/ssh_master.rb:31:in `require'
from /home/cbrain/cbrain/Bourreau/lib/ssh_master.rb:31:in `<top (required)>'
from /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl:71:in `require'
from /home/cbrain/cbrain/Bourreau/script/cbrain_remote_ctl:71:in `<main>'
---End Of Output---

Some remarks: In BrainPortal, bundle clean --force didnt return anything. In Bourreau, bundle clean --force returned:

Removing pagy (3.8.3)
Removing thin (1.7.2)
Removing eventmachine (1.2.7)
Removing jquery-ui-rails (6.0.1)
Removing tilt (2.0.10)
Removing coffee-rails (4.2.2)
Removing daemons (1.3.1)
Removing jquery-rails (4.4.0)
Removing json (2.3.1)
Removing execjs (2.7.0)
Removing libv8-3.16.14.19-x86_64 (linux)
Removing uglifier (4.2.0)
Removing jquery-form-rails (1.0.1)
Removing ref (2.0.0)
Removing sassc-rails (2.1.2)
Removing will_paginate (3.3.0)
Removing coffee-script-source (1.12.2)
Removing ethon (0.12.0)
Removing typhoeus (1.4.0)
Removing coffee-script (2.4.1)
Removing sassc (2.4.0)
Removing therubyracer (0.12.3)
Removing cbrain-client-gem (fba4ccf3fb0b)
Removing zenodo-client-gem (daa82325fa4f)

Something I forgot to mention is that I had to add gem "thin" to the Gemfile of BrainPortal. The server wasn't starting without it.

DaveMtl commented 3 years ago

Hi, I managed to start the Bourreau by copying the content of the proctable folder from: ~/.rvm/gems/ruby-2.4.1/gems/sys-proctable-1.2.6/lib/linux/sys to: ~/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0/sys

For some reason, the install location of the bundle for Bourreau isn't the same as the location used at run time.

I don't know if it's related but when I run the command rake cbrain:plugins:install:all I get the message: No public assets need to be installed for a Bourreau All done. I thought it was odd the command didn't do anything.

natacha-beck commented 1 year ago

I think this one can be closed ? @bryancaron ?