pylxd: Long running container.execute() fails with "NotFound"

I try to run a script that installs a lot of packages through container.execute() but it fails with a pylxd.exceptions.NotFound Exception.

After digging around i found that getting the result from the operation fails, see L299.

Running the same script through lxc exec bootstraptest /root/bootstrap.sh works fine.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

I spent a few hours trying to break the lxc client in the same way and it appears to be rock solid. Tried all sorts of short and long running scripts, with no output and lots of output from the commands, but the lxc client appeared to behave itself. Just sorting out the tests on this change and then I’ll PR it.

@mkorcha thanks for the example code. I’ve reproduced the problem using it (there’s a slight bug in the first command ['apt-get update'] which needs to be ['apt-get', 'update']).

The good news, is that I’ve also found and fixed the problem. I’ll get a patch set up as soon as I can, once I’ve done some more rigorous testing with it. It’s not a bug in lxd; very much in when the sockets are being closed before fetching the result code from lxd.