[lxc-users] cgm getvalue invalid request on lxc host

Georg Schönberger gschoenberger at thomas-krenn.com
Fri Apr 17 11:37:03 UTC 2015


On Sam, 2015-04-04 at 02:05 +0000, Serge Hallyn wrote:
> Quoting Georg Schönberger (gschoenberger at thomas-krenn.com):
> > On Mit, 2015-04-01 at 00:16 +0000, Serge Hallyn wrote:
> > > Quoting Georg Schönberger (gschoenberger at thomas-krenn.com):
> > > > Hi LXC team,
> > > > 
> > > > somehow my cgm setup stopped working today!
> > > > 
> > > > I cannot make a request from the host anymore:
> > > > # lxc-cgroup -n ubuntu1 memory.usage_in_bytes
> > > > 32956416
> > > > # cgm getvalue memory /lxc/ubuntu1 memory.usage_in_bytes
> > > > Error org.freedesktop.DBus.Error.InvalidArgs: invalid request
> > > 
> > > Hm - this is on the *host*?
> > 
> > Yes, this in on the host, the container name is 'ubuntu1' and it's
> > running.
> > I am using a fresh installed trusty with latest kernel and updates for
> > testing.
> > 
> > I have added "debug" to cgmanager, now the log states:
> > # tail /var/log/upstart/cgmanager.log
> > Connection from private client
> > GetValue: Client fd is: 6 (pid=1793, uid=0, gid=0)
> > cgmanager:get_value_main: target cgroup is not below r (1793)'s
> > Disconnected from private client
> > 
> > lxc-cgroup still working:
> > # lxc-cgroup -n ubuntu1 memory.usage_in_bytes
> > 28852224
> > 
> > > > In the log I got
> > > > # tail /var/log/upstart/cgmanager.log
> > > > cgmanager: Invalid path /run/cgmanager/fs/none,name=systemd///user (No
> > > > such file or directory)
> > > > cgmanager:list_children_main: Could not determine the requested cgroup
> > > > cgmanager:get_pid_cgroup_main: Could not determine the requestor cgroup
> > > > cgmanager:get_pid_cgroup_main: Could not determine the requestor cgroup
> > > > cgmanager:get_value_main: target cgroup is not below r (2280)'s
> > > 
> > > > The log message was introduced by the following patch:
> > > > *https://lists.debian.org/debian-release/2015/02/msg00396.html
> > > > with the following comments:
> > > > *// Get p's current cgroup in pcgpath
> > > > *// Make sure target cgroup is under proxy's
> > > > So maybe it's a permission or proxy issue?
> > > 
> > > Can you show
> > > 
> > > ps -ef | egrep -e "(cgmanager|cgproxy)"
> > # ps -ef | egrep -e "(cgmanager|cgproxy)"
> > root      1261     1  0 08:52 ?        00:00:00 /sbin/cgmanager
> > --sigstop --debug -m name=systemd
> > root      1806  1242  0 08:53 pts/0    00:00:00 egrep --color=auto -e
> > (cgmanager|cgproxy)
> > > 
> > > uname -a
> > # uname -a
> > Linux lxc-trusty 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15
> > UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
> > > cat /proc/self/cgroup
> > # cat /proc/self/cgroup 
> > 11:hugetlb:/user/1000.user/1.session
> > 10:perf_event:/user/1000.user/1.session
> > 9:blkio:/user/1000.user/1.session
> > 8:freezer:/user/1000.user/1.session
> > 7:devices:/user/1000.user/1.session
> > 6:memory:/user/1000.user/1.session
> > 5:cpuacct:/user/1000.user/1.session
> > 4:cpu:/user/1000.user/1.session
> > 3:cpuset:/user/1000.user/1.session
> > 2:name=systemd:/user/1000.user/1.session
> > 
> > I have also tried talking directly to cgmanager:
> > # dbus-send --print-reply
> > --address=unix:path=/sys/fs/cgroup/cgmanager/sock
> > --type=method_call /org/linuxcontainers/cgmanager
> > org.linuxcontainers.cgmanager0_0.GetValue string:'memory'
> > string:'/lxc/ubuntu1' string:memory.limit_in_bytes
> > 
> > But I don't know how to specify the cgroup correctly?
> > * /lxc/ubuntu1, lxc/ubuntu1
> 
> Ok, this is as expected.  You are in /user/1000.user/1.session,
> so you can only query values under your current cgroup.
> 
> You can become root and 'escape' to the root cgroup then query
> from there
> 
> sudo bash
> # cgm movepidabs memory / $$
> # cgm getvalue memory /lxc/ubuntu1 memory.limit_in_bytes
> 
> -serge

Hi serge,

THX a lot for your help, "escaping" to the root cgroup got it working:
# sudo bash
# cgm movepidabs memory / $$
# cgm getvalue memory /lxc/ubuntu1 memory.limit_in_bytes
268435456
# cat /proc/self/cgroup 
# cat /proc/self/cgroup | grep memory
5:memory:/

Is there any intention to change that behavior or at least give some
hints in a documentation? It is quite confusing if per default cgm is
not working on a lxc created container.

-Georg


More information about the lxc-users mailing list