Rvm and ruby problem

Hello,

I’ve been trying to debug a problem for a few days. When deploying VMs, Disk resize is not being performed correctly.

After several tests, I was proposed to capture the standard error output when trying to create a VM. I attached the file with the standard error output, where references to the ruby versions of the system and the one installed by rvm are seen.

vm-4640-0.err (34,7 KB)

/usr/local/rvm/gems/ruby-2.5.1/gems/nokogiri-1.6.8.1/lib/nokogiri.rb:124: [BUG] Segmentation fault
ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
...
-- C level backtrace information -------------------------------------------
/lib64/libruby.so.2.0(+0x17997b) [0x7fbb2e2e397b] re.c:2308
/lib64/libruby.so.2.0(+0x64afa) [0x7fbb2e1ceafa] compile.c:884
...

In the system (CentOS 7.0), there are several versions of ruby installed. 2.0 which is the one used by Chef and the 2.5.1 that is installed from rvm for OpenNebula. install_gems was run for version 2.5.1.

For the demons to use the correct version of ruby, the demon configuration files (opennebula.service and opennebula-sunstone.service) were modified as follows:

Environment=MY_RUBY_HOME=/usr/local/rvm/rubies/ruby-2.5.1
Environment=GEM_HOME=/usr/local/rvm/gems/ruby-2.5.1
Environment=GEM_PATH=/usr/local/rvm/gems/ruby-2.5.1:/usr/local/rvm/gems/ruby-2.5.1@global
Environment=PATH=/usr/local/rvm/gems/ruby-2.5.1/bin:/usr/local/rvm/gems/ruby-2.5.1@global/bin:/usr/local/rvm/rubies/ruby-2.5.1/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
ExecStart=/usr/local/rvm/rubies/ruby-2.5.1/bin/ruby /usr/lib/one/sunstone/sunstone-server.rb

gem env displays the following information for the oneadmin user:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.6
  - RUBY VERSION: 2.5.1 (2018-03-29 patchlevel 57) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-2.5.1
  - USER INSTALLATION DIRECTORY: /var/lib/one/.gem/ruby/2.5.0
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-2.5.1/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-2.5.1/bin
  - SPEC CACHE DIRECTORY: /var/lib/one/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/rvm/rubies/ruby-2.5.1/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-2.5.1
     - /usr/local/rvm/rubies/ruby-2.5.1/lib/ruby/gems/2.5.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/rvm/gems/ruby-2.5.1/bin
     - /usr/local/rvm/gems/ruby-2.5.1@global/bin
     - /usr/local/rvm/rubies/ruby-2.5.1/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /opt/ibutils/bin
     - /usr/local/rvm/bin
     - /root/bin

Would anyone know what I am doing wrong or where I am making a mistake?

Thanks in advance.

Hello again,

Trying to solve the problem, I have performed a clean installation of OpenNebula on CentOS 7.0.

Freshly installed the system, if I add the OpenNebula repository and try to install the packages, among the dependencies it warns that it will install the following packages among others (this is the procedure that was followed until now):

 yum install opennebula opennebula-flow opennebula-sunstone opennebula-server opennebula-gate mariadb-server redhat-lsb-core ipset git
 ...
 ruby                                 x86_64  2.0.0.598-25.el7_1          centos7-x86_64           67 k
 ruby-irb                             noarch  2.0.0.598-25.el7_1          centos7-x86_64           88 k
 ruby-libs                            x86_64  2.0.0.598-25.el7_1          centos7-x86_64          2.8 M
 rubygem-bigdecimal                   x86_64  1.2.0-25.el7_1              centos7-x86_64           79 k
 rubygem-io-console                   x86_64  0.4.2-25.el7_1              centos7-x86_64           50 k
 rubygem-json                         x86_64  1.7.7-25.el7_1              centos7-x86_64           75 k
 rubygem-nokogiri                     x86_64  1.6.1-1.el7.1               epel7-x86_64            351 k
 rubygem-psych                        x86_64  2.0.0-25.el7_1              centos7-x86_64           77 k
 rubygem-rdoc                         noarch  4.0.0-25.el7_1              centos7-x86_64          318 k
 rubygems                             noarch  2.0.14-25.el7_1             centos7-x86_64          212 k
 ....

On the other hand, if I first install a newer version of ruby ​​through rvm (ruby 2.5.1), when installing OpenNebula packages, this time among others only warns that it will install the following dependency:

 yum install opennebula opennebula-flow opennebula-sunstone opennebula-server opennebula-gate mariadb-server redhat-lsb-core ipset git
 ...
 rubygem-nokogiri                     x86_64  1.6.1-1.el7.1               epel7-x86_64            351 k
 ...

I understand that at some point, with the installation of ruby those packages will have been installed, since they are in the system.

After installing, I have configured and updated the OpenNebula DB with the production version and tried to deploy a VM with a different disk size than the original image, but still does not do the disk resize at the time of deployment of the VM.

The standard error output of the /var/lib/one/remotes/tm/shared/clone command still shows errors that reference the version of ruby ​​2.0 and its library in /lib64/libruby.so.2.0.

Does anyone identify where I made a mistake?

Best Regards.

Hello again,

I finally found the problem. I explain where I had the error on this topic:

Best Regards.

I also have this problem, but I can figure out how to fix this because that file isn’t there.
Nov 08 15:36:56 blouinfe systemd[1]: Starting OpenNebula Web UI Server...
Nov 08 15:36:56 blouinfe systemd[1]: Started OpenNebula Web UI Server.
Nov 08 15:36:56 blouinfe ruby[5069]: /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/show_exceptions.rb:16: warning: already initialized constant Rack::ShowExceptions::CONTEXT
Nov 08 15:36:56 blouinfe ruby[5069]: /usr/lib/ruby/vendor_ruby/rack/showexceptions.rb:16: warning: previous definition of CONTEXT was here
Nov 08 15:36:56 blouinfe ruby[5069]: /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/show_exceptions.rb:114: warning: already initialized constant Rack::ShowExceptions::TEMPLATE
Nov 08 15:36:56 blouinfe ruby[5069]: /usr/lib/ruby/vendor_ruby/rack/showexceptions.rb:115: warning: previous definition of TEMPLATE was here
Nov 08 15:36:57 blouinfe ruby[5069]: --------------------------------------
Nov 08 15:36:57 blouinfe ruby[5069]: Server configuration
Nov 08 15:36:57 blouinfe ruby[5069]: --------------------------------------
Nov 08 15:36:57 blouinfe ruby[5069]: {:tmpdir=>"/var/tmp",
Nov 08 15:36:57 blouinfe ruby[5069]: :one_xmlrpc=>"http://localhost:2633/RPC2",
Nov 08 15:36:57 blouinfe ruby[5069]: :host=>"127.0.0.1",
Nov 08 15:36:57 blouinfe ruby[5069]: :port=>9869,
Nov 08 15:36:57 blouinfe ruby[5069]: :sessions=>"memory",
Nov 08 15:36:57 blouinfe ruby[5069]: :memcache_host=>"localhost",
Nov 08 15:36:57 blouinfe ruby[5069]: :memcache_port=>11211,
Nov 08 15:36:57 blouinfe ruby[5069]: :memcache_namespace=>"opennebula.sunstone",
Nov 08 15:36:57 blouinfe ruby[5069]: :debug_level=>3,
Nov 08 15:36:57 blouinfe ruby[5069]: :auth=>"opennebula",
Nov 08 15:36:57 blouinfe ruby[5069]: :core_auth=>"cipher",
Nov 08 15:36:57 blouinfe ruby[5069]: :vnc_proxy_port=>29876,
Nov 08 15:36:57 blouinfe ruby[5069]: :vnc_proxy_support_wss=>false,
Nov 08 15:36:57 blouinfe ruby[5069]: :vnc_proxy_cert=>nil,
Nov 08 15:36:57 blouinfe ruby[5069]: :vnc_proxy_key=>nil,
Nov 08 15:36:57 blouinfe ruby[5069]: :vnc_proxy_ipv6=>false,
Nov 08 15:36:57 blouinfe ruby[5069]: :lang=>"en_US",
Nov 08 15:36:57 blouinfe ruby[5069]: :table_order=>"desc",
Nov 08 15:36:57 blouinfe ruby[5069]: :marketplace_url=>"http://marketplace.opennebula.systems/appliance",
Nov 08 15:36:57 blouinfe ruby[5069]: :oneflow_server=>"http://localhost:2474/",
Nov 08 15:36:57 blouinfe ruby[5069]: :instance_types=>
Nov 08 15:36:57 blouinfe ruby[5069]: [{:name=>"small-x1", Nov 08 15:36:57 blouinfe ruby[5069]: :cpu=>1,
Nov 08 15:36:57 blouinfe ruby[5069]: :vcpu=>1, Nov 08 15:36:57 blouinfe ruby[5069]: :memory=>128,
Nov 08 15:36:57 blouinfe ruby[5069]: :description=>"Very small instance for testing purposes"}, Nov 08 15:36:57 blouinfe ruby[5069]: {:name=>“small-x2”,
Nov 08 15:36:57 blouinfe ruby[5069]: :cpu=>2, Nov 08 15:36:57 blouinfe ruby[5069]: :vcpu=>2,
Nov 08 15:36:57 blouinfe ruby[5069]: :memory=>512, Nov 08 15:36:57 blouinfe ruby[5069]: :description=>“Small instance for testing multi-core applications”},
Nov 08 15:36:57 blouinfe ruby[5069]: {:name=>"medium-x2", Nov 08 15:36:57 blouinfe ruby[5069]: :cpu=>2,
Nov 08 15:36:57 blouinfe ruby[5069]: :vcpu=>2, Nov 08 15:36:57 blouinfe ruby[5069]: :memory=>1024,
Nov 08 15:36:57 blouinfe ruby[5069]: :description=>"General purpose instance for low-load servers"}, Nov 08 15:36:57 blouinfe ruby[5069]: {:name=>“medium-x4”,
Nov 08 15:36:57 blouinfe ruby[5069]: :cpu=>4, Nov 08 15:36:57 blouinfe ruby[5069]: :vcpu=>4,
Nov 08 15:36:57 blouinfe ruby[5069]: :memory=>2048, Nov 08 15:36:57 blouinfe ruby[5069]: :description=>“General purpose instance for medium-load servers”},
Nov 08 15:36:57 blouinfe ruby[5069]: {:name=>"large-x4", Nov 08 15:36:57 blouinfe ruby[5069]: :cpu=>4,
Nov 08 15:36:57 blouinfe ruby[5069]: :vcpu=>4, Nov 08 15:36:57 blouinfe ruby[5069]: :memory=>4096,
Nov 08 15:36:57 blouinfe ruby[5069]: :description=>"General purpose instance for servers"}, Nov 08 15:36:57 blouinfe ruby[5069]: {:name=>“large-x8”,
Nov 08 15:36:57 blouinfe ruby[5069]: :cpu=>8, Nov 08 15:36:57 blouinfe ruby[5069]: :vcpu=>8,
Nov 08 15:36:57 blouinfe ruby[5069]: :memory=>8192, Nov 08 15:36:57 blouinfe ruby[5069]: :description=>“General purpose instance for high-load servers”}], Nov 08 15:36:57 blouinfe ruby[5069]: :routes=>[“oneflow”, “vcenter”, “support”]} Nov 08 15:36:57 blouinfe ruby[5069]: --------------------------------------
Nov 08 15:36:57 blouinfe ruby[5069]: /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract
id.rb:202:in <class:Persisted>: uninitialized
constantRack::Session::Abstract::Persisted::RACK_SESSION (NameError)
Nov 08 15:36:57 blouinfe ruby[5069]: Did you mean? Rack::Session
Nov 08 15:36:57 blouinfe ruby[5069]: from /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:200:in module:Abstract Nov 08 15:36:57 blouinfe ruby[5069]: from /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:14:in <module:Session>'
Nov 08 15:36:57 blouinfe ruby[5069]: from /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:12:in module:Rack Nov 08 15:36:57 blouinfe ruby[5069]: from /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/abstract/id.rb:10:in <top (required)>'
Nov 08 15:36:57 blouinfe ruby[5069]: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require’ Nov 08 15:36:57 blouinfe ruby[5069]: from /var/lib/gems/2.5.0/gems/rack-2.0.7/lib/rack/session/pool.rb:6:in <top (required)>'
Nov 08 15:36:57 blouinfe ruby[5069]: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require’ Nov 08 15:36:57 blouinfe ruby[5069]: from /usr/lib/one/sunstone/sunstone-server.rb:94:in <main>'
Nov 08 15:36:57 blouinfe systemd[1]: opennebula-sunstone.service: Main process exited, code=exited, status=1/FAILURE
Nov 08 15:36:58 blouinfe systemd[1]: opennebula-sunstone.service: Failed with result 'exit-code'.