1

I encountered a problem during database migration from Opennebula 5.10 to 5.12. After onedb upgrade command I see an error

Attemp to run migrators compiled in other versionCompiled: 2.0, installed: 2.6

The function which generates this:

def load_bytecode(file)
    file = File.open(file, 'rb')
    data = file.read

    file.close

    data = Zlib::Inflate.inflate(data)
    data = Marshal.load(data)

    c_ruby_version = Gem::Version.new(data.to_a[1..2].join('.'))
    i_ruby_version = Gem::Version.new(RUBY_VERSION.split('.')[0..1].join('.'))

    if c_ruby_version != i_ruby_version
        raise 'Attemp to run migrators compiled in other version' \
            "Compiled: #{c_ruby_version}, installed: #{i_ruby_version}"
    end

    new_iseq = RubyVM::InstructionSequence.load(data)
    new_iseq.eval
end

I thought that's because i had different versions of ruby as a root (2.0.0.) and as a user (2.6.3). After change this (to 2.6: root has 2.6.6. and user has 2.6.3. version of ruby) I see the same error.

I tried run onedb upgrade command as a root too, but I encountered different problem:

/usr/lib/one/ruby/opennebula/xml_utils.rb:144:in `module:OpenNebula': nokogiri gem not installed. (RuntimeError)

Installation attempt failed:

Building native extensions. This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

current directory: /opt/rh/rh-ruby26/root/usr/local/share/gems/gems/nokogiri-1.10.10/ext/nokogiri
/opt/rh/rh-ruby26/root/usr/bin/ruby -I /opt/rh/rh-ruby26/root/usr/share/rubygems -r ./siteconf20201103-67319-1vhrfa9.rb extconf.rb
mkmf.rb can't find header files for ruby at /opt/rh/rh-ruby26/root/usr/share/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /opt/rh/rh-ruby26/root/usr/local/share/gems/gems/nokogiri-1.10.10 for inspection.
Results logged to /opt/rh/rh-ruby26/root/usr/local/lib64/gems/ruby/nokogiri-1.10.10/gem_make.out

Thank you in advance for your help.

EDIT I solved the problem with nokogiri - rh-ruby26-ruby-devel.x86_64 0:2.6.2-118.el7 package was missing. After that i tried to run onedb upgrade as root and I still have the same error:

Attemp to run migrators compiled in other versionCompiled: 2.0, installed: 2.6
Dahr
  • 11
  • 3

0 Answers0