Details
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
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.