Sunstone fails to start - Ruby Error

Server is a CentOS 7 clean build. I’m working off of the quick start guide for 4.14. When trying to start the opennebula-sunstone service I get the following errors.

Dec 14 09:46:39 oss01 systemd[1]: Started OpenNebula Web UI Server.
Dec 14 09:46:39 oss01 ruby[10314]: /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sinatra (LoadError)
Dec 14 09:46:39 oss01 ruby[10314]: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
Dec 14 09:46:39 oss01 ruby[10314]: from /usr/lib/one/sunstone/sunstone-server.rb:57:in `<main>'
Dec 14 09:46:39 oss01 systemd[1]: opennebula-sunstone.service: main process exited, code=exited, status=1/FAILURE
Dec 14 09:46:39 oss01 systemd[1]: Unit opennebula-sunstone.service entered failed state.

I have run the /usr/share/one/install_gems script and even gem update sinatra just to be sure that everything was up to date. This is the second time on a clean build that I am running into this issues so I’m not sure what is going on. Please let me know what logs / errors / package information I can provide to help resolve why this is not working. An additional note would be that I do not know much about ruby so if it is 100% a ruby problem it could easily be escaping me.

Additional information:
If I run ruby /usr/lib/one/sunstone/sunstone-server.rb as root sunstone will start successfully. If I change to oneadmin, I can reproduce the error. Perhaps the issue is with the oneadmin profile.

Update:
Rerunning /usr/share/one/install_gems under the oneadmin user allowed me to start the service up through systemd. I don’t believe this is the intended way of rolling it out so I would still like to get some discussion going about this. In addition, this server has had some significant jailing done on it so that might be what is contributing to oneadmin not being able to access the ruby libraries.

1 Like

Hi Justin,
I’ve just installed my CentOS 7 using the steps provided in the Quickstart. I’ve run all the commands as root user, both the installation of packages and the execution of /usr/share/one/install_gems and… it works fine as expected :-/.

The service can be started by root with systemctl. As you state, maybe the jailing is blocking the access to your ruby libraries. Also check if you’re using SELinux to remove any possible side effect like files being blocked by a context mismatch.

Maybe you can use a simple clean installation of CentOS 7 and try again and share what kind of jailing commands you’re using to check what could be breaking your ruby setup. If using Vagrant you can use the box I’m using to test some projects at Atlas/Hashicorp (mcabrerizo/centos_7), that’s the one I’ve used to check the installation steps.

I have the same issue. Could you solve this?