← Back to team overview

touch-packages team mailing list archive

[Bug 1477453] [NEW] lxc-stop -n unknown-container creates a corrupted container

 

Public bug reported:

Running lxc-stop on a container which doesn't exist actually creates the
container, and messes up its permissions, causing sequences like:

$ lxc-stop -n foo && lxc-destroy -n foo && lxc-clone clean-machine foo

..to fail with bad errors:

# it definitely doesn't exist to start with:
% lxc-ls foo

% lxc-info -n foo
foo doesn't exist

% ls ~/.local/share/lxc/foo -al
ls: cannot access /home/faux/.local/share/lxc/foo: No such file or directory

# now let's stop it:
% lxc-stop -n foo
foo is not running

# tooling still thinks it doesn't exist:
% lxc-ls foo                   

% lxc-info -n foo              
foo doesn't exist

# .. but there are some files!
% ls ~/.local/share/lxc/foo -al
total 0
drwxr-xr-x 1 faux faux   14 Jul 23 09:45 .
drwxr-xr-x 1 faux faux 8070 Jul 23 09:45 ..
-rw-rw-r-- 1 faux faux    0 Jul 23 09:45 foo.log

# and now lxc-clone is totally broken:
% lxc-clone base foo
lxc_container: lxccontainer.c: lxcapi_clone: 2707 Permission denied - open /home/faux/.local/share/lxc/foo/config
clone failed


Can we worked around by manually rm -rfing ~/.local/share/lxc/foo.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: lxc 1.1.2-0ubuntu3
ProcVersionSignature: Ubuntu 3.19.0-22.22-generic 3.19.8-ckt1
Uname: Linux 3.19.0-22-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
Date: Thu Jul 23 09:45:56 2015
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
defaults.conf:
 lxc.network.type = veth
 lxc.network.link = lxcbr0
 lxc.network.flags = up
 lxc.network.hwaddr = 00:16:3e:xx:xx:xx

** Affects: lxc (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apparmor apport-bug vivid

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1477453

Title:
  lxc-stop -n unknown-container creates a corrupted container

Status in lxc package in Ubuntu:
  New

Bug description:
  Running lxc-stop on a container which doesn't exist actually creates
  the container, and messes up its permissions, causing sequences like:

  $ lxc-stop -n foo && lxc-destroy -n foo && lxc-clone clean-machine foo

  ..to fail with bad errors:

  # it definitely doesn't exist to start with:
  % lxc-ls foo

  % lxc-info -n foo
  foo doesn't exist

  % ls ~/.local/share/lxc/foo -al
  ls: cannot access /home/faux/.local/share/lxc/foo: No such file or directory

  # now let's stop it:
  % lxc-stop -n foo
  foo is not running

  # tooling still thinks it doesn't exist:
  % lxc-ls foo                   

  % lxc-info -n foo              
  foo doesn't exist

  # .. but there are some files!
  % ls ~/.local/share/lxc/foo -al
  total 0
  drwxr-xr-x 1 faux faux   14 Jul 23 09:45 .
  drwxr-xr-x 1 faux faux 8070 Jul 23 09:45 ..
  -rw-rw-r-- 1 faux faux    0 Jul 23 09:45 foo.log

  # and now lxc-clone is totally broken:
  % lxc-clone base foo
  lxc_container: lxccontainer.c: lxcapi_clone: 2707 Permission denied - open /home/faux/.local/share/lxc/foo/config
  clone failed

  
  Can we worked around by manually rm -rfing ~/.local/share/lxc/foo.

  ProblemType: Bug
  DistroRelease: Ubuntu 15.04
  Package: lxc 1.1.2-0ubuntu3
  ProcVersionSignature: Ubuntu 3.19.0-22.22-generic 3.19.8-ckt1
  Uname: Linux 3.19.0-22-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 2.17.2-0ubuntu1.1
  Architecture: amd64
  Date: Thu Jul 23 09:45:56 2015
  SourcePackage: lxc
  UpgradeStatus: No upgrade log present (probably fresh install)
  defaults.conf:
   lxc.network.type = veth
   lxc.network.link = lxcbr0
   lxc.network.flags = up
   lxc.network.hwaddr = 00:16:3e:xx:xx:xx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1477453/+subscriptions


Follow ups