[SOLVED] Problem starting Sunstone after upgrading to 6.8

My intention is to describe a problem and its solution, since it took me a while to fix it and I didn’t find this specific problem reported anywhere.

I was in the process of upgrading my server to OpenNebula 6.8 and Debian (from 11 to 12) and had a hard time because the Sunstone server would not start and no error message was shown. The command /usr/bin/ruby /usr/lib/one/sunstone/sunstone-server.rb would just print the settings and exit with code 255.

I manually ran the command with the --debug flag as the oneadmin user (sudo -u oneadmin -s and then /usr/bin/ruby --debug /usr/lib/one/sunstone/sunstone-server.rb), and among MANY MANY lines of indentation warnings, I got this exception:

Exception `Psych::BadAlias` at /usr/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:430 - Unknown alias: provisionactions

I know nothing about Ruby, but I found this answer, which explains an incompatibility between Psych and newer Ruby versions (Ruby was upgraded to 3.1 on this server). So, I started searching the Sunstone code for YAML.xxx calls to add , aliases: true.

To fix the problem, I had to manually edit the file /usr/lib/one/sunstone/models/SunstoneViews.rb and add , aliases: true to the following YAML.load_file call. I also wrapped it in a begin/rescue block, so the script will print an error message if something goes wrong:

        Dir[VIEWS_CONFIGURATION_DIR + mode + '/*.yaml'].each do |p_path|
            reg = VIEWS_CONFIGURATION_DIR + mode + '/'
            m = p_path.match(/^#{reg}(.*).yaml$/)
            if m && m[1]
                begin
                  @views[m[1]] = YAML.load_file(p_path, aliases: true)
                rescue Exception => e
                  STDERR.puts "Error parsing config file #{p_path}: #{e.message}"
                  exit 1
                end
            end
        end

This was a very frustrating experience. The Sunstone start script could simply PRINT the exceptions when they occur, and it would have saved me a lot of time trying to figure out what happened. I also checked the logs and found NOTHING. This is not a good development practice at all and I’m seriously considering replacing OpenNebula with a more stable solution.

Hello @turicas,

There are a couple of things I would like to mention here, based on your feedback:

  1. Debian 12 is not supported on OpenNebula 6.8, so you need to upgrade to 6.10 in order to be able to use it and install a Debian 12 VM
  2. Ruby Sunstone interface has been deprecated, so now you need to use FireEdge Sunstone. And starting with version 7.0, there will be more changes introduced to the interface of the platform.

So, please consider that you probably encountered bugs that has been fixed already (on the current version 6.10), and that you were trying to use a deprecated version of the interface.

In any case, thank you for your feedback, I’m sorry that you have this opinion about the platform as a solution for your infrastructure, and I really suggest you to check once the version 7 is launched, to see if it might be a fit for your requirements.

Regards,

2 Likes

Thanks for the comprehensive answer, @FrancJP!
I think I installed 6.8 from the OpenNebula’s own Debian repository for Debian 12. But I know it’s outdated now and I need to upgrade to use more up-to-date versions. I’ll give FireEdge a try.

1 Like