Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-7256

cbrestore, cbtransfer exit with ImportError: No module named zlib if python installation on the box does not have zlib library ( when python is built from source )

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: None
    • Security Level: Public

      Description

      build 1965

      ./cbrestore
      Traceback (most recent call last):
      File "/opt/couchbase/lib/python/cbrestore", line 8, in <module>
      import pump_transfer
      File "/opt/couchbase/lib/python/pump_transfer.py", line 10, in <module>
      import pump
      File "/opt/couchbase/lib/python/pump.py", line 14, in <module>
      import zlib
      ImportError: No module named zlib

      by default zlib module is disabled in python, it can be enabled using option --with-zlib when configure python.

      but user at least should be notified about this requirements for cbrestore

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        andreibaranouski Andrei Baranouski created issue -
        andreibaranouski Andrei Baranouski made changes -
        Field Original Value New Value
        Summary cbrestore exits with ImportError: No module named zlib cbrestore, cbtransfer exit with ImportError: No module named zlib
        Hide
        andreibaranouski Andrei Baranouski added a comment -

        ./cbtransfer
        Traceback (most recent call last):
        File "/opt/couchbase/lib/python/cbtransfer", line 25, in <module>
        import pump_transfer
        File "/opt/couchbase/lib/python/pump_transfer.py", line 10, in <module>
        import pump
        File "/opt/couchbase/lib/python/pump.py", line 14, in <module>
        import zlib
        ImportError: No module named zlib

        Show
        andreibaranouski Andrei Baranouski added a comment - ./cbtransfer Traceback (most recent call last): File "/opt/couchbase/lib/python/cbtransfer", line 25, in <module> import pump_transfer File "/opt/couchbase/lib/python/pump_transfer.py", line 10, in <module> import pump File "/opt/couchbase/lib/python/pump.py", line 14, in <module> import zlib ImportError: No module named zlib
        Hide
        steve Steve Yen added a comment -

        HI Andrei,
        Can you add more environment info – which O/S and which python version?

        The thought is to understand how common zlib-less python is.

        Thanks,
        Steve

        Show
        steve Steve Yen added a comment - HI Andrei, Can you add more environment info – which O/S and which python version? The thought is to understand how common zlib-less python is. Thanks, Steve
        steve Steve Yen made changes -
        Assignee Steve Yen [ steve ] Andrei Baranouski [ andreibaranouski ]
        Hide
        andreibaranouski Andrei Baranouski added a comment -

        it happens on CentOS release 5.7 but seems like on these hosts default python was upgrade from Python 2.4 to Python 2.7

        [root@localhost bin]# python
        Python 2.7 (r27:82500, Jul 26 2012, 13:27:06)
        [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import zlib
        Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        ImportError: No module named zlib
        >>> exit()
        [root@localhost bin]# /usr/bin/python2.4
        Python 2.4.3 (#1, Sep 21 2011, 19:55:41)
        [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import zlib

        This means that the system has python2.4 with zlib by default but if user upgrade python without zlib configuration he will have these issues.
        This means that the system

        Show
        andreibaranouski Andrei Baranouski added a comment - it happens on CentOS release 5.7 but seems like on these hosts default python was upgrade from Python 2.4 to Python 2.7 [root@localhost bin] # python Python 2.7 (r27:82500, Jul 26 2012, 13:27:06) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import zlib Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named zlib >>> exit() [root@localhost bin] # /usr/bin/python2.4 Python 2.4.3 (#1, Sep 21 2011, 19:55:41) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import zlib This means that the system has python2.4 with zlib by default but if user upgrade python without zlib configuration he will have these issues. This means that the system
        andreibaranouski Andrei Baranouski made changes -
        Assignee Andrei Baranouski [ andreibaranouski ] Steve Yen [ steve ]
        Hide
        farshid Farshid Ghods (Inactive) added a comment -

        this occured on a system where python 2.7 was built from source instead of installation of standard packages which include zlib.

        going to make this bug a release note and assign to docs team

        Show
        farshid Farshid Ghods (Inactive) added a comment - this occured on a system where python 2.7 was built from source instead of installation of standard packages which include zlib. going to make this bug a release note and assign to docs team
        farshid Farshid Ghods (Inactive) made changes -
        Summary cbrestore, cbtransfer exit with ImportError: No module named zlib cbrestore, cbtransfer exit with ImportError: No module named zlib if python installation on the box does not have zlib library ( when python is built from source )
        farshid Farshid Ghods (Inactive) made changes -
        Labels 2.0-release-notes
        Fix Version/s 2.0 [ 10114 ]
        Component/s documentation [ 10012 ]
        Component/s tools [ 10223 ]
        farshid Farshid Ghods (Inactive) made changes -
        Assignee Steve Yen [ steve ] MC Brown [ mccouch ]
        Hide
        mccouch MC Brown (Inactive) added a comment -

        An entry has been added to the release notes as a known issue

        Show
        mccouch MC Brown (Inactive) added a comment - An entry has been added to the release notes as a known issue
        mccouch MC Brown (Inactive) made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        wayne Wayne Siu made changes -
        Component/s documentation-don't-use-put-in-doc-project [ 10012 ]

          People

          • Assignee:
            mccouch MC Brown (Inactive)
            Reporter:
            andreibaranouski Andrei Baranouski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes