Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-247

libcouchbase2-* v2.1.3 packages throw uncaught exceptions when building a Couchbase construct in PHP

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Debian 'Squeeze'
      Linux hostname 2.6.32-5-xen-amd64 #1 SMP Mon Feb 25 02:51:39 UTC 2013
      x86_64 GNU/Linux

      Description

      Brief:
      libcouchbase2-* v2.1.3 packages throw uncaught exceptions when building a
      Couchbase construct in PHP.

      Overview:
      We wrote and tested some php code that needed to interact with our
      couchbase cluster (running 2.1.1 enterprise). We deployed the necessary
      packages to a development server and everything worked as expected. A few
      months later, running through the exact same steps as taken on the
      development servers (I know them to be exact because they were deployed via
      chef), I deployed these packages to the production servers. Attempting to
      create a Couchbase php construct on the production servers continually
      resulted in the following Fatal error:

      PHP Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with
      message 'Failed to create libcouchbase instance'

      After comparing the development (functional) systems with the production
      (failing) systems, the only difference I could determine was the revision
      number of the libcouchbase packages.
      Dev = 2.0.7-2282 (Works)
      Prod = 2.1.3-2402 (Fails)

      I copied the 2.0.7 .deb files from the apt cache of a dev host to a prod
      host. I purged the libcouchbase packages from the prod host and installed
      these manually using dpkg -i. I re-ran my test.php and it worked fine. It
      appears that the updated (2.1.3) libcouchbase packages don't work properly
      with PHP.

      test.php:
      <?php
      $cb = new Couchbase("myCouchbaseHost:8091", "Administrator",
      "MyAdminPassword", "myBucketName");
      ?>

      Failure case (prod server, 2.1.3-2402):
      PHP Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with
      message 'Failed to create libcouchbase instance' in /root/test.php:2
      Stack trace:
      #0 /root/test.php(2): Couchbase->__construct('myCouchbaseHost...',
      'Administrator', 'MyAdminPassword', 'myBucketName')
      #1

      {main}

      thrown in /root/test.php on line 2

      Running the same code on a server with the older packages returns 0 (works).

      I've also listed the libcouchbase package versions for both "good" and
      "bad" servers.
      Good:
      dpkg -l | grep couch
      ii libcouchbase-dev 2.0.7-2282
      library for the Couchbase protocol, development files
      ii libcouchbase2 2.0.7-2282
      library for the Couchbase protocol
      ii libcouchbase2-backend 2.0.7-2282
      library for the Couchbase protocol
      ii libcouchbase2-core 2.0.7-2282
      library for the Couchbase protocol, core files
      ii libcouchbase2-libevent 2.0.7-2282
      library for the Couchbase protocol (libevent backend)

      dpkg -l | grep php
      ii libapache2-mod-php5 5.3.3-7+squeeze17
      server-side, HTML-embedded scripting language (Apache 2 module)
      ii php-pear 5.3.3-7+squeeze17
      PEAR - PHP Extension and Application Repository
      ii php5 5.3.3-7+squeeze15
      server-side, HTML-embedded scripting language (metapackage)
      ii php5-cli 5.3.3-7+squeeze17
      command-line interpreter for the php5 scripting language
      ii php5-common 5.3.3-7+squeeze17
      Common files for packages built from the php5 source
      ii php5-dev 5.3.3-7+squeeze17
      Files for PHP5 module development
      ii php5-suhosin 0.9.32.1-1
      advanced protection module for php5

      cat /etc/apt/sources.list.d/couchbase.list
      deb http://packages.couchbase.com/ubuntu lucid lucid/main

      Bad:
      dpkg -l | grep couchbase
      ii libcouchbase-dbg 2.1.3-2402
      library for the Couchbase protocol, debug symbols
      ii libcouchbase-dev 2.1.3-2402
      library for the Couchbase protocol, development files
      ii libcouchbase2-bin 2.1.3-2402
      library for the Couchbase protocol
      ii libcouchbase2-core 2.1.3-2402
      library for the Couchbase protocol, core files
      ii libcouchbase2-libevent 2.1.3-2402
      library for the Couchbase protocol (libevent backend)

      dpkg -l | grep php
      ii libapache2-mod-php5 5.3.3-7+squeeze17
      server-side, HTML-embedded scripting language (Apache 2 module)
      ii php-pear 5.3.3-7+squeeze17
      PEAR - PHP Extension and Application Repository
      ii php5 5.3.3-7+squeeze15
      server-side, HTML-embedded scripting language (metapackage)
      ii php5-cli 5.3.3-7+squeeze17
      command-line interpreter for the php5 scripting language
      ii php5-common 5.3.3-7+squeeze17
      Common files for packages built from the php5 source
      ii php5-dev 5.3.3-7+squeeze17
      Files for PHP5 module development
      ii php5-suhosin 0.9.32.1-1
      advanced protection module for php5

      cat /etc/apt/sources.list.d/couchbase.list
      deb http://packages.couchbase.com/ubuntu lucid lucid/main

      Workaround:
      Purge any installed libcouchbase2 packages and manually install the 2.0.7
      packages using dpkg.

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

        Activity

        Hide
        mnunberg Mark Nunberg added a comment -

        The username must be the same as the bucket. I guess we should've worded it like this rather than "Administrator is no longer supported"

        Show
        mnunberg Mark Nunberg added a comment - The username must be the same as the bucket. I guess we should've worded it like this rather than "Administrator is no longer supported"
        Hide
        trond Trond Norbye added a comment -

        We've just pushed a patch that improves the error message in this case. I don't know if it really is the solution to your problem (given that the error message don't contain the real cause in your case)..

        Show
        trond Trond Norbye added a comment - We've just pushed a patch that improves the error message in this case. I don't know if it really is the solution to your problem (given that the error message don't contain the real cause in your case)..
        Hide
        avsej Sergey Avseyev added a comment -

        The wording was correct actually I meant not "Administrator" string, but account with administrator powers

        Show
        avsej Sergey Avseyev added a comment - The wording was correct actually I meant not "Administrator" string, but account with administrator powers
        Hide
        ingenthr Matt Ingenthron added a comment -

        Brett: can you see about adding tests to ensure this fails in a reasonable way given the changes in libcouchbase?

        Show
        ingenthr Matt Ingenthron added a comment - Brett: can you see about adding tests to ensure this fails in a reasonable way given the changes in libcouchbase?
        Hide
        ingenthr Matt Ingenthron added a comment -

        Brett: is this planned to be addressed in 1.2?

        Show
        ingenthr Matt Ingenthron added a comment - Brett: is this planned to be addressed in 1.2?

          People

          • Assignee:
            brett19 Brett Lawson
            Reporter:
            skumar Saran Kumar (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes