﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
2862	introducers.yaml causes foolscap assertion	warner	warner	"User ""lazygravy"" on IRC reported a node-startup exception that happens when `private/introducers.yaml` is used. The problem appears to be that the FURL given to foolscap is a unicode string, and there is code inside foolscap which asserts that the connection hints it sees are normal strings (not unicode). The exception (as recorded in twistd.log) looks like:

{{{
Unhandled error in Deferred:
  Traceback (most recent call last):
    File ""/usr/local/lib/python2.7/site-packages/foolscap/pb.py"", line 856, in connectTo
      rc.startConnecting(self)
    File ""/usr/local/lib/python2.7/site-packages/foolscap/reconnector.py"", line 78, in startConnecting
      self._connect()
    File ""/usr/local/lib/python2.7/site-packages/foolscap/reconnector.py"", line 110, in _connect
      d = self._tub.getReference(self._url)
    File ""/usr/local/lib/python2.7/site-packages/foolscap/pb.py"", line 794, in getReference
      return defer.maybeDeferred(self._getReference, sturdyOrURL)
  --- <exception caught here> ---
    File ""/usr/local/lib/python2.7/site-packages/twisted/internet/defer.py"", line 150, in maybeDeferred
      result = f(*args, **kw)
    File ""/usr/local/lib/python2.7/site-packages/foolscap/pb.py"", line 811, in _getReference
      d = self.getBrokerForTubRef(sturdy.getTubRef())
    File ""/usr/local/lib/python2.7/site-packages/foolscap/referenceable.py"", line 804, in getTubRef
      return TubRef(self.tubID, self.locationHints)
    File ""/usr/local/lib/python2.7/site-packages/foolscap/referenceable.py"", line 837, in __init__
      locationHints
  exceptions.AssertionError: [u'cz3uevcjrgwszq4ytvgisdw2nsdzgaxfan4nvh7uy5bxcbr7qv4q.b32.i2p']
}}}

I think the code that loads the YAML file needs to do an `.encode(""ascii"")` on any of the FURLs it extracts, before passing them to foolscap.

In addition, docs/configuration.rst had an invalid example for the `private/introducers.yaml` section (around line 920). It said:

{{{
introducers:
  petname2: furl = FURL2
}}}

but that will result in a data structure like `introducers = {""petname2"": ""furl = FURL2""}`, which causes an exception at node startup time like this:

{{{
  File ""/usr/local/lib/python2.7/site-packages/allmydata/client.py"", line 189, in __init__
    self.init_introducer_clients()
  File ""/usr/local/lib/python2.7/site-packages/allmydata/client.py"", line 268, in init_introducer_clients
    ic = IntroducerClient(self.tub, introducer['furl'],
exceptions.TypeError: string indices must be integers
}}}

Instead, the docs should recommend:

{{{
introducers:
  petname2:
    furl: FURL2
}}}
"	defect	closed	major	1.12.1	code-nodeadmin	1.12.0	fixed			
