SyntaxError: invalid syntax

Bug #1159020 reported by Seth Arnold
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pyjuju
Confirmed
High
Unassigned

Bug Description

I'm trying to use the Juju PPA on Raring, and got the following error in my juju debug-log:

LXCError: Fatal Python error: Py_Initialize: Unable to get the locale encoding
  File "/usr/lib/python2.7/encodings/__init__.py", line 123
    raise CodecRegistryError,\

My locale is pretty standard:

$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Here's the entire traceback:

~$ juju debug-log
2013-03-22 17:32:57,670 INFO Enabling distributed debug log.
2013-03-22 17:32:57,672 INFO Tailing logs - Ctrl-C to stop.
2013-03-22 17:33:08,679 Machine:0: twisted ERROR: Fatal Python error: Py_Initialize: Unable to get the locale encoding
2013-03-22 17:33:08,679 Machine:0: twisted ERROR: File "/usr/lib/python2.7/encodings/__init__.py", line 123
2013-03-22 17:33:08,680 Machine:0: twisted ERROR: raise CodecRegistryError,\
2013-03-22 17:33:08,680 Machine:0: twisted ERROR: ^
2013-03-22 17:33:08,681 Machine:0: twisted ERROR: SyntaxError: invalid syntax
2013-03-22 17:33:08,681 Machine:0: twisted ERROR:
2013-03-22 17:33:08,683 Machine:0: juju.agents.machine ERROR: Error starting unit: wordpress/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 91, 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 301, 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

Thanks

Marco Ceppi (marcoceppi)
Changed in juju:
status: New → Confirmed
Revision history for this message
Juhapekka Piiroinen (juhapekka-piiroinen) wrote :

Same issue here. Running on raring 64-bit.

machine_agent.log @ http://paste.ubuntu.com/5649810/

Changed in juju:
importance: Undecided → High
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

Stripping the env prior to running lxc-ls should do the trick.

Revision history for this message
Barry Warsaw (barry) wrote :

We discussed this over IRC/email. Kapil's right, and one thing to make sure of is that all your Python shebang lines run Python with the -Es flags to ensure any weird settings of Python-related environment variables do not infect the processes.

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.