[FIXED] Error while parsing configuration file on start of OpenNebula

Hi!
I’m running the latest Opennebula on a Ubuntu 16.04 virtual machine where I have installed it according to the instruction at http://docs.opennebula.org/5.4/deployment/opennebula_installation/frontend_installation.html#frontend-installation.

When I try to run “sudo systemctl start openneabula” I get the following error:

sep 24 19:45:10 front1.dasilva.network systemd[1]: Started OpenNebula Cloud Controller Daemon.
sep 24 19:45:10 front1.dasilva.network oned[2506]: Error while parsing configuration file:
sep 24 19:45:10 front1.dasilva.network oned[2506]: Error opening template file
sep 24 19:45:10 front1.dasilva.network oned[2506]: Could not load nebula configuration file.

Here is the content of sched.log-20170924-1506275310

Sun Sep 24 19:47:57 2017 [Z0][SCHED][I]: Init Scheduler Log system
Sun Sep 24 19:47:57 2017 [Z0][SCHED][I]: Starting Scheduler Daemon
----------------------------------------
     Scheduler Configuration File       
----------------------------------------
DEFAULT_DS_SCHED=POLICY=1
DEFAULT_SCHED=POLICY=1
LIVE_RESCHEDS=0
LOG=DEBUG_LEVEL=3,SYSTEM=file
MAX_DISPATCH=30
MAX_HOST=1
MAX_VM=5000
MESSAGE_SIZE=1073741824
ONE_XMLRPC=http://localhost:2633/RPC2
SCHED_INTERVAL=30
TIMEOUT=60
----------------------------------------
Sun Sep 24 19:47:57 2017 [Z0][SCHED][I]: XML-RPC client using 1073741824 bytes for response buffer.

Sun Sep 24 19:47:57 2017 [Z0][SCHED][E]: Cannot contact oned, will retry... Error: HTTP POST to URL 'http://localhost:2633/RPC2' failed.  libcurl failed even to execute the HTTP transaction, explaining:  Failed to connect to localhost port 2633: Connection refused

The configuration files are available. Is there any way I can get more output to track what is causing the issue?

You started the opennebula service but the log is from the scheduler service. Please check /var/log/one/oned.log more details should be visible there.

The file /var/log/one/oned.log is empty. Here is what happens when I try to start the opennebula service by typing “sudo systemctl start opennebula”:

opennebula.service - OpenNebula Cloud Controller Daemon
   Loaded: loaded (/lib/systemd/system/opennebula.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since tis 2017-09-26 10:52:21 CEST; 43s ago
  Process: 10022 ExecStopPost=/usr/share/one/follower_cleanup (code=exited, status=0/SUCCESS)
  Process: 10017 ExecStopPost=/bin/rm -f /var/lock/one/one (code=exited, status=
0/SUCCESS)
  Process: 10009 ExecStop=/bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 9999 ExecStart=/usr/bin/oned -f (code=exited, status=0/SUCCESS)
  Process: 9993 ExecStartPre=/usr/sbin/logrotate -s /tmp/logrotate.state -f /etc/logrotate.d/opennebula (code=exited, status=0/SUCCESS)
  Process: 9986 ExecStartPre=/bin/chown oneadmin:oneadmin /var/log/one (code=exited, status=0/SUCCESS)
  Process: 9981 ExecStartPre=/bin/mkdir -p /var/log/one (code=exited, status=0/SUCCESS)
 Main PID: 9999 (code=exited, status=0/SUCCESS)

Bellow is the output of journalctl

sep 26 10:52:11 front1.dasilva.network sudo[9975]:    cesar : TTY=pts/3 ; PWD=/home/cesar ; USER=root ; COMMAND=/bin/systemctl status opennebula
sep 26 10:52:11 front1.dasilva.network sudo[9975]: pam_unix(sudo:session): session opened for user root by cesar(uid=0)
sep 26 10:52:15 front1.dasilva.network sudo[9975]: pam_unix(sudo:session): session closed for user root
sep 26 10:52:20 front1.dasilva.network sudo[9978]:    cesar : TTY=pts/3 ; PWD=/home/cesar ; USER=root ; COMMAND=/bin/systemctl start opennebula
sep 26 10:52:20 front1.dasilva.network sudo[9978]: pam_unix(sudo:session): session opened for user root by cesar(uid=0)
sep 26 10:52:20 front1.dasilva.network systemd[1]: Starting OpenNebula Cloud Controller Daemon...
sep 26 10:52:20 front1.dasilva.network systemd[1]: Started OpenNebula Cloud Controller Daemon.
sep 26 10:52:20 front1.dasilva.network sudo[9978]: pam_unix(sudo:session): session closed for user root
sep 26 10:52:20 front1.dasilva.network systemd[1]: Started OpenNebula Cloud Scheduler Daemon.
sep 26 10:52:20 front1.dasilva.network oned[9999]: Error while parsing configuration file:
sep 26 10:52:20 front1.dasilva.network oned[9999]: Error opening template file
sep 26 10:52:20 front1.dasilva.network oned[9999]: Could not load nebula configuration file.
sep 26 10:52:21 front1.dasilva.network systemd[1]: Stopping OpenNebula Cloud Scheduler Daemon...
sep 26 10:52:21 front1.dasilva.network systemd[1]: Stopped OpenNebula Cloud Scheduler Daemon.
sep 26 10:52:21 front1.dasilva.network systemd[1]: Stopped OpenNebula Cloud Controller Daemon.
sep 26 10:52:22 front1.dasilva.network sudo[10030]:    cesar : TTY=pts/3 ; PWD=/home/cesar ; USER=root ; COMMAND=/bin/systemctl status opennebula
sep 26 10:52:22 front1.dasilva.network sudo[10030]: pam_unix(sudo:session): session opened for user root by cesar(uid=0)
sep 26 10:52:59 front1.dasilva.network sudo[10030]: pam_unix(sudo:session): session closed for user root

Bellow is the list of files for the directory /var/log/one ordered by date. I remove all achieved files (*.gz).
cesar@front1:/var/log/one$ ls -lat
totalt 648
drwxr-xr-x 2 oneadmin oneadmin 12288 sep 26 10:54 .
-rw-r–r-- 1 oneadmin oneadmin 889 sep 26 10:52 sched.log
drwxrwxr-x 10 root syslog 4096 sep 26 06:25 …
-rw-r–r-- 1 oneadmin oneadmin 889 sep 24 19:48 sched.log-20170924-1506275310
-rw-r–r-- 1 oneadmin oneadmin 501617 sep 24 19:35 sunstone.log
-rw-r–r-- 1 oneadmin oneadmin 22487 sep 24 19:29 novnc.log
-rw-r–r-- 1 oneadmin oneadmin 8546 sep 24 19:00 oned.log-20170924-1506272446
-rw-r–r-- 1 oneadmin oneadmin 952 sep 20 22:57 19.log
-rw-r–r-- 1 oneadmin oneadmin 4663 sep 20 22:28 18.log
-rw-r–r-- 1 oneadmin oneadmin 1429 sep 20 21:05 17.log
-rw-r–r-- 1 oneadmin oneadmin 1676 sep 20 19:58 16.log
-rw-r–r-- 1 oneadmin oneadmin 8250 sep 20 19:26 15.log
-rw-r–r-- 1 oneadmin oneadmin 2375 sep 19 19:55 14.log
-rw-r–r-- 1 oneadmin oneadmin 1613 sep 19 19:36 13.log
-rw-r–r-- 1 oneadmin oneadmin 1599 sep 19 19:34 12.log
-rw-r–r-- 1 oneadmin oneadmin 1581 sep 19 19:15 11.log
-rw-r–r-- 1 oneadmin oneadmin 1632 sep 18 22:05 10.log
-rw-r–r-- 1 oneadmin oneadmin 1575 sep 18 21:51 9.log
-rw-r–r-- 1 oneadmin oneadmin 1630 sep 18 21:32 8.log
-rw-r–r-- 1 oneadmin oneadmin 1630 sep 17 20:00 7.log
-rw-r–r-- 1 oneadmin oneadmin 1699 sep 17 19:31 6.log
-rw-r–r-- 1 oneadmin oneadmin 1613 sep 17 19:14 5.log
-rw-r–r-- 1 oneadmin oneadmin 1672 sep 17 17:06 4.log
-rw-r–r-- 1 oneadmin oneadmin 1629 sep 17 16:46 3.log
-rw-r–r-- 1 oneadmin oneadmin 1641 sep 17 13:16 2.log
-rw-r–r-- 1 oneadmin oneadmin 1616 sep 15 21:15 1.log
-rw-r–r-- 1 oneadmin oneadmin 1689 sep 15 16:36 0.log

Hope this is of any help.

I would have expected at least some more meaningful output. You could run ‘sudo -u oneadmin -g oneadmin /usr/bin/oned -f’ directly in the terminal - this circumvents all the other dependencies introduced via systemd. Hopefully this will lead to a more helpful output in the terminal or the log file.
I’d guess it’s just what it says in the exit message - there is something wrong in /etc/one/oned.conf

I tried that and got the same error:

sudo -u oneadmin -g oneadmin /usr/bin/oned -f

Error while parsing configuration file:
Error opening template file
Could not load nebula configuration file.

I have attached my oned.conf file as reference.
I think the startup process should give the user a hint were the error line of the oned.conf might be.
oned.conf (51.8 KB)

Is there any parser for the /etc/one/oned.conf file which reports where the issue might be?
I have looked at the file several times and had no luck on identifying what the error might be.

Fixed the issue by changing the permission of all files at /etc/one by running the following command:
sudo chown -R oneadmin:oneadmin *