cryptography is failing to install

Bug #1446882 reported by Joe Gordon
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack-Gate
Fix Committed
Undecided
Unassigned
tripleo
Invalid
Undecided
Unassigned

Bug Description

http://logs.openstack.org/50/142950/3/gate/gate-horizon-pep8/b3c9895/console.html#_2015-04-21_21_54_50_733

started on 4/21

query: message:"TypeError: cannot create weak reference to 'Struct' object" AND tags:"console.html"

Revision history for this message
Delyan Raychev (delqn) wrote :

As it turns out pycparser-2.11 is the culprit for this error message/bug.

pip uninstall pycparser && pip install -Iv pycparser==2.10

and permanently pinning pycparser to 2.10 or earlier fixes the issue

Revision history for this message
Joe Gordon (jogo) wrote :
Revision history for this message
Kai Qiang Wu(Kennan) (wkqwu) wrote :

I hit the same issue.

Revision history for this message
Kai Qiang Wu(Kennan) (wkqwu) wrote :

with latest devstack, hit such issue

      from cryptography.hazmat.bindings.commoncrypto.binding import (
    File "/tmp/pip-build-ivmMZs/cryptography/src/cryptography/hazmat/bindings/commoncrypto/binding.py", line 14, in <module>
      class Binding(object):
    File "/tmp/pip-build-ivmMZs/cryptography/src/cryptography/hazmat/bindings/commoncrypto/binding.py", line 36, in Binding
      "-framework", "Security", "-framework", "CoreFoundation"
    File "/tmp/pip-build-ivmMZs/cryptography/src/cryptography/hazmat/bindings/utils.py", line 97, in build_ffi_for_binding
      extra_link_args=extra_link_args,
    File "/tmp/pip-build-ivmMZs/cryptography/src/cryptography/hazmat/bindings/utils.py", line 106, in build_ffi
      ffi.cdef(cdef_source)
    File "/tmp/pip-build-ivmMZs/cryptography/.eggs/cffi-0.9.2-py2.7-linux-x86_64.egg/cffi/api.py", line 106, in cdef
      self._parser.parse(csource, override=override, packed=packed)
    File "/tmp/pip-build-ivmMZs/cryptography/.eggs/cffi-0.9.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 165, in parse
      self._internal_parse(csource)
    File "/tmp/pip-build-ivmMZs/cryptography/.eggs/cffi-0.9.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 199, in _internal_parse
      realtype = self._get_type(decl.type, name=decl.name)
    File "/tmp/pip-build-ivmMZs/cryptography/.eggs/cffi-0.9.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 360, in _get_type
      return self._get_struct_union_enum_type('struct', type, name)
    File "/tmp/pip-build-ivmMZs/cryptography/.eggs/cffi-0.9.2-py2.7-linux-x86_64.egg/cffi/cparser.py", line 434, in _get_struct_union_enum_type
      return self._structnode2type[type]
    File "/usr/lib/python2.7/weakref.py", line 315, in __getitem__
      return self.data[ref(key)]
  TypeError: cannot create weak reference to 'Struct' object

Revision history for this message
Tracy Jones (tjones-i) wrote :

i hit it too. Tried the workaround and still can't get past it.

Revision history for this message
Tracy Jones (tjones-i) wrote :

work around worked - i just needed to re-create my venv.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

There's an issue further upstream in pycparser: https://github.com/eliben/pycparser/issues/76

Revision history for this message
Kai Qiang Wu(Kennan) (wkqwu) wrote :
Download full text (3.2 KiB)

the above work-around not worked : pip uninstall pycparser && pip install -Iv pycparser==2.10

as it still failed in tempest install stage in devstack:
    Complete output from command /opt/stack/tempest/.tox/full/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-vweh8l/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-g9w1On-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/stack/tempest/.tox/full/include/site/python2.7/cryptography:
    running install
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-vweh8l/cryptography/setup.py", line 342, in <module>
        **keywords_with_side_effects(sys.argv)
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command
        cmd_obj.ensure_finalized()
      File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
        self.finalize_options()
      File "/tmp/pip-build-vweh8l/cryptography/setup.py", line 119, in finalize_options
        self.distribution.ext_modules = get_ext_modules()
      File "/tmp/pip-build-vweh8l/cryptography/setup.py", line 78, in get_ext_modules
        from cryptography.hazmat.bindings.commoncrypto.binding import (
      File "/tmp/pip-build-vweh8l/cryptography/src/cryptography/hazmat/bindings/commoncrypto/binding.py", line 14, in <module>
        class Binding(object):
      File "/tmp/pip-build-vweh8l/cryptography/src/cryptography/hazmat/bindings/commoncrypto/binding.py", line 36, in Binding
        "-framework", "Security", "-framework", "CoreFoundation"
      File "/tmp/pip-build-vweh8l/cryptography/src/cryptography/hazmat/bindings/utils.py", line 97, in build_ffi_for_binding
        extra_link_args=extra_link_args,
      File "/tmp/pip-build-vweh8l/cryptography/src/cryptography/hazmat/bindings/utils.py", line 106, in build_ffi
        ffi.cdef(cdef_source)
      File "/opt/stack/tempest/.tox/full/local/lib/python2.7/site-packages/cffi/api.py", line 106, in cdef
        self._parser.parse(csource, override=override, packed=packed)
      File "/opt/stack/tempest/.tox/full/local/lib/python2.7/site-packages/cffi/cparser.py", line 165, in parse
        self._internal_parse(csource)
      File "/opt/stack/tempest/.tox/full/local/lib/python2.7/site-packages/cffi/cparser.py", line 199, in _internal_parse
        realtype = self._get_type(decl.type, name=decl.name)
      File "/opt/stack/tempest/.tox/full/local/lib/python2.7/site-packages/cffi/cparser.py", line 360, in _get_type
        return self._get_struct_union_enum_type('struct', type, name)
      File "/opt/stack/tempest/.tox/full/local/lib/python2.7/site-packages/cffi/cparser.py", line 434, in _get_struct_union_enum_type
        return self._structnode2type[type]
      File "/usr/lib/python2.7/weakref.py", line 315, in __getitem__
        return self.data[ref(ke...

Read more...

Revision history for this message
Joe Gordon (jogo) wrote :
Changed in openstack-gate:
status: New → Invalid
status: Invalid → Fix Committed
Changed in tripleo:
status: New → Invalid
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.