[Bug 1168476] [NEW] Juju crashes when using LXC container

2013-04-12 Thread Bruno Girin
Public bug reported:

I've been trying to debug a Juju charm using the LXC container and when
I do so, I get the following error in the logs:

2013-04-12 18:01:02,242 Machine:0: unit.deploy DEBUG: Using 
juju.machine.unit.UnitContainerDeployment object at 0x344e490 for 
energydeck/0 in /home/bruno/juju-data/bruno-local
2013-04-12 18:01:02,727 Machine:0: twisted ERROR: Fatal Python error: 
Py_Initialize: Unable to get the locale encoding
2013-04-12 18:01:02,728 Machine:0: twisted ERROR:   File 
/usr/lib/python2.7/encodings/__init__.py, line 123
2013-04-12 18:01:02,729 Machine:0: twisted ERROR: raise CodecRegistryError,\
2013-04-12 18:01:02,729 Machine:0: twisted ERROR: ^
2013-04-12 18:01:02,730 Machine:0: twisted ERROR: SyntaxError: invalid syntax
2013-04-12 18:01:02,730 Machine:0: twisted ERROR: 
2013-04-12 18:01:02,731 Machine:0: juju.agents.machine ERROR: Error starting 
unit: energydeck/0
Traceback (most recent call last):
  File /usr/lib/python2.7/dist-packages/juju/agents/machine.py, line 97, in 
watch_service_units
yield self.unit_deployer.start_service_unit(unit_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/unit/deploy.py, line 88, in 
start_service_unit
running = yield deployment.is_running()
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/machine/unit.py, line 295, in 
is_running
prefix=self.container.container_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/lib/lxc/__init__.py, line 147, 
in get_containers
_, output = yield deferToThread(_cmd, [lxc-ls])
  File /usr/lib/python2.7/dist-packages/twisted/python/threadpool.py, line 
172, in _worker
result = context.call(ctx, function, *args, **kwargs)
  File /usr/lib/python2.7/dist-packages/twisted/python/context.py, line 118, 
in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File /usr/lib/python2.7/dist-packages/twisted/python/context.py, line 81, 
in callWithContext
return func(*args,**kw)
  File /usr/lib/python2.7/dist-packages/juju/lib/lxc/__init__.py, line 48, in 
_cmd
raise LXCError(stdout_data)
LXCError: Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File /usr/lib/python2.7/encodings/__init__.py, line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File /usr/lib/python2.7/dist-packages/juju/agents/machine.py, line 97, in 
watch_service_units
yield self.unit_deployer.start_service_unit(unit_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/unit/deploy.py, line 88, in 
start_service_unit
running = yield deployment.is_running()
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/machine/unit.py, line 295, in 
is_running
prefix=self.container.container_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/lib/lxc/__init__.py, line 147, 
in get_containers
_, output = yield deferToThread(_cmd, [lxc-ls])
  File /usr/lib/python2.7/dist-packages/twisted/python/threadpool.py, line 
172, in _worker
result = context.call(ctx, function, *args, **kwargs)
  File 

[Bug 1168476] [NEW] Juju crashes when using LXC container

2013-04-12 Thread Bruno Girin
Public bug reported:

I've been trying to debug a Juju charm using the LXC container and when
I do so, I get the following error in the logs:

2013-04-12 18:01:02,242 Machine:0: unit.deploy DEBUG: Using 
juju.machine.unit.UnitContainerDeployment object at 0x344e490 for 
energydeck/0 in /home/bruno/juju-data/bruno-local
2013-04-12 18:01:02,727 Machine:0: twisted ERROR: Fatal Python error: 
Py_Initialize: Unable to get the locale encoding
2013-04-12 18:01:02,728 Machine:0: twisted ERROR:   File 
/usr/lib/python2.7/encodings/__init__.py, line 123
2013-04-12 18:01:02,729 Machine:0: twisted ERROR: raise CodecRegistryError,\
2013-04-12 18:01:02,729 Machine:0: twisted ERROR: ^
2013-04-12 18:01:02,730 Machine:0: twisted ERROR: SyntaxError: invalid syntax
2013-04-12 18:01:02,730 Machine:0: twisted ERROR: 
2013-04-12 18:01:02,731 Machine:0: juju.agents.machine ERROR: Error starting 
unit: energydeck/0
Traceback (most recent call last):
  File /usr/lib/python2.7/dist-packages/juju/agents/machine.py, line 97, in 
watch_service_units
yield self.unit_deployer.start_service_unit(unit_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/unit/deploy.py, line 88, in 
start_service_unit
running = yield deployment.is_running()
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/machine/unit.py, line 295, in 
is_running
prefix=self.container.container_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/lib/lxc/__init__.py, line 147, 
in get_containers
_, output = yield deferToThread(_cmd, [lxc-ls])
  File /usr/lib/python2.7/dist-packages/twisted/python/threadpool.py, line 
172, in _worker
result = context.call(ctx, function, *args, **kwargs)
  File /usr/lib/python2.7/dist-packages/twisted/python/context.py, line 118, 
in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File /usr/lib/python2.7/dist-packages/twisted/python/context.py, line 81, 
in callWithContext
return func(*args,**kw)
  File /usr/lib/python2.7/dist-packages/juju/lib/lxc/__init__.py, line 48, in 
_cmd
raise LXCError(stdout_data)
LXCError: Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File /usr/lib/python2.7/encodings/__init__.py, line 123
raise CodecRegistryError,\
^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File /usr/lib/python2.7/dist-packages/juju/agents/machine.py, line 97, in 
watch_service_units
yield self.unit_deployer.start_service_unit(unit_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/unit/deploy.py, line 88, in 
start_service_unit
running = yield deployment.is_running()
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/machine/unit.py, line 295, in 
is_running
prefix=self.container.container_name)
  File /usr/lib/python2.7/dist-packages/twisted/internet/defer.py, line 1069, 
in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
  File /usr/lib/python2.7/dist-packages/twisted/python/failure.py, line 389, 
in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
  File /usr/lib/python2.7/dist-packages/juju/lib/lxc/__init__.py, line 147, 
in get_containers
_, output = yield deferToThread(_cmd, [lxc-ls])
  File /usr/lib/python2.7/dist-packages/twisted/python/threadpool.py, line 
172, in _worker
result = context.call(ctx, function, *args, **kwargs)
  File