"AF_UNIX path too long" error when unit name exceeds about 30 characters

Bug #1068519 reported by Liam Young
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
pyjuju
Triaged
Low
Unassigned

Bug Description

When I join a relationship between two charms I'm seeing this:

2012-10-19 08:42:56,914 unit:productsearch-nrpe-squidreverseproxy/4: twisted ERROR: Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 391, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 458, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 545, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1095, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1037, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python2.7/dist-packages/twisted/python/failure.py", line 382, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python2.7/dist-packages/juju/agents/base.py", line 245, in startService
    yield self.start()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1039, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python2.7/dist-packages/juju/agents/unit.py", line 86, in start
    self.api_socket = reactor.listenUNIX(socket_path, self.api_factory)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 397, in listenUNIX
    p.startListening()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/unix.py", line 123, in startListening
    raise CannotListenError, (None, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on any:/var/lib/juju/units/productsearch-nrpe-squidreverseproxy-4/units/productsearch-nrpe-squidreverseproxy-4/.juju.hookcli.sock: AF_UNIX path too long.

The path exceeds 108 characters which appears to be the UNIX_PATH_MAX.

I think juju should enforce a maximum service name length at deploy time and also the path to the socket should be shortened as it currently seems to duplicate the service name.

Haw Loeung (hloeung)
tags: added: canonical-webops-juju
Revision history for this message
Evan (ev) wrote :

I'm also seeing this:
twisted.internet.error.CannotListenError: Couldn't listen on any:/var/lib/juju/units/error-tracker-errors-gunicorn-0/units/error-tracker-errors-gunicorn-0/.juju.hookcli.sock: AF_UNIX path too long.

Changed in juju:
status: New → Confirmed
Revision history for this message
James Page (james-page) wrote :

Ditto with a subordinate:

2013-02-13 11:08:56,864 unit:openstack-dashboard-hacluster/1: twisted ERROR: Unhandled error in Deferred:
2013-02-13 11:08:56,870 unit:openstack-dashboard-hacluster/1: twisted ERROR: Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 422, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 489, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 576, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1127, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  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/juju/juju/juju/agents/base.py", line 247, in startService
    yield self.start()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1071, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/juju/juju/juju/agents/unit.py", line 86, in start
    self.api_socket = reactor.listenUNIX(socket_path, self.api_factory)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 413, in listenUNIX
    p.startListening()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/unix.py", line 293, in startListening
    raise CannotListenError, (None, self.port, le)
twisted.internet.error.CannotListenError: Couldn't listen on any:/var/lib/juju/units/openstack-dashboard-hacluster-1/units/openstack-dashboard-hacluster-1/.juju.hookcli.sock: AF_UNIX path too long.

Changed in juju:
milestone: none → 0.8
Curtis Hovey (sinzui)
Changed in juju:
importance: Undecided → Low
status: Confirmed → Triaged
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.