Infrastructure
  1. Infrastructure
  2. INFRA-4922

Python ldap has stopped working on minotaur/people

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Fix Version/s: Initial Clearing
    • Component/s: None
    • Labels:
      None
    • Environment:
      minotaur/people

      Description

      The Python ldap module seems to have got lost in the recent restart/upgrade of minotaur.

      This causes problems for the people application run by apsite:

      The apsite build is failing with:

       File "./keys-fetch.py", line 28, in <module>
         import ldap
      ImportError: No module named ldap

      This will probably also affect some infra scripts, if they are run on minotaur (for example generate-dotqmail-availid.py uses ldap)

        Activity

        Hide
        Sebb added a comment -
        I can confirm that import ldap works OK now.
        Thanks! I'll remove the workrounds from the people.a.o scripts

        The system path is now as follows:

        /usr/local/lib/python2.7/site-packages/distribute-0.6.35-py2.7.egg
        /usr/local/lib/python2.7/site-packages/pyasn1-0.1.4-py2.7.egg
        /usr/local/lib/python2.7/site-packages/zope.interface-3.8.0-py2.7-freebsd-9.1-RELEASE-p3-amd64.egg
        /usr/local/lib/python2.7/site-packages/pyasn1_modules-0.0.4-py2.7.egg
        /usr/local/lib/python2.7/site-packages/python_ldap-2.4.10-py2.7-freebsd-9.1-RELEASE-p3-amd64.egg
        /usr/local/lib/python2.7/site-packages/Babel-0.9.6-py2.7.egg
        /usr/local/lib/python2.7/site-packages/MarkupSafe-0.15-py2.7-freebsd-9.1-RELEASE-p3-amd64.egg
        /usr/local/lib/python2.7/site-packages/Beaker-1.6.4-py2.7.egg
        /usr/local/lib/python2.7/site-packages/Mako-0.8.0-py2.7.egg
        /usr/local/lib/python2.7/site-packages/flup-1.0.2-py2.7.egg
        /usr/local/lib/python27.zip
        /usr/local/lib/python2.7
        /usr/local/lib/python2.7/plat-freebsd9
        /usr/local/lib/python2.7/lib-tk
        /usr/local/lib/python2.7/lib-old
        /usr/local/lib/python2.7/lib-dynload
        /usr/local/lib/python2.7/site-packages
        /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info

        As can be seen above it now includes the ldap egg
        Show
        Sebb added a comment - I can confirm that import ldap works OK now. Thanks! I'll remove the workrounds from the people.a.o scripts The system path is now as follows: /usr/local/lib/python2.7/site-packages/distribute-0.6.35-py2.7.egg /usr/local/lib/python2.7/site-packages/pyasn1-0.1.4-py2.7.egg /usr/local/lib/python2.7/site-packages/zope.interface-3.8.0-py2.7-freebsd-9.1-RELEASE-p3-amd64.egg /usr/local/lib/python2.7/site-packages/pyasn1_modules-0.0.4-py2.7.egg /usr/local/lib/python2.7/site-packages/python_ldap-2.4.10-py2.7-freebsd-9.1-RELEASE-p3-amd64.egg /usr/local/lib/python2.7/site-packages/Babel-0.9.6-py2.7.egg /usr/local/lib/python2.7/site-packages/MarkupSafe-0.15-py2.7-freebsd-9.1-RELEASE-p3-amd64.egg /usr/local/lib/python2.7/site-packages/Beaker-1.6.4-py2.7.egg /usr/local/lib/python2.7/site-packages/Mako-0.8.0-py2.7.egg /usr/local/lib/python2.7/site-packages/flup-1.0.2-py2.7.egg /usr/local/lib/python27.zip /usr/local/lib/python2.7 /usr/local/lib/python2.7/plat-freebsd9 /usr/local/lib/python2.7/lib-tk /usr/local/lib/python2.7/lib-old /usr/local/lib/python2.7/lib-dynload /usr/local/lib/python2.7/site-packages /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info As can be seen above it now includes the ldap egg
        Hide
        Mark Thomas added a comment -
        I've confirmed that import ldap no longer generates an error on people.a.o.
        The security/cyrus-sasl2 was not required (and trying to use it caused all sorts of issues for other ports).
        Show
        Mark Thomas added a comment - I've confirmed that import ldap no longer generates an error on people.a.o. The security/cyrus-sasl2 was not required (and trying to use it caused all sorts of issues for other ports).
        Hide
        Mark Thomas added a comment -
        security/cyrus-sasl2 looks to be a red herring. py-ldap2 builds for other machines without SASL.
        Show
        Mark Thomas added a comment - security/cyrus-sasl2 looks to be a red herring. py-ldap2 builds for other machines without SASL.
        Hide
        Mark Thomas added a comment -
        Added security/cyrus-sasl2 for upcoming ports and kernel update
        Show
        Mark Thomas added a comment - Added security/cyrus-sasl2 for upcoming ports and kernel update
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> Noting that net/py-ldap2 responds to WITH_SASL (and WITH_OPENLDAP_SASL) knobs
        Show
        #asfinfra IRC Bot added a comment - <danielsh> Noting that net/py-ldap2 responds to WITH_SASL (and WITH_OPENLDAP_SASL) knobs
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> security/cyrus-sasl2
        Show
        #asfinfra IRC Bot added a comment - <danielsh> security/cyrus-sasl2
        Hide
        Jake Farrell added a comment -
        cyrus-sasl2 package missing from minotaur. After building the python_ldap locally and linking against sasl I can successfully 'import ldap' with PYTHONPATH
        Show
        Jake Farrell added a comment - cyrus-sasl2 package missing from minotaur. After building the python_ldap locally and linking against sasl I can successfully 'import ldap' with PYTHONPATH
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> Question, why doesn't original-password.py generate an error mail to root@ every week?
        Show
        #asfinfra IRC Bot added a comment - <danielsh> Question, why doesn't original-password.py generate an error mail to root@ every week?
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> Given that no important ldap/scripts/operation/ stuff is affected, inclined to just wait for the next ports upgrade.
        Show
        #asfinfra IRC Bot added a comment - <danielsh> Given that no important ldap/scripts/operation/ stuff is affected, inclined to just wait for the next ports upgrade.
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> No update, I could look into it eventually but feel free to beat me to it.
        Show
        #asfinfra IRC Bot added a comment - <danielsh> No update, I could look into it eventually but feel free to beat me to it.
        Hide
        Tony Stevenson added a comment -
        Daniel, any update sil vous plait?
        Show
        Tony Stevenson added a comment - Daniel, any update sil vous plait?
        Hide
        Tony Stevenson added a comment -
        Transitioning to waiting for Infra
        Show
        Tony Stevenson added a comment - Transitioning to waiting for Infra
        Hide
        Sebb added a comment -
        I assume you mean: why is the entry missing from sys.path even though the package is present?

        If you are looking at problems with sys.path, there are some entries that do not exist in the file system:

        /usr/local/lib/python27.zip
        /usr/local/lib/python2.7/lib-old

        And at least one other possible missing entry which does exist in /usr/local/lib/python2.7/site-packages but not in sys.path

        simplejson-2.1.3-py2.7-freebsd-9.0-RELEASE-p4+r227802-amd64.egg
        Show
        Sebb added a comment - I assume you mean: why is the entry missing from sys.path even though the package is present? If you are looking at problems with sys.path, there are some entries that do not exist in the file system: /usr/local/lib/python27.zip /usr/local/lib/python2.7/lib-old And at least one other possible missing entry which does exist in /usr/local/lib/python2.7/site-packages but not in sys.path simplejson-2.1.3-py2.7-freebsd-9.0-RELEASE-p4+r227802-amd64.egg
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> I'm not a fan of papering over problems without understanding them.
        Show
        #asfinfra IRC Bot added a comment - <danielsh> I'm not a fan of papering over problems without understanding them.
        Hide
        Sebb added a comment -
        Would it not just be simpler to fix the system path?

        The current setting as given by the script is shown below.
        ---
        import sys
        for I in sys.path:
            print I
        ---

        /x1/home/sebb
        /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg
        /usr/local/lib/python2.7/site-packages/zope.interface-3.8.0-py2.7-freebsd-9.0-RELEASE-p4+r227802-amd64.egg
        /usr/local/lib/python2.7/site-packages/pyasn1-0.1.2-py2.7.egg
        /usr/local/lib/python2.7/site-packages/pyasn1_modules-0.0.2-py2.7.egg
        /usr/local/lib/python2.7/site-packages/MarkupSafe-0.15-py2.7-freebsd-9.0-RELEASE-p4+r227802-amd64.egg
        /usr/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg
        /usr/local/lib/python2.7/site-packages/Babel-0.9.6-py2.7.egg
        /usr/local/lib/python2.7/site-packages/Mako-0.6.1-py2.7.egg
        /usr/local/lib/python2.7/site-packages/flup-1.0.2-py2.7.egg
        /usr/local/lib/python27.zip
        /usr/local/lib/python2.7
        /usr/local/lib/python2.7/plat-freebsd9
        /usr/local/lib/python2.7/lib-tk
        /usr/local/lib/python2.7/lib-old
        /usr/local/lib/python2.7/lib-dynload
        /usr/local/lib/python2.7/site-packages

        The python directory is present (otherwise the work-round would not work):

        drwxr-xr-x 4 root wheel 17 Jun 20 11:42 /usr/local/lib/python2.7/site-packages/python_ldap-2.4.7-py2.7-freebsd-9.0-RELEASE-amd64.egg

        It just needs to be added to the default system path, and the work-round can then be removed.
        Show
        Sebb added a comment - Would it not just be simpler to fix the system path? The current setting as given by the script is shown below. --- import sys for I in sys.path:     print I --- /x1/home/sebb /usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg /usr/local/lib/python2.7/site-packages/zope.interface-3.8.0-py2.7-freebsd-9.0-RELEASE-p4+r227802-amd64.egg /usr/local/lib/python2.7/site-packages/pyasn1-0.1.2-py2.7.egg /usr/local/lib/python2.7/site-packages/pyasn1_modules-0.0.2-py2.7.egg /usr/local/lib/python2.7/site-packages/MarkupSafe-0.15-py2.7-freebsd-9.0-RELEASE-p4+r227802-amd64.egg /usr/local/lib/python2.7/site-packages/Beaker-1.6.2-py2.7.egg /usr/local/lib/python2.7/site-packages/Babel-0.9.6-py2.7.egg /usr/local/lib/python2.7/site-packages/Mako-0.6.1-py2.7.egg /usr/local/lib/python2.7/site-packages/flup-1.0.2-py2.7.egg /usr/local/lib/python27.zip /usr/local/lib/python2.7 /usr/local/lib/python2.7/plat-freebsd9 /usr/local/lib/python2.7/lib-tk /usr/local/lib/python2.7/lib-old /usr/local/lib/python2.7/lib-dynload /usr/local/lib/python2.7/site-packages The python directory is present (otherwise the work-round would not work): drwxr-xr-x 4 root wheel 17 Jun 20 11:42 /usr/local/lib/python2.7/site-packages/python_ldap-2.4.7-py2.7-freebsd-9.0-RELEASE-amd64.egg It just needs to be added to the default system path, and the work-round can then be removed.
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> Thanks. BTW, I've copied the pkg_add-compatible package to minotaur:/tmp/py27-ldap2.tbz. It triggers a compiler error when install is attempted.
        Show
        #asfinfra IRC Bot added a comment - <danielsh> Thanks. BTW, I've copied the pkg_add-compatible package to minotaur:/tmp/py27-ldap2.tbz. It triggers a compiler error when install is attempted.
        Hide
        Sebb added a comment -
        Yes, I tested it before updating the source in SVN.

        And the error messages regarding Python ldap to site dev have stopped.
        Show
        Sebb added a comment - Yes, I tested it before updating the source in SVN. And the error messages regarding Python ldap to site dev have stopped.
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> did it actually work? It occurred to me later that trying to actually call ldap.* after the import, might fail.
        Show
        #asfinfra IRC Bot added a comment - <danielsh> did it actually work? It occurred to me later that trying to actually call ldap.* after the import, might fail.
        Hide
        Sebb added a comment -
        Added work-round to the two keys python scripts (there are probably other places that need the work-round)
        Show
        Sebb added a comment - Added work-round to the two keys python scripts (there are probably other places that need the work-round)
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> Installing the port shows 'Modules/LDAPObject.h:12:2: error: #error Current python-ldap requires OpenLDAP 2.x'. It also seems to use /opt/openldap-RE24 as $prefix despite the port's makefile doing something else.
        Show
        #asfinfra IRC Bot added a comment - <danielsh> Installing the port shows 'Modules/LDAPObject.h:12:2: error: #error Current python-ldap requires OpenLDAP 2.x'. It also seems to use /opt/openldap-RE24 as $prefix despite the port's makefile doing something else.
        Hide
        #asfinfra IRC Bot added a comment -
        <danielsh> Workaround: sys.path.extend(['/usr/local/lib/python2.7/site-packages/python_ldap-2.4.7-py2.7-freebsd-9.0-RELEASE-amd64.egg']). Not sure why mino needs that and hermes doesn't.
        Show
        #asfinfra IRC Bot added a comment - <danielsh> Workaround: sys.path.extend(['/usr/local/lib/python2.7/site-packages/python_ldap-2.4.7-py2.7-freebsd-9.0-RELEASE-amd64.egg']). Not sure why mino needs that and hermes doesn't.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sebb
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development