TRY THIS xivo-agent bug

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
I build a new Debian 8.6 container under proxmox. Perform an apt-get, apt-update to bring the packages current. I then download and run the wazo_install bash script but it errors out.

Here are the relevant lines of the output from execution of the bash script:
Code:
Adding system user xivo-agentd
Adding user xivo-agentd to group www-data
[....] Starting: xivo-agentdCould not read config file /etc/xivo-agentd/conf.d/050-xivo-consul-config.yml: [Errno 2] No such file or directory: '/etc/xivo-agentd/conf.d/050-xivo-consul-config.yml'
Could not read config file /etc/xivo-agentd/conf.d/050-xivo-consul-token.yml: [Errno 2] No such file or directory: '/etc/xivo-agentd/conf.d/050-xivo-consul-token.yml'
 failed!
invoke-rc.d: initscript xivo-agentd, action "start" failed.
dpkg: error processing package xivo-agentd (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up xivo-amid (16.16~20161205.122841.d0b9ba5) ...
Adding system user xivo-amid
Adding user xivo-amid to group www-data

The symbolic link /etc/xivo-agentd/conf.d/050-xivo-consul-config.yml is reported as inaccessible. The link exists with 777 permissions.
Code:
ls -alt /etc/xivo-agentd/conf.d/
total 8
drwxr-xr-x 3 root root 4096 Dec 21 07:55 ..
drwxr-xr-x 2 root root 4096 Dec 21 07:55 .
lrwxrwxrwx 1 root root   46 Dec  5 12:23 050-xivo-consul-config.yml -> /var/lib/consul/default_xivo_consul_config.yml
lrwxrwxrwx 1 root root   45 Dec  5 12:23 050-xivo-consul-token.yml -> /var/lib/consul/default_xivo_consul_token.yml

How about the file the link points too? That exists as well
Code:
root@voip2:/var/lib/consul# ls -al /var/lib/consul
total 28
drwxr-xr-x  4 consul consul 4096 Dec 21 07:55 .
drwxr-xr-x 54 root   root   4096 Dec 21 07:56 ..
-rw-r-----  1 consul consul  106 Dec 21 07:55 default_xivo_consul_config.yml
-rw-r-----  1 consul consul   84 Dec 21 07:55 default_xivo_consul_token.yml
-rw-------  1 consul consul   65 Dec 21 07:55 master_token
drwxr-xr-x  3 consul consul 4096 Dec 21 07:55 raft
drwxr-xr-x  2 consul consul 4096 Dec 21 07:55 serf

The log file /var/log/xivo-agentd.log tells us the problem:
Code:
2016-12-21 07:55:41,840 [31330] (ERROR) (xivo_agent.bin.agentd): undefined environment variable XIVO_UUID
2016-12-21 07:55:41,840 [31330] (CRITICAL) (root): XIVO_UUID environment variable is not set
Traceback (most recent call last):
  File "/usr/bin/xivo-agentd", line 5, in <module>
    main()
  File "/usr/lib/python2.7/dist-packages/xivo_agent/bin/agentd.py", line 137, in main
    set_xivo_uuid(config, logger)
  File "/usr/lib/python2.7/dist-packages/xivo/config_helper.py", line 144, in set_xivo_uuid
    config['uuid'] = get_xivo_uuid(logger)
  File "/usr/lib/python2.7/dist-packages/xivo/config_helper.py", line 139, in get_xivo_uuid
    raise UUIDNotFound()


Oddly, I ran across this same error a few short months ago and posted about it. However at the time that was due to user error on my part which I discovered.

I have reproduced this error three times and have tried manually installing (not running the script) xivo-agent via apt-get install but I run into the same UUID error.

I have tried containers of Debian 8.0 and updated the container to 8.6 and have tried a container based on 8.6

I have tried with and without the cloud-init package.

My /etc/hosts:
Code:
root@xivo:~# cat /etc/hosts
127.0.0.1    localhost
::1        localhost ip6-localhost ip6-loopback
ff02::1        ip6-allnodes
ff02::2        ip6-allrouters
# --- BEGIN PVE ---
127.0.1.1 xivo
# --- END PVE ---
127.0.1.1    xivo.incrediblepbx.com

My /etc/hostname:
Code:
root@xivo:~# cat /etc/hostname
xivo

This seems to be a bug with the xivo-agent package perhaps limited in scope to installs under a proxmox container environment.
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
This does indeed seem to be a problem when the environment is a proxmox container. I just completed a Debian 8.6 install on a proxmox virtual machine then the executed the wazo_install bash script and everything is working.
 

Sylvain Boily

Active Member
Joined
Apr 30, 2016
Messages
259
Reaction score
144
@amygrant Hello, you need to use wazo-upgrade every time, not apt-get dist-upgrade. There is some specific actions with wazo-upgrade.
 
Last edited by a moderator:

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
@Sylvain Boily - Thank you but I may not have been clear in my post. I am not upgrading a pre-existing installation. I am performing a new install of wazo on a new virtual server.

Proxmox is my virtual environment

A new virtual machine running Debian 8.6 64-bit works fine
A new container running Debian 8.6 64-bit fails to install the xivo-agent package

Thank you for trying to help.
 

Sylvain Boily

Active Member
Joined
Apr 30, 2016
Messages
259
Reaction score
144
I think this is a problem with container and systemd. Your variable XIVO_UUID is not set... What is your container technology?
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
You are correct, that is the problem.

This is a LXC container and LXC seems to not work well with setuid
 

Members online

Forum statistics

Threads
25,824
Messages
167,825
Members
19,248
Latest member
BKhumalo
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top