[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3744: integration/test_tor.py::test_onion_service_storage fails on macOS and Python 2.7

Tahoe-LAFS trac at tahoe-lafs.org
Mon Jul 5 01:04:58 UTC 2021


#3744: integration/test_tor.py::test_onion_service_storage fails on macOS and
Python 2.7
------------------------------------+-----------------------
     Reporter:  sajith              |      Owner:
         Type:  defect              |     Status:  new
     Priority:  normal              |  Milestone:  undecided
    Component:  dev-infrastructure  |    Version:  n/a
   Resolution:                      |   Keywords:
Launchpad Bug:                      |
------------------------------------+-----------------------

Comment (by sajith):

 Pretty sure this is because of Tor 0.4.6.6.

 Get the specific revision of chutney:

 {{{
 $ git clone https://git.torproject.org/chutney.git
 Cloning into 'chutney'...
 remote: Enumerating objects: 1696, done.
 remote: Counting objects: 100% (1696/1696), done.
 remote: Compressing objects: 100% (1451/1451), done.
 remote: Total 3010 (delta 1056), reused 111 (delta 73)
 Receiving objects: 100% (3010/3010), 671.92 KiB | 1.80 MiB/s, done.
 Resolving deltas: 100% (1874/1874), done.
 $ cd chutney
 $ export PYTHONPATH=$PYTHONPATH:`pwd`/lib
 $ git reset --hard 99bd06c7554b9113af8c0877b6eca4ceb95dcbaa
 }}}

 Run chutney `configure` command, which fails (this example shows Python
 2.7, but it will also fail with Python 3):

 {{{
 $ python2.7 -m chutney.TorNet configure `pwd`/networks/basic
 NOTE: creating
 u'/Users/sajith/projects/tahoe/chutney/net/nodes.1625446580', linking to
 u'/Users/sajith/projects/tahoe/chutney/net/nodes'
 Creating identity key for test000a     with tor-gencert
 Creating identity key for test001a     with tor-gencert
 Creating identity key for test002a     with tor-gencert
 <type 'exceptions.AssertionError'>
 Python 2.7.17: /usr/local/opt/python at 2/bin/python2.7
 Sun Jul  4 20:56:22 2021

 A problem occurred in a Python script.  Here is the sequence of
 function calls leading up to the error, in the order they occurred.

 /usr/local/Cellar/python at 2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py
 in _run_module_as_main(mod_name='chutney.TorNet', alter_argv=1)
   172         sys.argv[0] = fname
   173     return _run_code(code, main_globals, None,
   174                      "__main__", fname, loader, pkg_name)
   175
   176 def run_module(mod_name, init_globals=None,
 fname = '/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py'
 loader = <pkgutil.ImpLoader instance>
 pkg_name = 'chutney'

 /usr/local/Cellar/python at 2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py
 in _run_code(code=<code object <module> at 0x10e8f0230, file
 "/Use...ts/tahoe/chutney/lib/chutney/TorNet.py", line 11>,
 run_globals={'ConfigureNodes': <function ConfigureNodes>, 'DEFAULTS':
 {u'CUR_BOOTSTRAP_PHASE': 1, u'CUR_CONFIG_PHASE': 1, u'CUR_LAUNCH_PHASE':
 1, u'auth_cert_lifetime': 12, u'authorities': u'AlternateDirAuthority
 bleargh bad torrc file!', u'authority': False, u'bootstrap_time': 60,
 u'bridge': False, u'bridgeauthority': False, u'bridges': u'Bridge bleargh
 bad torrc file!', ...}, 'KNOWN_REQUIREMENTS': {u'IPV6': <function
 memoized_fn>}, 'LocalNodeBuilder': <class '__main__.LocalNodeBuilder'>,
 'LocalNodeController': <class '__main__.LocalNodeController'>,
 'MissingBinaryException': <class '__main__.MissingBinaryException'>,
 'Network': <class '__main__.Network'>, 'Node': <class '__main__.Node'>,
 'NodeBuilder': <class '__main__.NodeBuilder'>, 'NodeController': <class
 '__main__.NodeController'>, ...}, init_globals=None, mod_name='__main__',
 mod_fname='/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py',
 mod_loader=<pkgutil.ImpLoader instance>, pkg_name='chutney')
    70                        __loader__ = mod_loader,
    71                        __package__ = pkg_name)
    72     exec code in run_globals
    73     return run_globals
    74
 code = <code object <module> at 0x10e8f0230, file
 "/Use...ts/tahoe/chutney/lib/chutney/TorNet.py", line 11>
 run_globals = {'ConfigureNodes': <function ConfigureNodes>, 'DEFAULTS':
 {u'CUR_BOOTSTRAP_PHASE': 1, u'CUR_CONFIG_PHASE': 1, u'CUR_LAUNCH_PHASE':
 1, u'auth_cert_lifetime': 12, u'authorities': u'AlternateDirAuthority
 bleargh bad torrc file!', u'authority': False, u'bootstrap_time': 60,
 u'bridge': False, u'bridgeauthority': False, u'bridges': u'Bridge bleargh
 bad torrc file!', ...}, 'KNOWN_REQUIREMENTS': {u'IPV6': <function
 memoized_fn>}, 'LocalNodeBuilder': <class '__main__.LocalNodeBuilder'>,
 'LocalNodeController': <class '__main__.LocalNodeController'>,
 'MissingBinaryException': <class '__main__.MissingBinaryException'>,
 'Network': <class '__main__.Network'>, 'Node': <class '__main__.Node'>,
 'NodeBuilder': <class '__main__.NodeBuilder'>, 'NodeController': <class
 '__main__.NodeController'>, ...}

  /Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py in <module>()
  2733         return -1
  2734     return 0
  2735
  2736 if __name__ == '__main__':
  2737     sys.exit(main())
 sys = <module 'sys' (built-in)>
 sys.exit = <built-in function exit>
 main = <function main>

  /Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py in main()
  2729     args = parseArgs()
  2730     f = open(args['network_cfg'])
  2731     result = runConfigFile(args['action'], f.read())
  2732     if result is False:
  2733         return -1
 result undefined
 global runConfigFile = <function runConfigFile>
 args = {u'action': 'configure', u'network_cfg':
 '/Users/sajith/projects/tahoe/chutney/networks/basic'}
 f = <open file '/Users/sajith/projects/tahoe/chutney/networks/basic', mode
 'r'>
 f.read = <built-in method read of file object>

  /Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py in
 runConfigFile(verb='configure', data='# By default, Authorities are not
 configured as ....getN(5) + Client.getN(2)\n\nConfigureNodes(NODES)\n')
  2709         return
  2710
  2711     return getattr(network, verb)()
  2712
  2713
 builtingetattr = <built-in function getattr>
 network = <__main__.Network object>
 verb = 'configure'

  /Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py in
 configure(self=<__main__.Network object>)
  2323
  2324         for b in builders:
  2325             b.config(network)
  2326
  2327         for b in builders:
 b = <__main__.LocalNodeBuilder object>
 b.config = <bound method LocalNodeBuilder.config of
 <__main__.LocalNodeBuilder object>>
 network = <__main__.Network object>

  /Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py in
 config(self=<__main__.LocalNodeBuilder object>, net=<__main__.Network
 object>)
   691     def config(self, net):
   692         """Called to configure a node: creates a torrc file for
 it."""
   693         self._createTorrcFile()
   694         # self._createScripts()
   695
 self = <__main__.LocalNodeBuilder object>
 self._createTorrcFile = <bound method LocalNodeBuilder._createTorrcFile of
 <__main__.LocalNodeBuilder object>>

  /Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py in
 _createTorrcFile(self=<__main__.LocalNodeBuilder object>, checkOnly=False)
   628         # the options that the current tor binary doesn't support
   629         tor = self._env['tor']
   630         tor_version = get_tor_version(tor)
   631         torrc_opts = get_torrc_options(tor)
   632         # check if each option is supported before writing it
 tor_version undefined
 global get_tor_version = <function memoized_fn>
 tor = u'tor'

  /Users/sajith/projects/tahoe/chutney/lib/chutney/Util.py in
 memoized_fn(*args=(u'tor',), **kwargs={})
    12             result = memory[key]
    13         except KeyError:
    14             result = memory[key] = fn(*args, **kwargs)
    15         return result
    16     return memoized_fn
 result undefined
 memory = {}
 key = ((u'tor',), ())
 fn = <function get_tor_version>
 args = (u'tor',)
 kwargs = {}

  /Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py in
 get_tor_version(tor=u'tor')
   353     tor_version = tor_version.replace(").", ")")
   354     # check we received a tor version, and nothing else
   355     assert re.match(r'^[-+.() A-Za-z0-9]+$', tor_version)
   356
   357     return tor_version
 global re = <module 're' from
 '/usr/local/Cellar/python at 2/2....hon.framework/Versions/2.7/lib/python2.7/re.pyc'>
 re.match = <function match>
 tor_version = u'Tor 0.4.6.6.\nTor is running on Darwin with Li...own N/A
 as libc.\nTor compiled with clang 12.0.5'
 <type 'exceptions.AssertionError'>:
     __class__ = <type 'exceptions.AssertionError'>
     __delattr__ = <method-wrapper '__delattr__' of
 exceptions.AssertionError object>
     __dict__ = {}
     __doc__ = 'Assertion failed.'
     __format__ = <built-in method __format__ of exceptions.AssertionError
 object>
     __getattribute__ = <method-wrapper '__getattribute__' of
 exceptions.AssertionError object>
     __getitem__ = <method-wrapper '__getitem__' of
 exceptions.AssertionError object>
     __getslice__ = <method-wrapper '__getslice__' of
 exceptions.AssertionError object>
     __hash__ = <method-wrapper '__hash__' of exceptions.AssertionError
 object>
     __init__ = <method-wrapper '__init__' of exceptions.AssertionError
 object>
     __new__ = <built-in method __new__ of type object>
     __reduce__ = <built-in method __reduce__ of exceptions.AssertionError
 object>
     __reduce_ex__ = <built-in method __reduce_ex__ of
 exceptions.AssertionError object>
     __repr__ = <method-wrapper '__repr__' of exceptions.AssertionError
 object>
     __setattr__ = <method-wrapper '__setattr__' of
 exceptions.AssertionError object>
     __setstate__ = <built-in method __setstate__ of
 exceptions.AssertionError object>
     __sizeof__ = <built-in method __sizeof__ of exceptions.AssertionError
 object>
     __str__ = <method-wrapper '__str__' of exceptions.AssertionError
 object>
     __subclasshook__ = <built-in method __subclasshook__ of type object>
     __unicode__ = <built-in method __unicode__ of
 exceptions.AssertionError object>
     args = ()
     message = ''

 The above is a description of an error in a Python program.  Here is
 the original traceback:

 Traceback (most recent call last):
   File
 "/usr/local/Cellar/python at 2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py",
 line 174, in _run_module_as_main
     "__main__", fname, loader, pkg_name)
   File
 "/usr/local/Cellar/python at 2/2.7.17_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py",
 line 72, in _run_code
     exec code in run_globals
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py", line
 2737, in <module>
     sys.exit(main())
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py", line
 2731, in main
     result = runConfigFile(args['action'], f.read())
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py", line
 2711, in runConfigFile
     return getattr(network, verb)()
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py", line
 2325, in configure
     b.config(network)
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py", line
 693, in config
     self._createTorrcFile()
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py", line
 630, in _createTorrcFile
     tor_version = get_tor_version(tor)
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/Util.py", line
 14, in memoized_fn
     result = memory[key] = fn(*args, **kwargs)
   File "/Users/sajith/projects/tahoe/chutney/lib/chutney/TorNet.py", line
 355, in get_tor_version
     assert re.match(r'^[-+.() A-Za-z0-9]+$', tor_version)
 AssertionError
 }}}

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3744#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list