Standalone client is not showing in epoptes

Bug #1549467 reported by Alek_A
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Epoptes
Fix Released
Medium
Alkis Georgopoulos

Bug Description

Hello,

I have two clients (172.22.21.128 and 172.22.21.129).
Systems is almost identical Lubuntu 14.04 except that one box is also a router.

I do epoptes-client from both clients with the same output:
 * Epoptes-client connecting to 172.22.11.20:789...
   ...done.
Command line is not complete. Try option "help"

Also on the server I run: netstat -tp | grep 789
tcp 0 0 ts.ad.aris-omsk.ru:789 172.22.21.129:33903 ESTABLISHED 26304/python
tcp 0 0 ts.ad.aris-omsk.ru:789 172.22.21.128:34489 ESTABLISHED 26304/python

Client 172.22.21.129 appears in epoptes console, client 172.22.21.128 does not whatever I do.

I'm sorry. I don't know how to debug this. Could you help me please.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Do you have the epoptes stable PPA in your sources, in both the server and the clients?
If not, please upgrade to the latest version by following the instruction from http://epoptes.org/documentation/ppa

If this doesn't solve the issue, *then* run epoptes from a terminal on the server and paste its output here.

Revision history for this message
Alek_A (ackbeat) wrote :

Thanks for the info!
I had fully updated clients and server with standard Ubuntu repository.
I updated server and clients to the stable ppa, according to your instructions, but it didn't solve the problrm the output is the same as before:
admin@ts:~$ epoptes
Got clients: 172.22.8.6:50834, 172.22.8.6:50835, 172.22.8.6:50836
---
**addClient's been called for 172.22.8.6:50836
Can't extract client information, won't add this client
---
**addClient's been called for 172.22.8.6:50835
Can't extract client information, won't add this client
---
**addClient's been called for 172.22.8.6:50834
Can't extract client information, won't add this client

I suppose an instance of epoptes-client is launched for each network interface. As our 172.22.8.6 workstation is also a router, there are several network interfaces.

NOTE (on another client):
I struggled to start epoptes-client, it just hanged showing:
 * Epoptes-client connecting to server:789...
The reason of that was installed and removed epoptes package. I had to remove epoptes completely. So when I ran:
apt-get install epoptes
apt-get purge epoptes
Client start to work again!

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

The problem is in a function called "info" that tries to gather information from the client, in your client/router's case it fails. Let's see why.

Copy the file /usr/share/epoptes/client-functions from your epoptes server to the client with the issue. Put it e.g. in /tmp/client-functions.
Then run the following, and attach its output here:
sudo UID=0 TYPE=standalone SERVER=server sh -xc '. /tmp/client-functions; info; trap - 0 15'

Revision history for this message
Alek_A (ackbeat) wrote :

Thanks for the info, again!

The problem is in determining ip address inside info()
I can see that command `ip -oneline -family inet addr show dev eth0` returns several IPs:
2: eth0 inet 91.90.38.142/30 brd 91.90.38.143 scope global eth0\ valid_lft forever preferred_lft forever
2: eth0 inet 172.22.21.128/23 brd 172.22.21.255 scope global eth0:1\ valid_lft forever preferred_lft forever
2: eth0 inet 192.168.3.200/24 brd 192.168.3.255 scope global eth0:2\ valid_lft forever preferred_lft forever

In the statement:
IP=$(ip -oneline -family inet addr show dev "$def_iface" \
      | sed "s/.* \([0-9.]*\)\/.*/\\1/")
I added ';q' to sed script to force it to handle only 1st line:
      | sed "s/.* \([0-9.]*\)\/.*/\\1/;q")
and now it works! Client appears in epoptes!

OTHER OBSERVATIONS:
1. You should probably set LC_ALL=C when calling info() to pick values correctly, for example RAM is not determined because of Russian locale. The output of `free -m`:
             total used free shared buffers cached
Память: 3828 531 3297 46 51 266
-/+ буферы/кэш: 213 3615
Swap: 3967 0 3967

So `grep "^Mem"` does not work. But `LC_ALL=C free -m` works.

2. Once after reboot I found that when when I execute info() on client it for some reason tun0 examined instead of eth0, other things were the same but MAC was different:
MAC=6:0:CAAE1500DCFFFAAEDEDEFADEFAE100E

To check why I ran the following commands:
root@sklad:~# ip -oneline -family inet link show dev tun0
6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 100\ link/none
root@sklad:~# ip -oneline -family inet link show dev tun0 | sed 'y/abcdef-/ABCDEF:/;s/[^A-F0-9:]//g'
6:0:CAAE1500DCFFFAAEDEDEFADEFAE100E

This happened only once, but I'm not sure whether or not it will happen again...

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Hi Alek,

I committed some fixes in http://bazaar.launchpad.net/~epoptes/epoptes/trunk/revision/513
Can you download http://bazaar.launchpad.net/~epoptes/epoptes/trunk/view/head:/data/client-functions,
put it in /usr/share/epoptes/client-functions,
then run sudo service epoptes restart,
and see if it fixes all the issues you reported?

Thank you!

Changed in epoptes:
assignee: nobody → Alkis Georgopoulos (alkisg)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Alek_A (ackbeat) wrote :

Hi, Alkis, you're welcome!

Thank you for the fixes! Amount of ram is now detected correctly.

But still info() fails on that router-client. According to routing table 'server' is accessible through interface tun0. But tun interfaces do not have MAC address, therefore info() fails with "ERROR: Empty MAC". Please check the output:
ip link show dev tun0
6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 100
    link/none

maybe we should use
MAC=`ip a|awk '/ether/{print $2;exit}'`
as a fallback? Anyway, client is uniquely identified with any of the MACs it has.

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Google says it's possible to assign a MAC address to a tun interface,
but since it's not there by default (as tun operates on level 3),
sure, let's fallback to the first MAC address found as you proposed.

I wanted to prefer the one that epoptes is using to connect to the server, because if we select the "first" one, it might not be the same between reboots of the same client, confusing the epoptes UI user.
Another idea could be to *sort* the available MAC addresses before selecting the first one of them...

Thanks again Alek, fix committed in http://bazaar.launchpad.net/~epoptes/epoptes/trunk/revision/514.

Revision history for this message
Alek_A (ackbeat) wrote :

I'm glad to help!

I agree with you on both suggestions. First try to determine MAC of outgoing interface, and then fallback to the least MAC available on the client ( | sort | head -1 )

Thank you for such a sought-after software!

Revision history for this message
Alkis Georgopoulos (alkisg) wrote :

Fix released in epoptes 0.5.10.

Changed in epoptes:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.