[PCBC-296] errors not propagated when not all nodes are accessable for views Created: 25/Sep/14  Updated: 25/Sep/14

Status: Open
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: 1.2.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Minor
Reporter: Matt Ingenthron Assignee: Brett Lawson
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
From IRC conversation, when one node wasn't available via port 8092, errors weren't propagated back through the view method.

From the convo:

Does someone what is wrong if the getView return NULL in staid of expecting array? Marcus_ @ 10:44
It is really weird, if i run $result = $this->couchbase->view($document, $view, $optionList, $returnErrors); It sometimes returns NULL, if i time the function call then it says about "Took: 0.00014" if i do it again (same request) it takes about 0.03 seconds and does return the expected data 10:45
So it response really fast "null". On the server logs i do not see any information about the view request. (or i am searching the wrong logs) 10:46
ingenthr
are you changing the underlying data between Marcus_? ingenthr @ 10:46
mwuk_ [~mwuk@90.195.128.76] entered the room. 10:46
ingenthr
though it takes some effort to dig in there, the logs may give some info on the execution ingenthr @ 10:47
mrevell left the room (quit: Remote host closed the connection). 10:47
macpaddy
Marcus_: I know you mentioned before you only see this behavior from the SDK and not in the ui? Is that correct macpaddy @ 10:48
? 10:48
JMauss [~jrm@206.169.106.2] entered the room. 10:48
Marcus_
Yes indeed Marcus_ @ 10:49
mwuk left the room (quit: Ping timeout: 260 seconds). 10:49
mwuk_ is now known as mwuk 10:49
You have disconnected 10:49
You have connected 10:51
The topic for #couchbase is: Try 3.0 beta! couchbase.com/beta. Current EE release is 2.5.1, CE is 2.2.0, see: couchbase.com/download. See also #libcouchbase client library discussions. Get the source for all releases here: https://github.com/couchbase/manifest. 10:51
Topic for #couchbase set by ingenthr!~ingenthr@cpe-104-34-202-224.socal.res.rr.com at 19:59:31 on 07/29/14 10:51
mode (+v ingenthr) by ChanServ 10:51
Marcus_
It indeed is php Marcus_ @ 10:52
macpaddy
If you got a simple script turn on LCB logging. macpaddy @ 10:52
LCB = libcouchbase 10:53
 Marcus_
macpaddy: You found the solution, the webserver can not access 1 of the servers 8092 port Marcus_ @ 10:53
Thanks a lot 10:54
:) 10:54
 macpaddy
excellent, should have nailed that one a little earlier. macpaddy @ 10:54
Marcus_
Yea i failed here Marcus_ @ 10:55
macpaddy
No, the SDK should have given a useful error message back. macpaddy @ 10:56
i.e cannot open a connection to node X 10:56
 Marcus_
Yea that would have been nice right :) the hard part was the NULL response i can not do a lot with Marcus_ @ 10:56
ingenthr
even the errors was null? ingenthr @ 10:57
the good news is the new 2.0 PHP SDK should have much better error handling for you 10:57
(unless this was 2.0?) 10:58
 Marcus_
There was not error, the response of the view was null Marcus_ @ 10:58
Also there was no exception or warning. 10:58
No this was php 1.x (newest) 10:58
:) 10:58





[PCBC-295] "PHP Warning: Invalid callback , no array or string given in CouchbaseNative on line 1075" in CouchbaseBucket->upsert Created: 24/Sep/14  Updated: 29/Sep/14

Status: Open
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0
Fix Version/s: .next
Security Level: Public

Type: Bug Priority: Critical
Reporter: Artem Teleshev Assignee: Brett Lawson
Resolution: Unresolved Votes: 0
Labels: debian, linux
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: php 5.5.17
couchbase ext 2.0.0 from http://pecl.php.net/package/couchbase
couchbase-server-enterprise_2.5.1_x86_64.deb


 Description   
$offers = [
  'key1' => 'val1',
  'key2' => 'val2',
  'key3' => 'val3',
];

$cb = new \CouchbaseCluster('127.0.0.1');
$db = $cb->openBucket('all_directions');
$db->upsert($offers); -> show PHP Warning
$db->upsert(array_keys($offers), $offers); -> show PHP Warning

CouchbaseBucket.class.php

public function upsert($ids, $val = NULL, $options = array()) {




[PCBC-294] Conflicts with XDebug Created: 20/Sep/14  Updated: 20/Sep/14

Status: Open
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Remi Collet Assignee: Brett Lawson
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
$ gdb php
(gdb) run -n -d zend_extension=xdebug.so -dextension=modules/couchbase.so --re couchbase
...
Program received signal SIGSEGV, Segmentation fault.
...
(gdb) bt
#0 0x00007fffed533a9e in xdebug_execute_internal (current_execute_data=0x7ffff7f78668, fci=0x0, return_value_used=0)
    at /usr/src/debug/php-pecl-xdebug-2.2.5/NTS/xdebug.c:1589
#1 0x000055555582c3c0 in zend_do_fcall_common_helper_SPEC (execute_data=<optimized out>) at /usr/src/debug/php-5.6.1RC1/Zend/zend_vm_execute.h:560
#2 0x00005555557c32d8 in execute_ex (execute_data=0x7ffff7f78668) at /usr/src/debug/php-5.6.1RC1/Zend/zend_vm_execute.h:363
#3 0x0000555555777db9 in dtrace_execute_ex (execute_data=<optimized out>) at /usr/src/debug/php-5.6.1RC1/Zend/zend_dtrace.c:73
#4 0x00007fffed532fcc in xdebug_execute_ex (execute_data=0x7ffff7f78668) at /usr/src/debug/php-pecl-xdebug-2.2.5/NTS/xdebug.c:1437
#5 0x000055555577b61a in zend_eval_stringl (
    str=0x7fffed318f10 "/**\n * Various constants used for flags, data-type encoding and decoding, etc...\n * throughout this SDK.\n *\n * @author Brett Lawson <brett19@gmail.com>\n */\n\n/** @internal */ define('COUCHBASE_VAL_MASK"..., str_len=<optimized out>, retval_ptr=retval_ptr@entry=0x0,
    string_name=string_name@entry=0x7fffed318e8b "CouchbaseNative") at /usr/src/debug/php-5.6.1RC1/Zend/zend_execute_API.c:1080
#6 0x000055555577b6f6 in zend_eval_string (str=<optimized out>, retval_ptr=retval_ptr@entry=0x0, string_name=string_name@entry=0x7fffed318e8b "CouchbaseNative")
    at /usr/src/debug/php-5.6.1RC1/Zend/zend_execute_API.c:1119
#7 0x00007fffed31497c in zm_activate_couchbase (type=<optimized out>, module_number=<optimized out>) at /tmp/couchbase-2.0.0/couchbase.c:63
#8 0x0000555555790060 in zend_activate_modules () at /usr/src/debug/php-5.6.1RC1/Zend/zend_API.c:2414
#9 0x00005555557265da in php_request_startup () at /usr/src/debug/php-5.6.1RC1/main/main.c:1672
#10 0x000055555582da05 in do_cli (argc=7, argv=0x555555b85880) at /usr/src/debug/php-5.6.1RC1/sapi/cli/php_cli.c:965
#11 0x0000555555611550 in main (argc=7, argv=0x555555b85880) at /usr/src/debug/php-5.6.1RC1/sapi/cli/php_cli.c:1378





[PCBC-293] fastlz extension Created: 20/Sep/14  Updated: 20/Sep/14  Resolved: 20/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Remi Collet Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
In phpstubstr.h : fastlz_compress

What is the extension providing this function ?

In config.m4 I see
        PHP_ADD_EXTENSION_DEP(couchbase, json)
and in couchbase.c
        ZEND_MODULE_REQUIRED("json"),

But nothing for igbinary or fastlz.


 Comments   
Comment by Brett Lawson [ 20/Sep/14 ]
igbinary and fastlz are both no longer required to utilize the SDK. They are only used when the SDK requires them, and the use of them is evaluated late in the process enough to have them already available if they are installed.
Comment by Remi Collet [ 20/Sep/14 ]
But please, what is the extension which provides fastlz_* functions ?
There is no "official" on pecl ?
Any github link ?




[PCBC-292] Missing LICENSE Created: 20/Sep/14  Updated: 20/Sep/14  Resolved: 20/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 2.0.0
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Remi Collet Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
This file is mandatory for packaging.
Present in github repo, just missing in package.xml

 Comments   
Comment by Brett Lawson [ 20/Sep/14 ]
Corrected.




[PCBC-291] PHP - hashkey needs to be marked as volatile and clear that it's experimental and libmemcached compat oriented Created: 10/Sep/14  Updated: 15/Sep/14  Resolved: 15/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: 1.2.1, 1.2.2, 2.0.0-dp1, 2.0.0-dp2, 2.0.0-beta
Fix Version/s: 2.0.0-beta2
Security Level: Public

Type: Bug Priority: Blocker
Reporter: Matt Ingenthron Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
This isn't described correctly in the API documentation and needs to be.

Please do so in any source code as well so it's not accidentally discovered. This is not a feature of the system currently.

Recommended text for a comment:
/* Note that hashkey/groupid is not a supported feature of Couchbase Server and this client. It should be considered volatile and experimental. Using this could lead to an unbalanced cluster, inability to interoperate with the data from other languages, not being able to use the Couchbase Server UI to look up documents and other possible future upgrade/migration concerns. */




[PCBC-290] "PHP Notice: Undefined index: error in CouchbaseNative on line 872" shown in views Created: 05/Sep/14  Updated: 08/Sep/14  Resolved: 08/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0-dp2
Fix Version/s: 2.0.0-beta2
Security Level: Public

Type: Task Priority: Major
Reporter: Mark Nunberg Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
This notice is printed out during any view query. Looking in the source code, something like this might work:

-" if ($out['error']) {\n" \
+" if (array_key_exists($out, 'error') && $out['error']) {\n" \





[PCBC-289] Lacking a way to print the full view query before execution Created: 05/Sep/14  Updated: 08/Sep/14  Resolved: 08/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0-dp2
Fix Version/s: 2.0.0-beta2
Security Level: Public

Type: Task Priority: Major
Reporter: Mark Nunberg Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Previously this was present in the client as genViewQuery() or similar, and was used by quite a few folks to debug their views by simply copy/pasting the output into their web browser, and the like. This functionality no longer seems to be present in the current SDK




[PCBC-288] reduce parameter missing in CouchbaseViewQuery Created: 05/Sep/14  Updated: 08/Sep/14  Resolved: 08/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0-dp2
Fix Version/s: 2.0.0-beta2
Security Level: Public

Type: Task Priority: Major
Reporter: Mark Nunberg Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The reduce() function is not documented, and when used, ends up throwing a weird error during query time:

$query->limit(5);
$query->reduce(false);
$query->stale(CouchbaseViewQuery::UPDATE_NONE);

Fatal error: Uncaught exception 'CouchbaseException' with message 'query_parse_error: Invalid boolean parameter: []' in CouchbaseNative:873
Stack trace:
#0 CouchbaseNative(917): CouchbaseBucket->_view('_view', 'beer', 'brewery_beers', Array)
#1 /Users/mnunberg/Source/musical-chairs-php/tmp.php(17): CouchbaseBucket->query(Object(_CouchbaseDefaultViewQuery))
#2 {main}
  thrown in CouchbaseNative on line 873




[PCBC-287] Add getFromReplica Created: 02/Sep/14  Updated: 08/Sep/14  Resolved: 08/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0-beta
Fix Version/s: 2.0.0-beta2
Security Level: Public

Type: Bug Priority: Major
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Implement the getFromReplica operation.




[PCBC-286] Implement Common Flags Created: 27/Aug/14  Updated: 09/Sep/14  Resolved: 09/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-beta2
Security Level: Public

Type: Task Priority: Major
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Implement the Common Flags formatting as defined by the specification.




[PCBC-285] Upload updated sample code. Created: 25/Aug/14  Updated: 02/Sep/14  Resolved: 02/Sep/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-beta2
Security Level: Public

Type: Task Priority: Major
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Forgot to upload the updates and lost the repo.




[PCBC-284] web request failed Created: 21/Jul/14  Updated: 25/Aug/14  Resolved: 25/Aug/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: lin luke Assignee: Brett Lawson
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Now, we have spurious failures on errors like this:

Server error during processing: ["web request failed",
 {path,"/pools/default/bucketsStreaming/Main"},
 {type,exit},
 {what,
 {timeout,
 {gen_server,call,
 [ns_cookie_manager,cookie_get]}}},
 {trace,
 [{gen_server,call,2},
 {menelaus_web,build_nodes_info_fun,3},
 {menelaus_web_buckets,
 build_bucket_node_infos,5},
 {menelaus_web_buckets,build_bucket_info,5},
 {menelaus_web,streaming_inner,3},
 {menelaus_web,handle_streaming,4},
 {menelaus_web_buckets,
 checking_bucket_access,4},
 {menelaus_web,loop,3}]}]

Any ideas where to start in debugging this?

 Comments   
Comment by Brett Lawson [ 03/Aug/14 ]
Hey lin,

This looks like an issue with Couchbase Server itself. Would you be able to provide your environment details so that I can direct this ticket to its properly project?

Thanks! Brett
Comment by Brett Lawson [ 25/Aug/14 ]
I'm going to mark this ticket as incomplete now. If you continue to encounter the issue, please provide the requested information and I'd be happy to re-open it!

Cheers, Brett




[PCBC-283] Unable to connect to second cluster while using same bucket name in PHP configuration cache Created: 04/Sep/13  Updated: 26/Jun/14  Resolved: 26/Jun/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Bug Priority: Major
Reporter: Larry Liu Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Environment:
1. PHP SDK 1.1.5
2. CentOs 6.4
3. Set up the couchbase cache config path in php.ini.
4. Couchbase Enterprise 2.1.0

Test scenario:
1. Set up two separate clusters, representing two separate data centers.
2. Set up the cache config path in php.ini (from another location outside
the clusters)
3. Set up a bucket (any type), with the same name on both clusters.
4. Create a script that first loads some data on cluster one, then
immediately loads the same on cluster two.

Expected Results:
The data should be loaded to cluster two.

Actual Results:
The data never makes it to cluster two because the cache file is by bucket
name. In the cache file, there is the map of just the first cluster.
Subsequent sets and gets use the cache file no matter what hosts are used
in the connection (in code).

 Comments   
Comment by Mark Nunberg [ 10/Jan/14 ]
This is a limitation in the config_cache algorithm. The only way to actually solve this is to place the bucket and/or cluster UUID as part of the constructor parameters, which would not be possible in the first connection attempt anyway.
Comment by Mark Nunberg [ 26/Jun/14 ]
If user intends to use multiple buckets with the same name throughout different clusters, then they must choose unique configuration cache names for each. There is absolutely no way for the client to know preemptively what cluster a bucket resides on, and if that's the cluster the user "Intended". There may be a way to know this in the future if a user passes in the bucket UUID, but that's another story..
Comment by Matt Ingenthron [ 26/Jun/14 ]
Are you saying that there is a method to have different config cache names? I believe there was not a way to set this up at the time this issue was opened. Please advise if it's something that is in a later lcb or needs to be added as a feature to PHP's use of the config cache.
Comment by Mark Nunberg [ 26/Jun/14 ]
Yes there is. I believe this feature has always been supported, however if _no_ name is provided it will default to using the bare name of the bucket as a file, but in libcouchbase it is possible to for example use: "/tmp/mybucket_cluster_1" and "/tmp/mybucket_cluster_2" for the bucket named "mybucket" which exists individually on cluster 1 and cluster 2 respectively.

This feature has been in libcouchbase since the original config cache implementation in version 2.0.5.

Unfortunately it seems PHP only allows to configure the _directory_ in which the cache file is created (and this itself is only possible at the php.ini level):

https://github.com/couchbase/php-ext-couchbase/blob/master/create.c#L402-405

I'll move this issue to PCBC
Comment by Brett Lawson [ 26/Jun/14 ]
Considering this ticket is so old. I'd suggest using the new 2.0 SDK which does not exhibit this issue due to being able to specify cacheing directly for each bucket.




[PCBC-281] getReplica() unpredictable behavior array_key_exists() implementation Created: 29/May/14  Updated: 30/May/14  Resolved: 29/May/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.2.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Critical
Reporter: Harry Danes Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: - Centos 6.5 X86_64
- PHP 5.5.12
- libcouchbase version => 2.3.1


 Description   
I'm planning to use Couchbase as a PHP session storage. In the current test setup I've two Couchbase nodes with one node in "Down" state. The data isn't rebalanced yet.

Unfortunately the array which is returned in the getReplica() in unpredictable. The function array_key_exists() return sometimes bool(true) - the expected value - but sometimes the value is bool(false).

An example of the implementation is added:

PHP snippet:
==========
<?php
class CouchbaseSessionHandler implements SessionHandlerInterface
{
public function read($id)
{
         try {
                 $sessionData = $this->connection->get($id);
} catch (CouchbaseLibcouchbaseException $ex) {
try {
         $replicaDocument = $this->connection->getReplica($id, COUCHBASE_REPLICA_FIRST);
                  var_dump($id);
var_dump($replicaDocument);
var_dump(is_array($replicaDocument));
var_dump(array_key_exists($id, $replicaDocument));
....
} catch (CouchbaseLibcouchbaseException $ex) {
return null;
}
}
}

}

Output (the unexpected one):
=====================
string(26) "do8uaf0omfsjframmu95cc1dm1"
array(1) { ["do8uaf0omfsjframmu95cc1dm1"]=> array(2) { ["cas"]=> string(20) "14545271133902995456" ["value"]=> string(944) "Some sessiondata";}" } }
bool(true)
bool(false)


 Comments   
Comment by Brett Lawson [ 29/May/14 ]
Hey Harry,
This doesn't appear to be an issue with php-ext-couchbase as much as the array_key_exists implementation? What version of PHP are you using, additionally I suggest you try to test the existence of the key by doing isset($replicaDocument[$id]) and see if that works!
Cheers, Brett
Comment by Harry Danes [ 29/May/14 ]
Hey Brett,

I'm using PHP 5.5.12 / CentOS 6.5 which is provided by the IUS Community (https://iuscommunity.org/pages/Repos.html). Unfortunately the isset($replicaDocument[$id]) method has the same unpredictable behavior. To make sure it is not a bug in PHP I've created a minimalistic implementation to test the issue against the current PHP build. This snippet is running fine.

<?php
$string = 'a:1:{s:26:"do8uaf0omfsjframmu95cc1dm1";a:2:{s:3:"cas";s:20:"14545271133902995456";s:5:"value";s:944:"Some sessiondata";}}';

$id = "do8uaf0omfsjframmu95cc1dm1";
$replicaDocument = unserialize($string);

var_dump($replicaDocument);
var_dump($id);
var_dump(is_array($replicaDocument));
var_dump($replicaDocument[$id]);
var_dump(array_key_exists($id, $replicaDocument));
var_dump(isset($replicaDocument[$id]));

As a next step I've removed the SessionHandlerInterface implementation to exclude this feature. The bug is reproducible with the following lines of PHP code:

<?php
$id = "do8uaf0omfsjframmu95cc1dm1";

$couchbaseNodes = array("x:8091", "y:8091");
$connection = new Couchbase($couchbaseNodes, "xxx", "xxx", "xxx", false);

$replicaDocument = $connection->getReplica($id, array("strategy" => "select", "index" => 0));
var_dump($id);
var_dump($replicaDocument);
var_dump(is_array($replicaDocument));
var_dump(array_key_exists($id, $replicaDocument));
var_dump(isset($replicaDocument[$id]));

I will try to reproduce this problem on a different OS with a different version of PHP.

Cheers,

Harry
Comment by Brett Lawson [ 29/May/14 ]
Hey Harry,

I'm going to test out your code here and see what happens, would you be able to post the result of serialize on the array which is failing?

Cheers, Brett
Comment by Harry Danes [ 30/May/14 ]
Hi Brett,

The original array was lost, but I could reproduce it with the following dataset:

Unmodified test script:
======================
<?php
$dataSet = array(
        "id" => "srhgusrhjfrshghrdgjhrdghgjdr",
        "hashes" => array("sdgrdsgreshgrsehdtd", "ewhtruw3y785rt4ieuhtuie4")
);

$id = "do8uaf0omfsjframmu95cc1dm1";

$couchbaseNodes = array("192.168.2.15:8091", "192.168.2.16:8091");
$connection = new Couchbase($couchbaseNodes, "phpsession", "php", "phpsession", false);

// $connection->set($id, $dataSet);

$replicaDocument = $connection->getReplica($id, array("strategy" => "select", "index" => 0));
var_dump($id);
var_dump($replicaDocument);
var_dump(is_array($replicaDocument));
var_dump(array_key_exists($id, $replicaDocument));
var_dump(isset($replicaDocument[$id]));
var_dump(((string)$id) === ((string)array_keys($replicaDocument)[0]));
var_dump(array_keys($replicaDocument));

Wrong output:
================
string(26) "do8uaf0omfsjframmu95cc1dm1"
array(1) {
  ["do8uaf0omfsjframmu95cc1dm1"]=>
  array(2) {
    ["cas"]=>
    string(19) "3453070182778404864"
    ["value"]=>
    array(2) {
      ["id"]=>
      string(28) "srhgusrhjfrshghrdgjhrdghgjdr"
      ["hashes"]=>
      array(2) {
        [0]=>
        string(19) "sdgrdsgreshgrsehdtd"
        [1]=>
        string(24) "ewhtruw3y785rt4ieuhtuie4"
      }
    }
  }
}
bool(true)
bool(false) ==> should be bool(true)
bool(false) ==> should be bool(true)
bool(true)
array(1) {
  [0]=>
  string(26) "do8uaf0omfsjframmu95cc1dm1"
}

Some additional tests:

Working on:
=========
PHP 5.5.3-1ubuntu2.3 (cli) (built: Apr 4 2014 01:10:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies

PHP 5.5.9-1ubuntu4 (cli) (built: Apr 9 2014 17:11:57)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Ubuntu 14.04 / PHP 5.5.13 (Custom compile)

Broken:
=======
CentOS 6.5 / PHP 5.5.13 (Custom compile)

Maybe there is a problem related to the C binaries which were installed because the problem only occurs on CentOS environments.

The installed packages:

[root@localhost php-5.5.13]# rpm -qa | grep couchbase
libcouchbase2-core-2.3.1-1.x86_64
libcouchbase2-bin-2.3.1-1.x86_64
couchbase-server-2.2.0-837.x86_64
libcouchbase-devel-2.3.1-1.x86_64

Cheers,

Harry




[PCBC-280] getReplace() $strategy parameter string, array with COUCHBASE_REPLICA_SELECT not supported Created: 29/May/14  Updated: 29/May/14  Resolved: 29/May/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.2.2
Fix Version/s: .next
Security Level: Public

Type: Bug Priority: Major
Reporter: Harry Danes Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: - Centos 6.5 X86_64
- PHP 5.5.12
- libcouchbase version => 2.3.1


 Description   
According the latest documentation: http://www.couchbase.com/autodocs/couchbase-php-client-1.2.2/classes/Couchbase.html#method_getReplica

The $strategy parameter should be an string however in the documentation is an array used for the first example: $obj = $cb->getReplica("key", array("strategy" => COUCHBASE_REPLICA_SELECT, "index" => 0));

The following error is thrown when the COUCHBASE_REPLICA_SELECT strategy is used:
Fatal error: Uncaught exception 'CouchbaseIllegalArgumentsException' with message 'Strategy must be specified as a string./ Use: "first", "all" or "select")' in

The PHP snippet:
<?php
$replicaDocument = $this->connection->getReplica($id, array("strategy" => COUCHBASE_REPLICA_SELECT, "index" => 0));

 Comments   
Comment by Brett Lawson [ 29/May/14 ]
Fixed by http://review.couchbase.org/#/c/37682/.
Comment by Harry Danes [ 29/May/14 ]
Thank you for the fast update, I've tried to implement it with the updated documentation. Right now the following error is thrown:

Fatal error: Uncaught exception 'CouchbaseIllegalArgumentsException' with message 'Invalid value specified as strategy. No replica index specified'

Did I miss something?
Comment by Brett Lawson [ 29/May/14 ]
Try passing a string rather than the constant and see if that works.
Comment by Harry Danes [ 29/May/14 ]
I found the solution in the C code, this is the correct implementation. Should I update the documentation with a Pull Request?

Correct PHP implementation:
======================
<?php
$replicaDocument = $this->connection->getReplica($id, array("strategy" => "select", "index" => 0));




[PCBC-279] Update builders to use libcouchbase 2.3.1 Created: 01/May/14  Updated: 21/Jun/14  Resolved: 21/Jun/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.2.2
Security Level: Public

Type: Task Priority: Critical
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Update builders to use libcouchbase 2.3.1




[PCBC-277] Document accepted options for all methods. Created: 27/Apr/14  Updated: 21/Jun/14  Resolved: 21/Jun/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: 2.0.0-dp2
Security Level: Public

Type: Task Priority: Critical
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Currently, most methods which accept an options object do not accurately define what options are valid for which methods.




[PCBC-276] Implement session storage provider Created: 27/Apr/14  Updated: 25/Aug/14  Resolved: 25/Aug/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Critical
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Must implement a session storage provider to allow deployments to use the PHP driver to store session information, as is done with memcached.

 Comments   
Comment by Matt Ingenthron [ 27/Apr/14 ]
+1
Comment by Harry Danes [ 29/May/14 ]
+1
Comment by Brett Lawson [ 21/Jun/14 ]
Deferred to future version due to severe technical challenges related to connection overhead and thread safety.




[PCBC-275] Create PHP Getting Started for 2.0 Created: 24/Apr/14  Updated: 25/Aug/14  Resolved: 25/Aug/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: 2.0.0-beta
Security Level: Public

Type: Task Priority: Blocker
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by PCBC-189 [Better sample needed] Code sample of... Resolved

 Description   
Create the getting started guide for version 2.0 of the PHP SDK.




[PCBC-274] Create docs branch for PHP SDK 2.0 Created: 24/Apr/14  Updated: 25/Aug/14  Resolved: 25/Aug/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: 2.0.0-beta
Security Level: Public

Type: Task Priority: Critical
Reporter: Brett Lawson Assignee: Amy Kurtzman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Brett Lawson [ 25/Aug/14 ]
Completed indirectly through DITA workflow.




[PCBC-273] Implement datatype/wire-compression Created: 18/Apr/14  Updated: 21/Jun/14  Resolved: 21/Jun/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-dp2
Security Level: Public

Type: New Feature Priority: Blocker
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Dependency
depends on CCBC-390 Implement server datatype handling. Resolved

 Description   
Implement datatype/wire-compression




[PCBC-272] Implement SSL support Created: 18/Apr/14  Updated: 21/Jun/14  Resolved: 21/Jun/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 2.0.0-dp1
Fix Version/s: 2.0.0-dp2
Security Level: Public

Type: New Feature Priority: Blocker
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Dependency
depends on CCBC-344 add support for SSL to libcouchbase i... Resolved

 Description   
Implement SSL support




[PCBC-271] random burst of failed set operations returning false , with getResultCode==0 and no CouchbaseException thrown Created: 27/Mar/14  Updated: 24/Apr/14  Resolved: 24/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Bug Priority: Major
Reporter: Alexander Piavlo Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: centos, apache2+mod_php, couchbase php ext 1.2.1


 Description   
WE have a cluster of about 100 apache+php servers accessing a couchbase cluster.
There are between 30K-100K operations to the cluster depending on time of the day,
of which 0.5K-1.5K are "set" operations and rest are "get"s.
Every several minutes some random php server starts to get bursts of failed "set" opertations, which return "false" (while the rest of the servers are just fine).
These burst may lasts from a several seconds to several minutes (also same node has high chances of getting several such burst every several minutes), during these burst only some portion of the "set"s fail.
Then inspecting the getResultCode it always returns 0 in such cases, and no CouchbaseException is thrown.
There are other cases then a few operations timeout, but in this case and exception is thrown and we can retrieve 23 result code. So the issue above is really weird.

relevant php couchbase ext 1.2.1 configs:
couchbase.config_cache = "/ephemeral/php/couchbase"
couchbase.skip_config_errors_on_connect = On

Any clues for debugging the issue?





[PCBC-270] Add couchbase cluster compatibility to documentation Created: 25/Mar/14  Updated: 25/Aug/14  Resolved: 25/Aug/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: .next
Fix Version/s: 2.0.0-beta
Security Level: Public

Type: Improvement Priority: Trivial
Reporter: Matt Ingenthron Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt: finish-start
has to be done after JCBC-438 Add table for 1.8, 2.x and 3.x compat... Open

 Description   
We should probably specify for this given major.minor of the SDK, one of three things for Couchbase Cluster releases:
- unsupported
- supported
- supports all features

These might be an 'x', '—' and "✓" in a table, or whatever Amy comes up with.

This is, in part, planning for 3.0 including beta.

This should be based on the work done in JCBC-438, so it's blocked by that issue.




[PCBC-269] Configuration cache permission issue Created: 06/Mar/14  Updated: 24/Apr/14  Resolved: 18/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: .next
Security Level: Public

Type: Task Priority: Major
Reporter: Abhishek Singh Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Dependency

 Description   
The configuration cache directory that's created is owned by root:root. We need to chown it to apache user once and chmod dir to 777 for it to work correctly else we get segmentation fault.

Is there is a way to overcome the seg fault and make the config_cache directory globally readable(so that php-cli also works)?

 Comments   
Comment by Brett Lawson [ 06/Mar/14 ]
The configuration cache should be owned by whatever user the php instances are executing under. Would you be able to confirm that this is not the case, additionally, is it the folder or the cache file itself that has incorrect permissions assigned.
Comment by Matt Ingenthron [ 06/Mar/14 ]
I'd asked Abhishek to open this mostly because of the segfault, not because the permissions need to be changed. Let's prevent the segfault, but the location should be writeable.
Comment by Brett Lawson [ 13/Mar/14 ]
As far as I am aware, the issue here is actually due to customer configuration, the folder and file are created under whatever user the php interpreter is executing under. Additionally, automatically applying any additional permissions creates a security hole due to the fact that passwords are stored within the cache.
Comment by Brett Lawson [ 17/Mar/14 ]
Hey,

I am going to run some tests today to try and figure out why they are seeing segfaults, however, I believe that the root cause of those segfaults is an overall expectation issue. I suggest that the config directory be created outside the scope of the extension to start, as this should prevent the cache folder from being owned by root, however if PHP is running as root, then the config file itself will also be root, which brings us back to a configuration issue.

Cheers, Brett
Comment by Brett Lawson [ 17/Mar/14 ]
Just a quick add as I reread your message, if I get rid of the segfault, no doubt the scripts are not going to be able to use config cache at all, since it will not be able to access that file due to permission errors, and as I mentioned above, we can't generically expand those permissions. If the user is adamant on using config cache, they may want to either use a different file for the cache, or alternatively run those scripts under the correct user.

Cheers, Brett
Comment by Abhishek Singh [ 18/Mar/14 ]
re-opening to address seg-fault
Comment by Brett Lawson [ 18/Mar/14 ]
Segfault is fixed by: http://review.couchbase.org/#/c/34644/
Comment by Abhishek Singh [ 19/Mar/14 ]
Thanks. Is this fix going to part of next release of PHP client? what's the tentative date of next release?
Comment by Brett Lawson [ 19/Mar/14 ]
Hey Abhishek,

I will be releasing an update to the PHP client with this fix on the first tuesday of April as part of our standard release cycle.

Cheers, Brett




[PCBC-268] Publish docs for PHP SDK May 2014 release Created: 27/Feb/14  Updated: 16/May/14  Due: 04/Mar/14  Resolved: 16/May/14

Status: Closed
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Critical
Reporter: Amy Kurtzman Assignee: Amy Kurtzman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h

Attachments: Zip Archive couchbase-php-client-1.2.2.zip    

 Description   
Edit and publish guide and autodocs

 Comments   
Comment by Brett Lawson [ 11/May/14 ]
Docs attached.




[PCBC-267] add discussion of timeout accuracy and implementation Created: 27/Feb/14  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Major
Reporter: Matt Ingenthron Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Since our timeouts are only as accurate as the underlying APIs/subsystems we use, we should document this for our users so they can plan accordingly. For instance, if processes aren't scheduled for a long period of time owing to CPU or memory contention... or in some cases IO doesn't happen for a long time and our timeout is IO event driven, we may not timeout to the application until later.


 Comments   
Comment by Brett Lawson [ 13/Mar/14 ]
I don't believe this should be considered an issue. I believe it is universally known that if an application is starved of cpu resources, events will not fire in a timely manner.




[PCBC-266] Expose per-node config timeout Created: 31/Jan/14  Updated: 03/Apr/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: New Feature Priority: Critical
Reporter: Mike Hancock Assignee: Mark Nunberg
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: PHP 5.3/5.5, PHP Couchbase 1.2 and Libcouchbase 2.2


 Description   
I have three active nodes in my cluster and all three nodes are supplied as an array to new Couchbase.

If one of those nodes is removed from the cluster completely the client will intermittently fail to establish a connection to the cluster despite there being two remaining nodes available and healthy. It appears that the upon failure an exception is being thrown without couchbase attempting to connect to the other nodes.

This can be reproduced by providing a made up IP in a list of cluster node IP's.

There are two errors when I attempt this locally. The main error is an exception:-

'CouchbaseLibcouchbaseException' with message 'Failed to connect libcouchbase to the server: Protocol error (Failed to bootstrap in time)'

However it is always preceded by:-

[warn] event_base_loop: reentrant invocation. Only one event_base_loop can run on each event_base at once.

 Comments   
Comment by Brett Lawson [ 31/Jan/14 ]
Hey Mike,

This appears to be an issue with our underlying library (libcouchbase). I am going to reassign the ticket over there and see what we can do. I believe this is probably already fixed in the upcoming release of libcouchbase as a lot of the io handling has been refactored, but I'll want to make sure.

Cheers, Brett
Comment by Mark Nunberg [ 31/Jan/14 ]
Just because of that above message, i'm positive the issue is not in LCB itself but inside PHP. This is either fixed in the next version or a bug in the PHP driver. It seems as if lcb_wait (or run_event_loop) is being called twice.
Comment by Mike Hancock [ 31/Jan/14 ]
Hi Brett,

Thanks, hopefully you guy's will be able to sort it soon. As you can imagine it breaks high-availability if you had to manually remove a host entry in the event of a server failure.

Cheers, Mike
Comment by Mike Hancock [ 31/Jan/14 ]
Hi Mark, I recall seeing similar issues relating to libcouchbase 2.1 but from what I read it appeared those issues had been resolved.

Have either of you been able to reproduce this yourselfs (just to confirm I'm not going bonkers)?
Comment by Mark Nunberg [ 31/Jan/14 ]
You may also wish to increase the bootstrap timeout in PHP. I'm not sure if this value is actually exposed to the PHP SDK, but the default bootstrap timeout (may otherwise be known as "config timeout") is 5 seconds. If the client cannot bootstrap within that amount of time, you'll get that error message. As a workaround, perhaps create your own time-based loop and see if this fixes the issue.

In other words, if it takes five seconds to time out, that is expected behavior. Especially in the case where a node is offline, the client may end up waiting quite a bit for a proper ARP response for the specified IP address and we may wish to increase the default configuration/bootstrap timeout.

As I mentioned above though, this message "[warn] event_base_loop: reentrant invocation. Only one event_base_loop can run on each event_base at once.
" indicates a problem in the PHP SDK layer - but would not make bootstrapping not time out, if it is indeed timing out.

See also CCBC-261
Comment by Mike Hancock [ 31/Jan/14 ]
Hi Guys,

Documentation indicates that should a connection fail it should throw a warning and attempt a connection on a different server until all options are exhausted. In a production environment if it's not connected to the DB within 1 second I'd expect it to give up.

I'd say whatever is causing that error is preventing the extension from completing or starting a second connection attempt. I can alter the timeout (if that is possible) but generally I would be decreasing it, rather than increasing it. The client needs to be pretty ruthless with connection time to the nodes, so if this is in fact a fixable bug in the extension id still like to lower that timeout limit if either of you know what the ini setting is for it?
Comment by Mike Hancock [ 03/Feb/14 ]
Brett have you had a chance to reproduce/confirm this issue yet?

I'm not too fussed whether this is a libcouchbase or PHP Ext issue yet, I'm happy to help with that if I can but if you do have a moment to confirm this is a valid issue that would be great.

Thanks again. Mike
Comment by Mark Nunberg [ 03/Feb/14 ]
This is a valid issue in libcouchbase itself, but my question (and see CCBC-261 for something similar) is more about what you'd like to see happen.

I guess in addition to the total bootstrap time, we can also provide a setting which contains the maximum amount of time each bootstrap host would have to sucessfully return a configuration. The idea is that the setting provided reflects the _total_ amount of time it takes to bootstrap the cluster.

Now in the case where a specific host is down, it will typically take a "long" time to detect that the given host is unresponsive, significantly less than the 5 seconds provided. The five second timeout is usually useful when _all_ nodes are online, but some may not have a server running - in which case we immediately get an ECONNREFUSED.

Unfortunately we cannot really distinguish between "A node that is offline" and a "Node that is taking a long time to respond" until the time is up.

The bootstrap timeout _guarantees_ that the client will either bootstrap in the specified amount of time, _or_ return with an error. I'll open a new bug to provide a per-node bootstrap timeout specifier as well.
Comment by Mark Nunberg [ 03/Feb/14 ]
Created CCBC-316
Comment by Mike Hancock [ 03/Feb/14 ]
Hi Mark, thanks for taking the time to look at this.

I think you've effectively nailed it in your comment above.

libcouchbase needs two timeout options.

One for per node connection. You can default this to whatever you like, provided Brett can add support for this into the PHP extension so that it can be configured easily down to well below 0.1s if needs be.

The second would be the total amount of time before bootstrapping fails. In this case if this timeout is reached and no nodes have responded then throw an exception (same rules would apply if all connections failed to respond within the configured node-timeout and we ran out of nodes).

From a system architecture/service perspective a database cluster that always takes a long time to respond is cause for concern, but your above options would allow those with no choice to configure leeway within their client code. However, if you've got a problem with a particular node on a latency critical system then we'd consider that node "down" or "unserviceable". Allowing the client to give up on the node as quickly as possible would be essential here. You could have a cluster of 10 CB servers responding in less than 0.05s and 1 dodgy node causing around 1 in 10 requests to be either slow or dropped completely - and while you want to be made aware of the server issue, you still want to limit how badly that node is impacting performance of your software.

I think your solution would provide a great deal flexibility to either of the above situations.

My C knowledge is definitely far too low a level to be of much help with either libcouchbase or the php extension but if I can your or Brett at all please let me know.
Comment by Mark Nunberg [ 04/Feb/14 ]
Considering we've resolved CCBC-316, should we move this back to PCBC for exposing this functionality?
Comment by Mike Hancock [ 05/Feb/14 ]
Thanks for the update Mark. It would be great if Brett can get these configurable in PCBC either at runtime or in php.ini (or both) :)

Thanks again.
Comment by Mike Hancock [ 13/Feb/14 ]
Hi Mark, no word from Brett on this yet. Any chance you could move this one back to PCBC please?

Cheers

Mike
Comment by Mark Nunberg [ 13/Feb/14 ]
Sure; Brett should be back later today
Comment by Brett Lawson [ 13/Feb/14 ]
Hey Mike,

I was unfortunately travelling this week and didn't get a chance to take a look at this. I will give you an update before Monday.

Cheers, Brett
Comment by Mike Hancock [ 13/Feb/14 ]
Cheers Brett, much appreciated :)
Comment by Mike Hancock [ 04/Mar/14 ]
Hi Brett, Any news?
Comment by Brett Lawson [ 11/Mar/14 ]
Hey Mike,

Sorry for the delay, this will be available in PHP SDK 2.0.0-dp1 which should be release soon (within the next week or two). I am just finalizing some things with it at the moment.

Cheers, Brett
Comment by Mike Hancock [ 03/Apr/14 ]
Hi Brett,

Any idea what the holdup on PHP SDK 2.0.0-dp1 is. It still has a release date penned for March but no sign of it yet.

Cheers

Mike




[PCBC-264] increment/decrement method description does not mention the integer overflow if negative numbers are incremented/decremented. Created: 17/Jan/14  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Task Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
If negative numbers are incremented/decremented integer overflow occurs.

$cb->set("5", -5);
   
$cb->increment("5", 1);

Should be added to method description.

 Comments   
Comment by Brett Lawson [ 13/Mar/14 ]
As of the 2.0.0-dp1, incrementing or decrementing numbers whether positive or negative work as expected.




[PCBC-263] The value to be incremented/decremented with increment/decrement doesn't have to be a textual string. Created: 17/Jan/14  Updated: 20/Feb/14  Resolved: 20/Feb/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
"If the value isn't created by using increment / decrement, it has to be created as a "textual" string"
 http://www.couchbase.com/autodocs/couchbase-php-client-1.2.0/classes/Couchbase.html#method_increment

The value may a numeric value and doesn't have to be a textual string.

$cb->add("1", 1);
$cb->increment("1", 1);

 Comments   
Comment by Brett Lawson [ 20/Feb/14 ]
This is due to the fact that integer values are stored textually with a flag to identify them as integers during decoding.




[PCBC-262] getDelayed always returns 1 Created: 17/Jan/14  Updated: 17/Jan/14  Resolved: 17/Jan/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: PHP Client Windows version


 Description   
For the Windows version http://windows.php.net/downloads/pecl/releases/couchbase/1.1.5/. the getDelayed method always returns 1 regardless of whether the document to get is dfined in the Couchbase server or not.

 Comments   
Comment by deepak vohra [ 17/Jan/14 ]
For the Windows version http://windows.php.net/downloads/pecl/releases/couchbase/1.1.5/. the getDelayed method always returns 1 regardless of whether the document id to get delayed is defined in the Couchbase server or not.
Comment by Brett Lawson [ 17/Jan/14 ]
The getDelayed method executes a the get request at a later time, the 1 only signifies that it successfully queued the command to be executed. You must check the response which is returned later through fetch to see whether the document could be retrieved.
Comment by deepak vohra [ 17/Jan/14 ]
Thanks for clarifying that the getDelayed doesn't verify that the document got delayed is defined or not.




[PCBC-261] setMulti method return type is array, not boolean as in the method description Created: 17/Jan/14  Updated: 18/Apr/14  Resolved: 20/Feb/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.1
Security Level: Public

Type: Bug Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
setMulti method return type is array, not boolean as in the method description. The setMulti returns an array of CAS values for the objects stored.

http://www.couchbase.com/autodocs/couchbase-php-client-1.2.0/classes/Couchbase.html#method_setMulti




[PCBC-260]  Version 1.1.5 Windows version issues Created: 10/Jan/14  Updated: 24/Apr/14  Resolved: 24/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.1
Security Level: Public

Type: Task Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The Version 1.1.5 Windows version issues has a lot of issues some of which are posted separately.
http://windows.php.net/downloads/pecl/releases/couchbase/1.1.5/

Another being "Call to undefined function getMulti() ".







[PCBC-259] fetchAll does not fetch all delayed results Created: 10/Jan/14  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
If multiple results are fetchDelayed, fetchAll does not fetch all delayed results, but the server stops running.

 Comments   
Comment by deepak vohra [ 10/Jan/14 ]
Correction, getDelayed not fetchDelayed.
Comment by Brett Lawson [ 10/Jan/14 ]
Please ensure you are looking at the latest documentation, additionally, could you provide further details on this issue, I'm not quite sure what you mean by 'the server stops running'? It would also be useful if you could post the code you are using which is causing the issue.
Comment by deepak vohra [ 10/Jan/14 ]
The issue is got with 1.1.5 Windows version
http://windows.php.net/downloads/pecl/releases/couchbase/1.1.5/
Comment by deepak vohra [ 11/Jan/14 ]
the server stops running and application gets terminated.
Comment by Brett Lawson [ 13/Mar/14 ]
getDelayed is deprecated as of 2.0.0-dp1, it is highly suggested to avoid using these functions in previous SDKs. It is suggested that you use multi operations rather than delayed operations to perform multiple operations simultaneously if performance requirements deem this neccessary.




[PCBC-258] fetch() and fetchAll() not expecting args. Created: 10/Jan/14  Updated: 10/Jan/14  Resolved: 10/Jan/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The methods
$object->fetch($key [, $keyn ]) Fetch the next delayed result set document
$object->fetchAll($key [, $keyn ]) Fetch all the delayed result set documents

 

are defined with a parameter, but if an arg is provided the following exception is generated:

Couchbase::fetch() expects exactly 0 parameters, 1 given
Couchbase::fetchAll() expects exactly 0 parameters, 1 given



 Comments   
Comment by Brett Lawson [ 10/Jan/14 ]
Fetch and FetchAll return results from previously execute getDelayed calls (and have no reason to accept parameters). Please see the docs for further information on the expected parameters for fetch.
https://github.com/couchbase/php-ext-couchbase/blob/master/example/couchbase-api.php#L619-L639
Comment by deepak vohra [ 10/Jan/14 ]
Why do the method descriptions indicate params?

http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-retrieve-asyncget.html#table-couchbase-sdk_php_fetch
Comment by Brett Lawson [ 10/Jan/14 ]
Please ensure you are looking at the latest documentation, the link posted above is for 1.1, however, we are currently at 1.2. I suggest you take a look at the latest documentation which is here:
https://github.com/couchbase/php-ext-couchbase/blob/master/example/couchbase-api.php#L619-L639
Comment by deepak vohra [ 10/Jan/14 ]
Thanks. The Tutorial link should be updated to 1.2. Click on Tutorial link, the 1.1 documentation is displayed.
http://www.couchbase.com/communities/php
Comment by deepak vohra [ 10/Jan/14 ]
The API Reference link on page http://www.couchbase.com/communities/php is also for 1.1, should be updated.
https://github.com/couchbase/php-ext-couchbase/blob/1.1.5/example/couchbase-api.php
Comment by deepak vohra [ 10/Jan/14 ]
The issue is got with 1.1.5 Windows version
http://windows.php.net/downloads/pecl/releases/couchbase/1.1.5/




[PCBC-257] PHP Client Library- Array of server versions returned by getVersion() has undefined offset Created: 10/Jan/14  Updated: 11/Jan/14  Resolved: 10/Jan/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: deepak vohra Assignee: Brett Lawson
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
$version=$cb->getVersion();
$arrlength=count($version);

for($x=0;$x<$arrlength;$x++)
  {
  echo $version[$x];
  echo "<br>";
  }

Exception is "Undefined offset: 0 "
But array length is 1.

 Comments   
Comment by Brett Lawson [ 10/Jan/14 ]
getVersion returns the versions of the various servers that the client is connected to. It is returning a associative array of server-names to versions, not an indexed array.

Cheers, Brett
Comment by deepak vohra [ 11/Jan/14 ]
What is the server name to use?
All of the following generate "Undefined index:" error.
'localhost'
'127.0.0.1'
IPv4




[PCBC-256] management operations fail Created: 05/Dec/13  Updated: 01/May/14  Resolved: 05/Dec/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.2.0
Fix Version/s: 1.2.2
Security Level: Public

Type: Bug Priority: Major
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates to

 Description   
Attempting to perform operations on management objects (such as CouchbaseClusterManager) fail due to 'Invalid Arguments'.

 Comments   
Comment by Brett Lawson [ 05/Dec/13 ]
should be fixed by: http://review.couchbase.org/30870/




[PCBC-255] Add PHP to Api Reference list Created: 01/Oct/13  Updated: 07/Oct/13  Resolved: 03/Oct/13

Status: Closed
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Blocker
Reporter: Brett Lawson Assignee: Amy Kurtzman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Please add the PHP Autodocs to the SDK API Reference drop-down menu on the docs site.

 Comments   
Comment by Amy Kurtzman [ 07/Oct/13 ]
Added to SDK API References drop-down menu.




[PCBC-254] Add replica-read to docs Created: 30/Sep/13  Updated: 20/Feb/14  Due: 01/Oct/13  Resolved: 20/Feb/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Write a small blurb about replica read in the version 1.2 documentation once it has been created and is ready.




[PCBC-253] Create docs pages for release 1.2 Created: 30/Sep/13  Updated: 07/Oct/13  Due: 01/Oct/13  Resolved: 03/Oct/13

Status: Closed
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Blocker
Reporter: Brett Lawson Assignee: Amy Kurtzman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Please create a version 1.2 on the docs site for the PHP client as we will be releasing that client version tomorrow and will need to make some docs changes.

 Comments   
Comment by Amy Kurtzman [ 02/Oct/13 ]
The pages have been created, and put in a branch called php in the https://github.com/couchbaselabs/docs-ng repository.
Comment by Brett Lawson [ 02/Oct/13 ]
Hey Amy,

The doc updates have been pushed to the PHP branch and are ready for integration. Additionally, there are Node.js docs changes which are available on the stage branch as well that should be integrated into master.

Cheers, Brett
Comment by Amy Kurtzman [ 02/Oct/13 ]
Both PHP and node.js have been merged into master. I deleted the PHP branch.
Comment by Brett Lawson [ 03/Oct/13 ]
Added and updated.




[PCBC-252] change doc zipfile to create a directory of couchbase-php-client-x.y.z and be in a zipfile of similar name Created: 27/Sep/13  Updated: 24/Apr/14  Resolved: 24/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.2.0
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Matt Ingenthron Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Please change doc output to be in format specified. Also, is what's needed (other than toolchain) to create docs in the repo?

 Comments   
Comment by Brett Lawson [ 24/Apr/14 ]
This will be superseded by a script to automatically deploy new versions of the docs.




[PCBC-251] decrement() fails when using a prefix key (Couchbase::OPT_PREFIX_KEY) Created: 27/Sep/13  Updated: 30/Sep/13  Resolved: 30/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.5
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Gabriel Glachant Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: * PHP Client library version 1.1.5 (with C library libcouchbase2-libevent-2.1.3-2402) running on Ubuntu 12.04.2 LTS (AWS EC2 instance)
* Couchbase cluster server version 2.0.1 community edition (build-170) (separate AWS EC2 instances)

Attachments: File decrement-with-prefix-key-testcase.php    

 Description   
Decrementing a key (with decrement()) from 1 to 0 while using OPT_PREFIX_KEY option fails.
The same without using OPT_PREFIX_KEY is successful.
Test case included.

 Comments   
Comment by Trond Norbye [ 30/Sep/13 ]
http://review.couchbase.org/#/c/29246/1




[PCBC-250] Add intro to PHP SDK guide Created: 24/Sep/13  Updated: 01/Oct/13  Resolved: 01/Oct/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.0, 1.1.0
Fix Version/s: 1.0, 1.1.0
Security Level: Public

Type: Task Priority: Minor
Reporter: Amy Kurtzman Assignee: Gwen Leong (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The SDK guides currently begin with the Getting Started section. They need an introduction and meaningful web page title so customers know what guide they are reading.

For each version of the SDK guide, please:

1. Add a short introduction (# Introduction) before the Getting Started section. Sample intro:
    This guide provides information for developers who want to use the Couchbase <language> SDK to
    build applications that use Couchbase Server.

2. In the corresponding index.erb file, change the title to one that follows this naming pattern:
    Couchbase <language> SDK <version> Guide

 Comments   
Comment by Gwen Leong (Inactive) [ 01/Oct/13 ]
Added to all versions.
http://docs.couchbase.com/couchbase-sdk-php-1.1/




[PCBC-249] Add testing for Configuration Cache Created: 24/Sep/13  Updated: 24/Apr/14  Resolved: 24/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Task Priority: Minor
Reporter: Brett Lawson Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Add testing for Configuration Cache




[PCBC-248] Autodocs available for v1.1.5 of PHP extension Created: 24/Sep/13  Updated: 07/Oct/13  Resolved: 27/Sep/13

Status: Closed
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.5
Fix Version/s: 1.1.5
Security Level: Public

Type: Task Priority: Major
Reporter: Brett Lawson Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive autodocs-php-1.1.5.zip    
Issue Links:
Relates to
relates to PCBC-243 Generate autodocs for PHP Closed

 Description   
The autodocs for version 1.1.5 of the PHP extension have been generated and are attached. They should be uploaded to the autodocs site.

 Comments   
Comment by Matt Ingenthron [ 27/Sep/13 ]
http://www.couchbase.com/autodocs/couchbase-php-client-1.1.5/
Comment by Amy Kurtzman [ 07/Oct/13 ]
PHP API documentation has been uploaded.




[PCBC-247] libcouchbase2-* v2.1.3 packages throw uncaught exceptions when building a Couchbase construct in PHP Created: 13/Sep/13  Updated: 02/Oct/13  Resolved: 25/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Saran Kumar Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
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.

 Comments   
Comment by Mark Nunberg [ 13/Sep/13 ]
Administrator is no longer supported as a valid username for the cluster. The fact that it worked previously was an error on the SDK part. If you remove the username or provide the bucket name as the username, this issue should go away.
Comment by Trond Norbye [ 13/Sep/13 ]
As Mark pointed out it is no longer possible to authenticate as root (pretty much due to the same reason for why you shouldn't log in as root/Administrator on your UNIX/Windows server). There has also been some packaging problems in some of the libcouchbase versions that we've fixed.

I'm closing the bug report due to the above, but please reopen the bug if the problem exists if you upgrade libcouchbase to the latest version and authenticate with another user than Administrator.
Comment by Perry Krug [ 16/Sep/13 ]
Reopening on behalf of Saran
Comment by Saran Kumar [ 16/Sep/13 ]
The problem exists using the latest version of libcouchbase, authenticating with another user than Administrator.

"I anonymized the credentials in the bug report. Our cluster username is root, but for obvious reasons I didn't include any of the actual credentials in the write-up. If you follow the repro steps in the report as submitted (with any given username), you'll get a Fatal Error trying to create the Couchbase construct in PHP."
Comment by Trond Norbye [ 17/Sep/13 ]
Could you try to run: cbc stats -h myhost:8091 -b mymucket -u -mybucket -P mypassword
to see if libcouchbase works by itself..
(I'm trying to set up a squeeze in virtualbox to reproduce your problem)

Comment by Sergey Avseyev [ 17/Sep/13 ]
I've setup a bucket "mybucket" with password "secret", also I have configured my cluster to use "Administrator" name for admin account with password "password".

$ cbc version
cbc built from: libcouchbase 2.1.3 (rev. 55e4a2d9cb810eac5d58bfbf5c1b1d7397bfce76)
    using libcouchbase: 2.1.3 (libevent)

$ cat test1.php
<?php
$cb = new Couchbase("localhost:8091", "Administrator", "password", "mybucket");

$ php test1.php
PHP Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with message 'Failed to create libcouchbase instance' in /home/avsej/code/couchbase-sdk/lcb/test1.php:2
Stack trace:
#0 /home/avsej/code/couchbase-sdk/lcb/test1.php(2): Couchbase->__construct('localhost:8091', 'Administrator', 'password', 'mybucket')
#1 {main}
  thrown in /home/avsej/code/couchbase-sdk/lcb/test1.php on line 2

$ cat test2.php
<?php
$cb = new Couchbase("localhost:8091", "mybucket", "secret", "mybucket");

$ php test2.php

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux unstable (sid)
Release: unstable
Codename: sid
l
Comment by Mark Nunberg [ 17/Sep/13 ]
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"
Comment by Trond Norbye [ 17/Sep/13 ]
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)..
Comment by Sergey Avseyev [ 18/Sep/13 ]
The wording was correct actually I meant not "Administrator" string, but account with administrator powers
Comment by Matt Ingenthron [ 25/Sep/13 ]
Brett: can you see about adding tests to ensure this fails in a reasonable way given the changes in libcouchbase?
Comment by Matt Ingenthron [ 02/Oct/13 ]
Brett: is this planned to be addressed in 1.2?




[PCBC-246] Expose lcb_cntl(..., LCB_CNTL_SKIP_CONFIGURATION_ERRORS_ON_CONNECT, ..) Created: 21/Aug/13  Updated: 26/Aug/13  Resolved: 26/Aug/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.0
Security Level: Public

Type: Task Priority: Major
Reporter: Sergey Avseyev Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Dependency
depends on CCBC-192 Failure to handle host that has been ... Resolved

 Description   
There is a special mode which helps users to manage stale bootstrap node list.

Use case:

1) setup and deploy application to bootstrap with node1,node2,node3
2) over the time, admins eject node1 and it might still be listening on 8091
3) the application should skip LCB_AUTH_ERROR errors and LCB_BUCKET_ENOENT on node1 and continue with node2

Obviously after successful bootstrap, the list of "known" nodes will be updated for the particular connection. The problem in on-disk configuration

 Comments   
Comment by Trond Norbye [ 23/Aug/13 ]
Should this be the default behavior or not?
Comment by Sergey Avseyev [ 23/Aug/13 ]
I think no. Because we shouldn't add more magic. Right now, the user will get an error and has enough information to figure out why it happened, and to search for possible workarounds. But skipping such nodes by default, might make things more weird, for example if "dead" will became part of new cluster with matching bucket name and password. I know it is possible in current situation, but the user more likely will get errors during transition phase.
Comment by Trond Norbye [ 26/Aug/13 ]
http://review.couchbase.org/28566




[PCBC-244] php-ext-couchbase-1.1.5 sporatically coredumping on getMulti Created: 08/Aug/13  Updated: 30/Sep/13  Resolved: 27/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.5
Fix Version/s: .future
Security Level: Public

Type: Bug Priority: Critical
Reporter: Matt Ingenthron Assignee: Brett Lawson
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
From bug reporter:
I'm noticing the following symptoms pop up on our apache webs where a child process will SegFault (11) and drop these cores. Most of them look almost identical in gdb, the r->the_request doesn't really point to any single piece of code. On one box, I've had 3 core dumps over ~20k requests in the last half hour. I don't see the same behavior on another box that handled ~7k requests over the last half hour (possibly hitting limitations?), our legacy boxes are handling ~42k requests over the same time frame. All of our boxes are RHEL6.


#0 0x00007f779e682cfc in php_couchbase_get_callback (instance=<value optimized out>, cookie=0x7f77b387c968, error=LCB_KEY_ENOENT, resp=0x7fff608742b0)
    at php-ext-couchbase-1.1.5/get.c:20
#1 0x00007f779e4619bf in ?? () from /usr/lib64/libcouchbase.so.2
#2 0x00007f779e458fce in ?? () from /usr/lib64/libcouchbase.so.2
#3 0x00007f778694eb44 in event_base_loop () from /usr/lib64/libevent-1.4.so.2
#4 0x00007f779e464998 in lcb_wait () from /usr/lib64/libcouchbase.so.2
#5 0x00007f779e684c14 in php_couchbase_get_impl (ht=<value optimized out>, return_value=<value optimized out>, return_value_ptr=0x0, this_ptr=<value optimized out>,
    return_value_used=1, multi=1, oo=1, lock=0, touch=0, replica=0) at php-ext-couchbase-1.1.5/get.c:351
#6 0x00007f779e67d3ee in zim_couchbase_getMulti (ht=<value optimized out>, return_value=<value optimized out>, return_value_ptr=<value optimized out>, this_ptr=<value optimized out>,
    return_value_used=<value optimized out>) at php-ext-couchbase-1.1.5/apidecl.c:653
#7 0x00007f77a35fa0c8 in zend_do_fcall_common_helper_SPEC (execute_data=<value optimized out>) at /usr/src/debug/php-5.3.3/Zend/zend_vm_execute.h:316
#8 0x00007f77a35d1400 in execute (op_array=0x7f77b32dd508) at /usr/src/debug/php-5.3.3/Zend/zend_vm_execute.h:107
#9 0x00007f77a35abb3d in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/debug/php-5.3.3/Zend/zend.c:1194
#10 0x00007f77a3559da8 in php_execute_script (primary_file=0x7fff60876d10) at /usr/src/debug/php-5.3.3/main/main.c:2261
#11 0x00007f77a3634a85 in php_handler (r=0x7f77b344ac28) at /usr/src/debug/php-5.3.3/sapi/apache2handler/sapi_apache2.c:669
#12 0x00007f77adea9b00 in ap_run_handler ()
#13 0x00007f77adead3be in ap_invoke_handler ()
#14 0x00007f77adeb8a30 in ap_process_request ()
#15 0x00007f77adeb58f8 in ?? ()
#16 0x00007f77adeb1608 in ap_run_process_connection ()
#17 0x00007f77adebd807 in ?? ()
#18 0x00007f77adebdb1a in ?? ()
#19 0x00007f77adebe79c in ap_mpm_run ()
#20 0x00007f77ade95900 in main ()

 Comments   
Comment by Trond Norbye [ 26/Aug/13 ]
Could you provide the steps needed to configure such an environment? (apache config, php config etc)
Comment by Brett Lawson [ 27/Sep/13 ]
Cannot reproduce issue locally and request for further information was not responded. Will reopen if more information regarding environment can be made available.
Comment by Trond Norbye [ 30/Sep/13 ]
It _COULD_ possibly be some of the problems we've seen in some of the libcouchbase versions...
Comment by Mark Nunberg [ 30/Sep/13 ]
This has been happening on some versions of libcouchbase. I think this has been mostly fixed, or at least I haven't been able to reproduce this.

IMO the library needs something like Python where the sync function asserts that the remaining count is 0 before exiting. What's probably happening is that not all the results are returned and a stale cookie is hanging around in libcouchbase, which hasn't delivered back all the callbacks.




[PCBC-243] Generate autodocs for PHP Created: 06/Aug/13  Updated: 07/Oct/13  Resolved: 24/Sep/13

Status: Closed
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Minor
Reporter: Amy Kurtzman Assignee: Amy Kurtzman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 4h
Time Spent: Not Specified
Original Estimate: 4h

Issue Links:
Relates to
relates to PCBC-248 Autodocs available for v1.1.5 of PHP ... Closed

 Description   
Research tools for generating API documentation for PHP client that can be put up on http://www.couchbase.com/autodocs/.

 Comments   
Comment by Dipti Borkar [ 07/Aug/13 ]

File for the current release:
https://raw.github.com/couchbase/php-ext-couchbase/1.1.5/example/couchbase-api.php
Comment by Brett Lawson [ 24/Sep/13 ]
See PCBC-248
Comment by Amy Kurtzman [ 07/Oct/13 ]
PHP API reference has been uploaded.




[PCBC-242] Connection error when nodes go down Created: 31/Jul/13  Updated: 24/Sep/13  Resolved: 24/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Critical
Reporter: Graeme Lambert Assignee: Matt Ingenthron
Resolution: Won't Fix Votes: 0
Labels: libcouchbase, php
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: PHP 5.4.9-4ubuntu2.2
Couchbase 2.1
Couchbase PHP Extension 1.1.5
libcouchbase2 2.0.7-2282


 Description   
On our test environment I've got three nodes on the local network in one cluster with one web server. I've created a virtual machine remotely to set up XDCR which worked perfectly.

I then tried to imitate a datacentre going offline by unplugging the network cable from each of the three nodes in the local cluster.

I'd already changed my PHP to be something along the lines of:

define('COUCHBASE_SERVERS', couchbase1.office:8091;couchbase2.office:8091;couchbase3.office:8091;'remote.vnode.com:8091');
define('COUCHBASE_USER', 'username');
define('COUCHBASE_PASS', 'pass');
define('COUCHBASE_DATA_BUCKET', 'data');
define('COUCHBASE_WEB_BUCKET', 'web');
define('COUCHBASE_SESSION_BUCKET', 'session');

I have three classes, one to connect to the data bucket and perform view queries amongst others, one to connect to the session bucket and store sessions in JSON format and another to cache the generated HTML in the web bucket.

Each class initiates the connection via:

$couchbase = new Couchbase(COUCHBASE_SERVERS, COUCHBASE_USER, COUCHBASE_PASS, COUCHBASE_WEB_BUCKET);

Obviously with the respective bucket.

When I unplugged the three network cables and refreshed, I get this error:

Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with message 'Failed to get a value from server: Operation timed out'


The PHP extension documentation states "The connection obtains the cluster configuration from the first host to which it has connected." which to me implies that there is some sort of loop that goes through each node to find an active node. It doesn't even seem like it's using the first node in the array as I moved the only active one to the top of the list and it still failed.

 Comments   
Comment by Graeme Lambert [ 31/Jul/13 ]
On a side note, using Nginx and the "ngx_http_enhanced_memcached_module" to retrieve the cached html from the bucket works fine with the nodes down, it still hits the remote virtual machine, it's only when it gets through to the PHP it fails.
Comment by Matt Ingenthron [ 31/Jul/13 ]
I think there must be a missing portion of the description here. If you've unplugged the servers and leave them unplugged, timeouts are to be expected. Can you update the description to indicate the specific steps?
Comment by Graeme Lambert [ 31/Jul/13 ]
Hi Matt,

Not sure if I can edit the original description?

Nothing really is missing, there is an array of 4 nodes being passed to the PHP extension and I've unplugged the network cable for the 3 in my office and left the remote on connected.

I left the nodes disconnected from the network for a good half an hour and still had the fatal error returning so I don't think it's a brief timeout issue.
Comment by Matt Ingenthron [ 31/Jul/13 ]
I'm still missing it, as your latest comment indicates four nodes, but the initial description talks about three nodes. Perhaps you can put it in these terms...

Scenario:
Four node cluster. Autofailover enabled with the 30s default failure detection time. Three buckets, two couchbase type, one memcached type. Each Couchbase bucket is configured with one replica. One application server on a separate machine running blah-de-blah workload. Unplug three of four nodes and...

Expected behavior:
After 30s, autofailover kicks in and all is well.

Observed behavior:
Regular timeouts received at the application level from the client library while the three nodes are unplugged.

- - -

Note that what I describe above isn't actually the way it works, as autofailover works only for one node, so multiple node failures would have the cluster take no action and thus you'd have timeouts. You can get back into a working state by administratively failing over the three nodes, but at the cost of lost data.
Comment by Graeme Lambert [ 01/Aug/13 ]
Hi Matt,

There are three nodes in the cluster and one node in a remote cloud in it's own cluster and I've set up XDCR for the three node cluster to replicate onto the remote cloud cluster with the single node in it. I've got the XDCR working perfectly.

I believe that you are supposed to be able to hit both datacentres concurrently with read/write requests and both will stay replicated.

Therefore I want to make sure that when a datacentre goes down, the site will operate fine connecting to the remote cloud cluster and when the 3 node cluster comes back up it will start to receive the writes that the remote cluster has had during that time.

Please bare in mind this is by no means a production use case, but I'm trying to get as close to it with servers in the office and remote cloud nodes for XDCR. I wouldn't have just a single node in that cluster but for testing it out it's all I need.
Comment by Marty Schoch [ 02/Aug/13 ]
Saw this in IRC and decided to take a look. I believe the problem is that the Couchbase client is being initialized with the address of server nodes that actually belong to 2 different clusters. My understanding is that this is not supported. You would need to configure 2 separate Couchbase clients, each configured to talk to one of the clusters. Managing which interactions go to which cluster is then up to your application.




[PCBC-241] compilation warnings on extension Created: 24/Jul/13  Updated: 26/Aug/13  Resolved: 26/Aug/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.0
Security Level: Public

Type: Task Priority: Minor
Reporter: Matt Ingenthron Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: git describe:
1.1.5-8-gf7b3b70

cc --version:
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix


 Description   
With my nice new compiler, we now get some compilation warnings on php-ext-couchbase. None look critical, but should be reviewed.

 cc -I. -I/Users/ingenthr/src/php-ext-couchbase -DPHP_ATOM_INC -I/Users/ingenthr/src/php-ext-couchbase/include -I/Users/ingenthr/src/php-ext-couchbase/main -I/Users/ingenthr/src/php-ext-couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Users/ingenthr/src/php-ext-couchbase/replica.c -fno-common -DPIC -o .libs/replica.o
/Users/ingenthr/src/php-ext-couchbase/replica.c:41:9: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
                        free(ret->data.v.v0.key);
                             ^~~~~~~~~~~~~~~~~~
/usr/include/stdlib.h:160:18: note: passing argument to parameter here
void free(void *);
                    ^
/Users/ingenthr/src/php-ext-couchbase/replica.c:42:9: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
                        free(ret->data.v.v0.bytes);
                             ^~~~~~~~~~~~~~~~~~~~
/usr/include/stdlib.h:160:18: note: passing argument to parameter here
void free(void *);
                    ^
/Users/ingenthr/src/php-ext-couchbase/replica.c:46:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
                memcpy(ret->data.v.v0.key, r->v.v0.key, ret->data.v.v0.nkey);
                       ^~~~~~~~~~~~~~~~~~
/usr/include/secure/_string.h:55:30: note: expanded from macro 'memcpy'
   ? __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest)) \
                             ^
/Users/ingenthr/src/php-ext-couchbase/replica.c:46:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
                memcpy(ret->data.v.v0.key, r->v.v0.key, ret->data.v.v0.nkey);
                       ^~~~~~~~~~~~~~~~~~
/usr/include/secure/_string.h:56:27: note: expanded from macro 'memcpy'
   : __inline_memcpy_chk (dest, src, len))
                          ^
/usr/include/secure/_string.h:59:28: note: passing argument to parameter '__dest' here
__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
                           ^
/Users/ingenthr/src/php-ext-couchbase/replica.c:47:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
                memcpy(ret->data.v.v0.bytes, r->v.v0.bytes, ret->data.v.v0.nbytes);
                       ^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_string.h:55:30: note: expanded from macro 'memcpy'
   ? __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest)) \
                             ^
/Users/ingenthr/src/php-ext-couchbase/replica.c:47:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
                memcpy(ret->data.v.v0.bytes, r->v.v0.bytes, ret->data.v.v0.nbytes);
                       ^~~~~~~~~~~~~~~~~~~~
/usr/include/secure/_string.h:56:27: note: expanded from macro 'memcpy'
   : __inline_memcpy_chk (dest, src, len))
                          ^
/usr/include/secure/_string.h:59:28: note: passing argument to parameter '__dest' here
__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
                           ^
/Users/ingenthr/src/php-ext-couchbase/replica.c:142:32: warning: passing 'const char *' to parameter of type 'char *'
      discards qualifiers [-Wincompatible-pointer-types]
                add_assoc_string(r, "error", lcb_strerror(NULL, e->error), 1);
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/php/Zend/zend_API.h:371:111: note: expanded from macro 'add_assoc_string'
  ...__key, __str, __duplicate) add_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
                                                                                   ^
/usr/include/php/Zend/zend_API.h:362:82: note: passing argument to parameter 'str' here
ZEND_API int add_assoc_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate);
                                                                                 ^
/Users/ingenthr/src/php-ext-couchbase/replica.c:358:56: warning: passing 'lcb_get_replica_cmd_t **'
      (aka 'struct lcb_get_replica_cmd_st **') to parameter of type 'const lcb_get_replica_cmd_t *const *' (aka 'const
      struct lcb_get_replica_cmd_st *const *') discards qualifiers in nested pointer types [-Wincompatible-pointer-types]
        retval = lcb_get_replica(instance, &cookie, num_docs, commands);
                                                              ^~~~~~~~
/usr/local/include/libcouchbase/couchbase.h:314:69: note: passing argument to parameter 'commands' here
                                const lcb_get_replica_cmd_t *const *commands);
                                                                    ^


 Comments   
Comment by Trond Norbye [ 23/Aug/13 ]
http://review.couchbase.org/28531




[PCBC-240] touch method non-functional in pecl package Created: 15/Jul/13  Updated: 26/Aug/13  Resolved: 26/Aug/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Martijn Otto Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: ALL


 Description   
The touch method does not work properly in the pecl package. It works correctly in the latest package before pecl, though.

 Comments   
Comment by Trond Norbye [ 26/Aug/13 ]
Could you elaborate about what you mean by not work properly?
Comment by Trond Norbye [ 26/Aug/13 ]
I tried to use the version in pecl on my Ubuntu box, and it works as expected. The "only" problem I found is that the return type in the API reference is wrong. It returns the CAS value on success and not a boolean expression. http://review.couchbase.org/#/c/28568/1

If you had other problems with the operation please reopen the bug with more information




[PCBC-239] Problem building the thread safe version on windows Created: 14/Jul/13  Updated: 23/Aug/13  Resolved: 23/Aug/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Blocker
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
After the updates of two days ago at github, php_couchbase.dll does not
compile anymore for the thread safe versions of PHP on Windows.

Creating library Release_TS\php_couchbase.lib and object
Release_TS\php_couchbase.exp

apidecl.obj : error LNK2019: unresolved external symbol
_php_couchbase_get_replica_impl referenced in function
_zim_couchbase_getReplica

Release_TS\php_couchbase.dll : fatal error LNK1120: 1 unresolved
externals

The NTS extension still compiles fine. My libcouchbase.dll is
up-to-date.



 Comments   
Comment by Trond Norbye [ 23/Aug/13 ]
http://review.couchbase.org/#/c/28465/




[PCBC-238] Docs: need examples of API calls, expected usage, expected return values Created: 06/Jun/13  Updated: 27/Sep/13  Resolved: 27/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
All of the pages under:
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-connection.html
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-store.html
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-retrieve.html
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-update.html
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-stats.html
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/php-api-reference-view.html

Are pretty empty with regards to how to use these operations within PHP code, what to expect as the return codes/values, how to handle errors, etc.

 Comments   
Comment by Trond Norbye [ 26/Aug/13 ]
See:
https://github.com/couchbase/php-ext-couchbase/blob/master/example/couchbase-api.php

Or provide information on how the pages may be updated...
Comment by kzeller [ 11/Sep/13 ]
See "how to contribute content" for our new docs system:


https://github.com/couchbaselabs/docs-ng


As a team member of Couchbase labs you can directly push to stage and let us know if you need help copyediting.
Comment by Brett Lawson [ 26/Sep/13 ]
Between the documentations Tutorial, smaller sections, the API Reference (which will be made available shortly) as well as the php sample applications, I think this is more than enough for a user to get a grasp on how to use the various library operations. In regards to error handling, there is a section in the documentation that refers to this and all error codes are documented in the API reference. I don't believe that we should provide specific errors that any particular method returns as this would be frustrating to maintain over time and it is for the best if the user correctly handles all of the errors, even if there is a catch all for most of them.




[PCBC-237] Docs needed for config_cache configuration Created: 06/Jun/13  Updated: 27/Sep/13  Resolved: 27/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
We've been trying to push customers/users towards using the config_cache but at the moment there is fairly limited documentation and instructions on how and why to use it.

 Comments   
Comment by Trond Norbye [ 06/Jun/13 ]
You can find some info at https://github.com/couchbase/php-ext-couchbase/blob/master/example/couchbase.ini#L96

Ideally we should speed up the config retrieval in ns_server to get it on par with the normal get ops and drop the cache ;)
Comment by Perry Krug [ 06/Jun/13 ]
Unfortunately not all of our users are sophisticated enough to read the code from github and immediately know how to use everything...otherwise we wouldn't need any documentation in the first place right? :)

This needs to get added into the normal docs with detailed descriptions and examples
Comment by Matt Ingenthron [ 06/Jun/13 ]
I agree with the issue, but just want to caution you that we released the config cache option documented as experimental with known limitations. It's in production in a couple of places, but doesn't work for memcached buckets and we don't really have sufficient test coverage in the area where we have a lot of resubscribing.

Still, this is better than the alternative behavior (making ns_server keel over from lots of HTTP connections).

We'll document it, but it'll have to hold that experimental/known limitations for a bit.
Comment by Brett Lawson [ 24/Sep/13 ]
The file that Trond linked to is actually the example ini that contains the documentation of all the possible ini configuration values. I suspect any user intended to set up the extension would look there first for details on the possible options?
Comment by Trond Norbye [ 24/Sep/13 ]
unfortunately the people who wrote pecl wouldn't include the support for installing such configuration example files... seems like a really bad design miss..
Comment by Brett Lawson [ 27/Sep/13 ]
Added section to documentation.
https://github.com/couchbaselabs/docs-ng/commit/e5942bbcc1c3414b4698799319beed18b41448de




[PCBC-236] Throw exceptions from constructor Created: 06/Jun/13  Updated: 25/Aug/13  Resolved: 09/Jun/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Documentation shows that exceptions should be thrown from the ctor if the connection isn't successfully established, but that's not how things currently behave. See:

http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-connection.html#table-couchbase-sdk_php_new_couchbase

Also, there was some question of whether or not getResultCode() should be used instead of an exception handling path.

This shows that getResultCode() and getResultMessage() are deprecated
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-summary-errors.html

 Comments   
Comment by Trond Norbye [ 06/Jun/13 ]
http://review.couchbase.org/#/c/26666/




[PCBC-235] Documentation: Document how to install our SDK with PEAR Created: 21/May/13  Updated: 23/Jul/13  Resolved: 23/Jul/13

Status: Closed
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Minor
Reporter: Tug Grall (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Based on a community feedback it is possible and easy to install Couchbase PHP SDK with Pear, it could be interested to add that as part of our documentation to let the developer chose the type of install (manual, pecl, pear, ...)

You can find the steps here:
http://www.couchbase.com/forums/thread/php-sdk-install-pear


 Comments   
Comment by Trond Norbye [ 21/May/13 ]
Please assign it back to me if you need more information.
Comment by kzeller [ 22/May/13 ]
Have we verified ourselves that this works?
Comment by Trond Norbye [ 22/May/13 ]
Hey Tug, can you verify it?
Comment by Tug Grall (Inactive) [ 23/May/13 ]
I have not I would prefer to have a "PHP" Expert like Mike doing it, assigning the task to him.
Comment by Michael Nitschinger [ 23/May/13 ]
to be clear here, the SDK can be installed through pecl. pear is for userlevel libraries!
Comment by Michael Nitschinger [ 23/May/13 ]
quick update: pecl install couchbase works, but the version it shows is 1.1.4-dp inside php -i ..
Comment by Trond Norbye [ 23/May/13 ]
That was another bug we've already fixed :)
Comment by Trond Norbye [ 23/May/13 ]
It is verified by Michael
Comment by kzeller [ 23/Jul/13 ]
Added:
http://www.couchbase.com/communities/php/getting-started




[PCBC-234] anil Created: 14/May/13  Updated: 14/May/13  Resolved: 14/May/13

Status: Closed
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Anonymous Assignee: Trond Norbye
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by kzeller [ 14/May/13 ]
error!
Comment by kzeller [ 14/May/13 ]
error!




[PCBC-233] build php 1.1.5 for windows Created: 14/May/13  Updated: 25/Sep/13  Resolved: 25/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Matt Ingenthron Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive php_couchbase-1.1.5-53-nts-vc9-x86.zip     Zip Archive php_couchbase-1.1.5-53-ts-vc9-x86.zip     Zip Archive php_couchbase-1.1.5-54-nts-vc9-x86.zip     Zip Archive php_couchbase-1.1.5-54-ts-vc9-x86.zip    

 Description   
Since we've released 1.1.5, we need to get some builds of that for Windows.




[PCBC-232] 1.1.5 PECL shows up as 1.1.4-dp1 in phpinfo() Created: 14/May/13  Updated: 14/May/13  Resolved: 14/May/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.5
Fix Version/s: 1.1.5
Security Level: Public

Type: Bug Priority: Major
Reporter: Michael Nitschinger Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
JEDI_BC
8:12 hi
8:13 is it normal that the last php pecl couchbase ext (1.1.5) indicates 1.1.4dp1 as version number in phpinfo() ?
daschl
8:30 JEDI_BC: I think its still a snapshot release right
8:30 ah no its not
JEDI_BC
8:30 normally it is flag as a stable release
daschl
8:30 yes it is
8:30 okay so this may be a bug
8:31 let me file an issue
JEDI_BC
8:31 ok
8:32 probably just a miss in file declaration

 Comments   
Comment by Trond Norbye [ 14/May/13 ]
There was a duplicate #define




[PCBC-231] version is incorrectly stored in two places Created: 09/May/13  Updated: 25/Aug/13  Resolved: 10/May/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.5
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Critical
Reporter: Matt Ingenthron Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: all


 Description   
After 1.1.5 release, we found a minor problem. Version is in two places.

ingenthr, trondn any reason why we need two defines for version? php ext Pierre @ 12:11
php_couchbase.h (correct) and internal.h (not sure why) Pierre @ 12:12





[PCBC-230] cannot work with autoconf 2.59 on CentOS 5.8 with php 5.3 Created: 08/May/13  Updated: 10/May/13  Resolved: 10/May/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: 1.1.3
Fix Version/s: 1.1.5
Security Level: Public

Type: Bug Priority: Major
Reporter: Matt Ingenthron Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified





[PCBC-229] --with-couchbase configure option no longer working Created: 08/May/13  Updated: 25/Aug/13  Resolved: 10/May/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Mark Nunberg Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The --with-couchbase option no longer has any effect. One can still monkey around with CPPFLAGS/LDFLAGS etc, though.

It should either be removed or fixed.

 Comments   
Comment by Trond Norbye [ 10/May/13 ]
--with-couchbase is an option to enable or disable couchbase as part of the build process if the module is located in ext, and you would typically set it to --with-couchbase=shared etc. It was incorrectly used earlier to try to pass a root directory for libcouchbase




[PCBC-228] Full return message upon error cut off from libcouchbase Created: 08/May/13  Updated: 25/Aug/13  Resolved: 10/May/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
When there is an error, it seems that the PHP library only returns "Network Error" instead of something more descriptive.

 Comments   
Comment by Perry Krug [ 12/May/13 ]
Hey Trond, could these error messages and codes get documented?
Comment by Trond Norbye [ 12/May/13 ]
I was under the impression that all of the error codes was documented already? Did you check couchbase-api.php?
Comment by Matt Ingenthron [ 12/May/13 ]
1.1.5 is the first release that ships couchbase-api.php, though it's been around for a little while.

I plan to add this to the official docs Perry, and then will send out an announcement internally. This just happened in the last few days (though Trond's addition of that file happened a little while ago).




[PCBC-227] setMulti doesn't support pure digit key Created: 30/Apr/13  Updated: 26/Sep/13  Resolved: 26/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2, 1.1.4
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Knee Oh Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: Ubuntu 12.04 / Apache 2 / PHP5 / libcouchbase - 2.0.5


 Description   
This bug didn't exist in 1.1.0dp5, but I've seen it before in php-memcached. The issue is when issuing a setMulti() array into CB it doesn't like it if the key is not a string.

$key = 12345
$value = 67890

$value = json_encode($value);
$array[$key] = $value;

$cb_obj->setMulti($array,$expire);

PHP Fatal error: Uncaught exception 'CouchbaseIllegalKeyException' with message 'Invalid key specified (not a string)'

test2.php(67): Couchbase->setMulti(Array, 604800)

The reference bug for php-memcached is: https://bugs.php.net/bug.php?id=59016

After experiencing the issue there I recompiled their newest version and it fixed the problem. I'm not sure if you can dovetail off of that work or not.

 Comments   
Comment by Knee Oh [ 30/Apr/13 ]
I forgot to mention, I'm loading a memcached bucket not a CB bucket.
Comment by Mark Nunberg [ 01/May/13 ]
So the problem is here:

https://github.com/couchbase/php-ext-couchbase/blob/9c1842fd5fd5c3e776ea85d85db1f7d5d5430c11/store.c#L673

Should look something like:
https://github.com/couchbase/php-ext-couchbase/blob/9c1842fd5fd5c3e776ea85d85db1f7d5d5430c11/store.c#L189

The latter is smart enough to convert 'LONG' keys into strings, whereas the former just blindly complains.
Comment by Knee Oh [ 02/May/13 ]
Additional testing yields that even if I force the key to a string like strval($key); , if the string is purely digits the library will still complain.
Comment by Mark Nunberg [ 03/May/13 ]
http://paste.scsys.co.uk/245952

I'd submit it to gerrit, but it appears to be down today.
Comment by Trond Norbye [ 03/May/13 ]
I've already got stuff for this but report in my repo.. it would probably be more efficient to synchronize with the people assigned to the bug reports before doing stuff...
Comment by Knee Oh [ 01/Jul/13 ]
Is there a patch for this? I just updated to 1.1.5 and am having the same problem with setMulti using a digit based key.
Comment by Juan Simon [ 01/Jul/13 ]
Extract from http://php.net/manual/en/language.types.array.php

Strings containing valid integers will be cast to the integer type. E.g. the key "8" will actually be stored under 8. On the other hand "08" will not be cast, as it isn't a valid decimal integer.




[PCBC-226] HTTP needs to be a POST after a certain size Created: 29/Apr/13  Updated: 31/Aug/13  Resolved: 31/Aug/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Task Priority: Major
Reporter: Robert Dominy Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: Mac OS X, CentOS


 Description   
I'm querying a view using the PHP SDK using the view method, $object->view($ddocname [, $viewname ] [, $viewoptions ]), and finding that when I pass in a certain number of keys in the viewoptions param, the method silently fails and just returns null. It appears that 164 keys is OK, but 179 is not. I didn't see documentation indicating a key limit and would expect an error if there were.
Here's the call:
// 179 keys breaks, 164 OK
$result = $this->cb->view(self::VIEW_DAP,'modelcount',array('keys' => $keys,
'group_level' => 2,
'group' => true,
'skip' => 0)

Here's a link to the forum thread I created:
http://www.couchbase.com/forums/thread/key-limit-view-queries

As you'll see in the responses, this is probably a much more general issue that the PHP SDK uses GET calls that have a string length limit. It seems that the SDK should either use POSTs to avoid the limit or document the size limits in the documentation.

 Comments   
Comment by Matt Ingenthron [ 15/Aug/13 ]
Thanks for the report. That's definitely an issue and we'll need to get it addressed.

Having said that, what's the reason for doing a view query with a large number of keys? Usually you'll get much better performance from getMulti():
https://github.com/couchbase/php-ext-couchbase/blob/1.1.5/example/couchbase-api.php#L337

Generally, there's not a case I can think of where I'd do this through a view, but maybe you have something in mind that I can't think of.
Comment by Trond Norbye [ 26/Aug/13 ]
Lets just use POST all the time to have a single code path to test..
Comment by Trond Norbye [ 31/Aug/13 ]
http://review.couchbase.org/#/c/28721/




[PCBC-225] Failure to load JSON module, even with workaround provided via instructions Created: 23/Apr/13  Updated: 30/Sep/13  Resolved: 30/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs, library
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
On a Centos 5.8 system, I am unable to follow our instructions (http://www.couchbase.com/develop/php/current) to success.

After setting everything up, I get the following error about JSON:
NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/couchbase.so' - /usr/lib64/php/modules/couchbase.so: undefined symbol: php_json_decode in Unknown on line 0

This is even after I put the json.so as an extension in the PHP.ini file.

php -i shows the proper JSON related output:
~ $ php -i | grep json
json
json support => enabled
json version => 1.2.1

I will note that installing via the new PECL method helps to resolve this, but you still get the error if you don't include json.so in the php.ini file.

 Comments   
Comment by Sharon Barr (Inactive) [ 23/Apr/13 ]
The user is using PHP 5.4.11 and was following the steps on http://eugenioz.blogspot.com/2013/01/installing-php-54-couchbase-server-20.html
Comment by Matt Ingenthron [ 23/Apr/13 ]
Note that installing from PECL isn't for a release yet. We do have a snapshot up there though, but that needs to be installed through:

sudo pecl install channel://pecl.php.net/couchbase-1.1.4
Comment by Perry Krug [ 26/Apr/13 ]
Any progress on figuring out what was going wrong with this server?
Comment by Perry Krug [ 07/May/13 ]
Any comment/progress on this issue?
Comment by Matt Ingenthron [ 07/May/13 ]
sorry, not at the moment. I did try to ssh to the server at one point, but I think I was too late.

Can you identify where the user got the php 5.4.11? I can try that on my centos system to see if I can identify the source of the issue.
Comment by Perry Krug [ 07/May/13 ]
I'm not sure where Sharon's user got php 5.4.11 from, but this is the PHP54 package I had installed on the RightScale system that had this issue reproduced:
[root@ip-10-197-24-67 ~]# yum info php54
Loaded plugins: security
Excluding Packages from none
Finished
Available Packages
Name : php54
Arch : x86_64
Version : 5.4.4
Release : 1.ius.el5
Size : 3.1 M
Repo : rightscale-epel
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
           : easy for developers to write dynamically generated web pages. PHP
           : also offers built-in database integration for several commercial
           : and non-commercial database management systems, so writing a
           : database-enabled webpage with PHP is fairly simple. The most common
           : use of PHP coding is probably as a replacement for CGI scripts.
           :
           : The php package contains the module which adds support for the PHP
           : language to Apache HTTP Server.


What else do you need in order to identify, reproduce and resolve this?
Comment by Brett Lawson [ 27/Sep/13 ]
Do we have a RightScale account we can try to use to reproduce this issue?
Comment by Trond Norbye [ 30/Sep/13 ]
Please ensure that the json extension is loaded _before_ the couchbase extension.

If you're using a single .ini file it should look like:

extension=json.so
extension=couchbase.so

If you're using multiple ini files you must either ensure their load order, or add extension=json.so before you try to load couchbase.so (and cause it to be loaded "multiple" times).




[PCBC-224] Document installation instructions for Windows with Apache instead of IIS Created: 22/Apr/13  Updated: 24/Sep/13  Resolved: 24/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Brett Lawson [ 24/Sep/13 ]
Where do you see documentation on instructions for installing the extension for IIS specifically, all the instructions I can find that are specific to Windows appear to refer only to your PHP installation directory, and not a particular httpd.
Comment by Trond Norbye [ 24/Sep/13 ]
http://trondn.blogspot.no/2013/04/couchbase-php-xampp-and-windows.html
Comment by Trond Norbye [ 24/Sep/13 ]
Where can I see the fix?
Comment by Brett Lawson [ 24/Sep/13 ]
Presumably, your blog posts are the only place that IIS vs Apache are actually discussed. In all other documentation, it refers only to PHP installation folders which would be accurate no matter what http server you are using.
Comment by Trond Norbye [ 24/Sep/13 ]
Given that it might not be clear to people (hence the bug report was created) is there some way we can make the current text more clear? Not to be too offensive, but my experience with the average windows user is that they're not that willing to try to figure out what's wrong with their setup (as compared to lintendo users whos expectations are that it won't work anyway so they'll have to dig a bit deeper)...




[PCBC-223] Docs: Instructions to find php.ini incorrect Created: 22/Apr/13  Updated: 23/Sep/13  Resolved: 23/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
http://www.couchbase.com/develop/php/current

"You will add the couchbase.so extension to your php.ini file. To find where your php.inifile is, try php -i | grep extension_dir or look at your <?php phpinfo() ?> output. Edit your php.ini to include these two lines:"

Not correct..."extension_dir" should be "Configuration" and there should be another set of instructions for finding the extension directory

 Comments   
Comment by kzeller [ 24/Apr/13 ]
Looks like this is broken again despite the info on JSON library for linux. Do you have the correct way to do this?
Comment by Trond Norbye [ 06/Jun/13 ]
Perry is right here. If you read the sentence it tells you how to locate your php.ini file, but the grep there tells you where the _extensions_ are installed.

The correct entry should look like something like:

trond@ok> php -i | grep Configuration
Configuration File (php.ini) Path => /etc
Loaded Configuration File => (none)

and as you see on the first line of output there it prints out the correct value.
Comment by Perry Krug [ 06/Jun/13 ]
Yes, and then there should be another set of instructions on how to find the extension_dir.
Comment by kzeller [ 19/Jul/13 ]
Instructions for finding the extension_dir are:


Comment by Trond Norbye [ 26/Aug/13 ]

trond@ok> php -i | grep extension_dir ~
extension_dir => /usr/lib/php/extensions/no-debug-non-zts-20090626 => /usr/lib/php/extensions/no-debug-non-zts-20090626
Comment by kzeller [ 26/Aug/13 ]
Gwen- Let's discuss. This is the drupal page needing updates again.
Comment by Gwen Leong (Inactive) [ 06/Sep/13 ]
This link doesn't direct me to the file in question.
Also, I cannot find the text as originally quoted in here: http://docs.pub.couchbase.com/couchbase-sdk-php-1.1/

Has this been rewritten? What action should I take?
Comment by kzeller [ 06/Sep/13 ]
You should add this instruction:

php -i | grep extension_dir ~
extension_dir => /usr/lib/php/extensions/no-debug-non-zts-20090626 => /usr/lib/php/extensions/no-debug-non-zts-20090626

to the page here:

http://www.couchbase.com/communities/php/getting-started


Remember you are set up with edit permissions on Drupal.
Comment by Gwen Leong (Inactive) [ 20/Sep/13 ]
Edited under Step 1.2: Update your PHP Configuration
Please confirm this is the correct formatting.
http://www.couchbase.com/communities/php/getting-started
Comment by Perry Krug [ 23/Sep/13 ]
This page still looks a bit odd:
-there needs to be a space after the first php.ini (between php.ini and file)
-It says "or look at your output"...what output?
-the example for finding an extension dir looks like it has a duplicate entry in there, and it should also show the location of a default php install, not something with no-debug-non-zts...etc, etc
Comment by Gwen Leong (Inactive) [ 23/Sep/13 ]
- Will do.
- I will change "look at your output" to "look at your <?php phpinfo() ?> output." (Judging from the context of the original bug reference)
- Tell me exactly (word for word) what needs to go there.
Comment by Matt Ingenthron [ 23/Sep/13 ]
Brett: can you review this and get it more settled?
Comment by Brett Lawson [ 23/Sep/13 ]
The page has been updated and is in draft ready for publishing, I fixed the text on how to locate your php.ini as well as fixing the 'check your output' which was missing entity encoding of its special characters.




[PCBC-222] couchbase.default_prefix setting in PHP.ini Created: 22/Apr/13  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Minor
Reporter: jtulach Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
It will be nice to have couchbase.default_prefix setting in PHP.ini to set default value of couchbase_res->prefix_key in new connections.

 Comments   
Comment by Brett Lawson [ 13/Mar/14 ]
Due to the nature of the new API's for 2.0.0, automatic prefixing is no longer supported, this would cause extreme confusion in regards to the return objects from operations (as they would be prefixed, even though your input was not).




[PCBC-221] PHP Couchbase persistent connections shares more than expected Created: 22/Apr/13  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Bug Priority: Major
Reporter: jtulach Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
PHP Couchbase persistent connection shares all option settings (serializer, compression, prefix_key) and keeps that settings across multiple requests. This is not an expected behaviour.
 
Code:
 
<?php
 $cb1 = new Couchbase("http://192.168.0.180/default");
 $cb2 = new Couchbase("http://192.168.0.180/default");

$cb1->setOption(COUCHBASE_OPT_PREFIX_KEY,'cb1');
 $cb2->setOption(COUCHBASE_OPT_PREFIX_KEY,'cb2');
 
$cb1->set('val1','v1', 60);
 $cb2->set('val2','v2', 60);
 ?>
 
will store following keys:
 
cb2_val1
 cb2_val2
 
Moreover if you execute right after previous request following code (in another script):
 
<?php
 $cb = new Couchbase("http://192.168.0.180/default");
 $cb->set('val3','v3', 60);
 ?>
 
the code stores key:
 
cb2_val3
 
If you turn off the persistent connections, you will get more consistent results:
 
cb1_val1
 cb2_val2
 val3
 
The problem is that whole _php_couchbase_res structure is shared when using persistent connection. Possible change is to duplicate this structure in php_couchbase_create_impl. But resource destructors should be modified according to this change.


 Comments   
Comment by Brett Lawson [ 13/Mar/14 ]
Due to the underlying implementation of the SDK, it is non-trivial to allow persistent connections to separate some options. However, as of 2.0.0-dp1, any options which are 'global' across persistent connections to the same cluster are advertised as such.




[PCBC-220] error with "default" bucket. named bucket work OK: CouchbaseLibcouchbaseException Failed to get a value from server: Network error. Created: 13/Apr/13  Updated: 12/Sep/13  Resolved: 03/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: thanhbv Assignee: Trond Norbye
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: centos 6.4 x86_64. php-fpm 5.4.13-1.el6.remi.x86_64

Attachments: Text File CouchbaseLibcouchbaseException.txt     Text File no-error-if-downgrade.txt     File repos.repo     Text File yum.log    

 Description   
php-ext-couchbase version: https://github.com/couchbase/php-ext-couchbase/commit/ff2ed89c6255a2f364640b62d9930732ce597075

duplicates to #PCBC-169, but with php 5.4

I use php-fpm 5.4.13-1.el6.remi.x86_64 ( with nginx-1.3.15-1.el6.ngx.x86_64).
It work OK yesterday. But today: CouchbaseLibcouchbaseException Failed to get a value from server: Network error.

  $bk = isset($_GET['bk'])? $_GET['bk'] : 'default';
  $cb = new Couchbase("$host:8091", 'user', 'password', $bk);
  $a = $cb->get('aaa'); //-> error here

Error with /test.php (& /test.php?bk=default). But OK with /test.php?bk=mybk

After: # service php-fpm restart
Then all (with 'default' & with named bucket) test OK.

I can not reproduce this error now.

 Comments   
Comment by thanhbv [ 15/Apr/13 ]
yesterday, I update:
php-fpm-5.4.14-1.el6.remi.x86_64, php-ext-couchbase 0f54569ebe34a80e225b85c7dcb5813ed86e351e
tested OK.

Now, the same error as above occur. After restart service php-fpm => OK

Note:
I run php-fpm (with couchbase ext) on a VMWare virtual machine and couchbase server 2.0.1 (enterprise edition build-170) on a physical machine.
The VM is sometime suspended, sometime NOT connect to the server. (But when I run test, of course 2 machine is connected)
Comment by Matt Ingenthron [ 15/Apr/13 ]
I suspect the network connection is getting dropped because of the idling time.

Trond: do we need to worry about reconnect?

Thanhbv: do you use persistent connections? What does your constructor for the client look like?
Comment by Trond Norbye [ 16/Apr/13 ]
I don't think you can use persistent connections in a configuration where you suspend and resume the vm so we won't look into this if thats the case. What is the output from the couchbase section of "php -i" ?
Comment by thanhbv [ 22/Apr/13 ]
Yes, I think it use persistent connection.
phpinfo():
_______________
couchbase
couchbase support enabled
version 1.1.4dp1
libcouchbase version 2.0.5
json support yes
fastlz support yes
zlib support yes

Directive Local Value Master Value
couchbase.compression_factor 1.3 1.3
couchbase.compression_threshold 2000 2000
couchbase.compressor none none
couchbase.config_cache /var/cache/cb /var/cache/cb
couchbase.durability_default_poll_interval 100000 100000
couchbase.durability_default_timeout 40000000 40000000
couchbase.instance.persistent On On
couchbase.restflush On On
couchbase.serializer json_array json_array
couchbase.view_timeout 75 75
_______________

thank you.
Comment by thanhbv [ 03/Sep/13 ]
I have just update libcouchbase2.
And now CouchbaseLibcouchbaseException every time!
Comment by thanhbv [ 03/Sep/13 ]
If I use java sdk => success:

[cpr@dev tmp]$ sudo yum install http://repo.scala-sbt.org/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.13.0/sbt.rpm

[cpr@dev tmp]$ mkdir -p cb-scala/src/main/scala && cd cb-scala

[cpr@dev cb-scala]$ nano build.sbt

##################################
name := "cb-scala"

version := "1.0"

scalaVersion := "2.10.2"

resolvers += "Couchbase Maven Repository" at "http://files.couchbase.com/maven2"

libraryDependencies += "couchbase" % "couchbase-client" % "1.1.9"

##################################

[cpr@dev cb-scala]$ nano src/main/scala/Main.scala

//////////////////////////////////
import collection.JavaConverters._
import java.net.URI
import com.couchbase.client.CouchbaseClient
 
object Main extends App {
    val uris = List("192.168.1.200:8091").map(uri => URI.create(s"http://$uri/pools")).asJava
    val cb = new CouchbaseClient(uris, "<bucket>", "<password>")
 
    cb.set("aaa", 0, "value?")
    println(cb.get("aaa"))
}
//////////////////////////////////

[cpr@dev cb-scala]$ sbt run
Loading /usr/share/sbt/bin/sbt-launch-lib.bash
[info] Set current project to cb-scala (in build file:/tmp/cb-scala/)
[info] Compiling 1 Scala source to /tmp/cb-scala/target/scala-2.10/classes...
[info] Running Main
2013-09-03 16:13:45.186 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/192.168.1.200:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2013-09-03 16:13:45.193 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@6c25add2
2013-09-03 16:13:45.229 INFO com.couchbase.client.ViewConnection: Added dev.sandinh.net to connect queue
2013-09-03 16:13:45.230 INFO com.couchbase.client.CouchbaseClient: viewmode property isn't defined. Setting viewmode to production mode
2013-09-03 16:13:45.272 INFO net.spy.memcached.auth.AuthThread: Authenticated to dev.sandinh.net/192.168.1.200:11210
value?
Comment by Trond Norbye [ 03/Sep/13 ]
which libcouchbase2 packages do you have installed? and does this problem occur if you never suspend the vm's?
Comment by thanhbv [ 03/Sep/13 ]
If I downgrade libcouchbase as in the attached file => no error!
Comment by Trond Norbye [ 03/Sep/13 ]
Given the last comment in the bug report I assume this is a duplicate of https://www.couchbase.com/issues/browse/CCBC-246
Comment by thanhbv [ 12/Sep/13 ]
>>which libcouchbase2 packages do you have installed?
you can found it in the attached file no-error-if-downgrade.txt
The error occured before the commands in no-error-if-downgrade.txt. And the after running the commands => no error.

>>and does this problem occur if you never suspend the vm's?
I'm sorry. From the first comment on 03/Sep/13, the issue is NOT relate to vm (I run Centos 6.4 on a physical machine)
It is probably a different issue (than the original one).

>>I assume this is a duplicate of CCBC-246
I don't think so. Because CCBC-246 say that if I install libcouchbase2-libevent => no error. But with the following packages installed, the error still occur:
libcouchbase2-core-2.1.2-1.x86_64
libcouchbase2-libevent-2.1.2-1.x86_64
libcouchbase-devel-2.1.2-1.x86_64
couchbase-server-2.1.1-764.x86_64
Comment by thanhbv [ 12/Sep/13 ]
I have just test on a clean system, still error:
1. install centos 6.4 x86_64 minimal
2. yum update
3. add some yum repos as in file repos.repo
4. yum clean all && yum update
5. yum install couchbase-server-enterprise_x86_64_2.1.1.rpm
6. yum install libcouchbase2-libevent libcouchbase-devel php php-pecl-couchbase
(I attached file /var/log/yum.log to this issue)
7. service iptables stop
then use browser, goto <host>:8091 to setup couchbase
8. remove bucket default. add bucket fodi (type: couchbase, has password). I don't know if this step is related to the issue, just note here all step I do.
9. create file cb.php as in step 2 in http://www.couchbase.com/communities/php/getting-started
10. php cb.php => error:

PHP Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with message 'Failed to create libcouchbase instance' in /root/dl/cb.php:3
Stack trace:
#0 /root/dl/cb.php(3): Couchbase->__construct('127.0.0.1:8091', 'user', 'password', 'fodi')
#1 {main}
  thrown in /root/dl/cb.php on line 3




[PCBC-219] Floating point error in PHP Couchbase Library 1.1 Created: 09/Apr/13  Updated: 01/May/14  Resolved: 16/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.1.4, 1.2.2
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
--------------
$value = 50.00;
$couchbase->set('testvalue',$value,300);
echo "getting value now... ";
var_dump($couchbase->get('testvalue'));
-------------
float(5011)
Not 50.00.

Diving into the couchbase console, it is stored correctly. Something is wrong with the get method coming out of the PHP extension.
This is happening on any 2 decimal number with .00 as the extension. Caught this in an ecommerce application ... needless to say $ impact of giving someone $5011 instead of $50.00 is damaging.
Can anyone confirm this behavior in their environments?

 Comments   
Comment by Trond Norbye [ 16/Apr/13 ]
This was already fixed in some version before 1.1.4. I added a new testcase to verify this.

http://review.couchbase.org/25694
Comment by Shaun Tilford [ 11/Jun/13 ]
We are now running on 1.1.5 and still see the issue happening. Noted on over a dozen of our boxes here, both in development and production environments.
Comment by Trond Norbye [ 12/Jun/13 ]
What is your platform and PHP version so I can try to reproduce this?
Comment by Shaun Tilford [ 13/Jun/13 ]
PHP 5.4.12, CentOS release 5.6 (Final)
Comment by Trond Norbye [ 17/Jun/13 ]
I've had some trouble installing CentOS 5.6 locally, but so far I've tested it with success on:

Ubuntu 13.04
MacOS X
CentOS 6 (php from yum)
CentOS 5.7 (PHP 5.4.16)

I have get access to a CentOS 5.6 system to debug the problem there
Comment by Trond Norbye [ 17/Jun/13 ]
Hi, I finally got around to get access to a 5.6 box, but I doesn't fail there either:

[trondn@ip-10-36-176-84]~/compile/php-ext-couchbase/example% cat /etc/redhat-release
CentOS release 5.6 (Final)
[trondn@ip-10-36-176-84]~/compile/php-ext-couchbase/example% /opt/php/bin/php --version
PHP 5.4.16 (cli) (built: Jun 17 2013 16:44:15)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[trondn@ip-10-36-176-84]~/compile/php-ext-couchbase/example% cat float.php
<?php

$cb = new Couchbase("localhost");

$val = 50.0;
var_dump($cb->set("foo", $val));
var_dump($cb->get("foo"));
?>
[trondn@ip-10-36-176-84]~/compile/php-ext-couchbase/example% /opt/php/bin/php -c couchbase.ini float.php
string(19) "5776353753026134016"
float(50)

Comment by Matt Ingenthron [ 18/Jun/13 ]
Note, this was 64-bit, but the bug didn't indicate whether it was observed on 32-bit or 64-bit.
Comment by Sergey Avseyev [ 10/Apr/14 ]
FYI there is a patch related http://review.couchbase.org/35567




[PCBC-218] cas() operation does not check if the cas contains illegal characters. Created: 04/Apr/13  Updated: 05/Apr/13  Resolved: 05/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Task Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
$cb = new \Couchbase('127.0.0.1', '', '', 'default', true);
 
$cas = $cb->set('foo', 'bar', 0, null);
var_dump($cb->get('foo'));
 
var_dump($cb->cas($cas, 'foo', 'baz', 0));
var_dump($cb->get('foo'));
 
var_dump($cb->cas($cas, 'foo', 'bad', 0));
var_dump($cb->get('foo'));
 
var_dump($cb->cas('This is an invalid CAS', 'foo', 'bar', 0));
var_dump($cb->get('foo'));
 
 
RESULTS OF RUNNING:
php test.php
string(3) "bar"
bool(true)
string(3) "baz"
bool(false)
string(3) "baz"
bool(true)
string(3) "bar"

 Comments   
Comment by Trond Norbye [ 04/Apr/13 ]
http://review.couchbase.org/#/c/25481/




[PCBC-217] Create package.xml to build from PECL Created: 02/Apr/13  Updated: 12/Apr/13  Resolved: 12/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Trond Norbye [ 02/Apr/13 ]
http://review.couchbase.org/#/c/25445/




[PCBC-216] Client Library not processing server response correctly returned COUCHBASE_SUCCESS upon faliure Created: 22/Mar/13  Updated: 22/Mar/13  Resolved: 22/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Critical
Reporter: Juan Simon Assignee: Matt Ingenthron
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: Version: 2.0.1 enterprise edition (build-170)
Client library version 1.1.2


 Description   
View query returned {"error":"bad_request","reason":"attachments not supported in Couchbase"}
The query was:
$cb->view('/lnp/_design/lnp/_view/lnp_stats?key=[2013,3,22,11001]');
Note the malformed query (the extra bucket before _desing)

The server returned: (captured using sudo tcpdump -s 1024 -l -i eth1 -A 'tcp port 8092') <- Thanks avsej
HTTP/1.1 400 Bad Request
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Fri, 22 Mar 2013 16:42:41 GMT
Content-Type: application/json
Content-Length: 74
Cache-Control: must-revalidate

$cb->getResultCode() returned COUCHBASE_SUCCESS <-- Here is the issue

 Comments   
Comment by Trond Norbye [ 22/Mar/13 ]
Same as PCBC-215




[PCBC-215] View code does not check the HTTP status code Created: 22/Mar/13  Updated: 22/Mar/13  Resolved: 22/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Task Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
It currently just check if libcouchbase is able to execute the request, not if the status of the request is good or not

 Comments   
Comment by Trond Norbye [ 22/Mar/13 ]
http://review.couchbase.org/#/c/25305/




[PCBC-214] Detection of incorrect expiry time is wrong.. Created: 22/Mar/13  Updated: 22/Mar/13  Resolved: 22/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Task Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Currently it marks it as an error, but it goes ahead and perform the operation anyway...

 Comments   
Comment by Trond Norbye [ 22/Mar/13 ]
http://review.couchbase.org/#/c/25304/




[PCBC-213] SEGV in extension: php_couchbase_pres_dtor (rsrc=<optimized out>) at /sources/lcb2.0-repo/php/couchbase.c:64 Created: 21/Mar/13  Updated: 22/Mar/13  Resolved: 22/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: 1.1.3
Fix Version/s: 1.1.4
Security Level: Public

Type: Bug Priority: Blocker
Reporter: Matt Ingenthron Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt: start-finish

 Description   
FAILED TEST SUMMARY
---------------------------------------------------------------------
GetMulti - PlainOO [tests/phpt/GetMulti/PlainOO.phpt]
GetReplica - GetReplica [tests/phpt/GetReplica/GetReplica.phpt]
GetReplica - GetReplicaMulti [tests/phpt/GetReplica/GetReplicaMulti.phpt]
NegativeExpiry - Increment [tests/phpt/NegativeExpiry/Increment.phpt]
NegativeExpiry - TouchMulti [tests/phpt/NegativeExpiry/TouchMulti.phpt]
Prefix - Prefix [tests/phpt/Prefix/Prefix.phpt]
ViewSimple - MissingView [tests/phpt/ViewSimple/MissingView.phpt]
=====================================================================


This against a local cluster. Additionally, two of the failed tests segfault. Is this normal?

For the GetMulti failure:

Program received signal SIGSEGV, Segmentation fault.
*__GI___libc_free (mem=0x7ffff37a7e60) at malloc.c:3709
3709 malloc.c: No such file or directory.
(gdb) bt
#0 *__GI___libc_free (mem=0x7ffff37a7e60) at malloc.c:3709
#1 0x00007ffff47efded in php_couchbase_pres_dtor (rsrc=<optimized out>)
    at /sources/lcb2.0-repo/php/couchbase.c:64
#2 0x00000000006ae83e in plist_entry_destructor (ptr=0x101a630)
    at /tmp/buildd/php5-5.4.4/Zend/zend_list.c:209
#3 0x00000000006ab1b5 in zend_hash_apply_deleter () at /tmp/buildd/php5-5.4.4/Zend/zend_hash.c:650
#4 0x00000000006ac9a8 in zend_hash_graceful_reverse_destroy (ht=0xdb8798)
    at /tmp/buildd/php5-5.4.4/Zend/zend_hash.c:687
#5 0x000000000069e749 in zend_shutdown () at /tmp/buildd/php5-5.4.4/Zend/zend.c:822
#6 0x000000000063f44b in php_module_shutdown () at /tmp/buildd/php5-5.4.4/main/main.c:2346
#7 0x0000000000430f78 in main (argc=32767, argv=0xdb9210) at /tmp/buildd/php5-5.4.4/sapi/cli/php_cli.c:1376

The segfault from the Prefix test is similar.

 Comments   
Comment by Trond Norbye [ 22/Mar/13 ]
This error is caused by the persistent connections (and most likely been here from the beginning)
Comment by Trond Norbye [ 22/Mar/13 ]
http://review.couchbase.org/#/c/25306/




[PCBC-212] make persistent connections on by default Created: 17/Mar/13  Updated: 17/Mar/13  Resolved: 17/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: 1.1.2
Fix Version/s: 1.1.3
Security Level: Public

Type: Improvement Priority: Major
Reporter: Matt Ingenthron Assignee: Trond Norbye
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
I think it's time to make the switch.

See:
http://stackoverflow.com/questions/15451560/couchbase-php-sdk-slow-establishing-connection-to/15455411?noredirect=1#comment21878658_15455411




[PCBC-210] couchbase.ini should have an entry for loading the extension ;) Created: 08/Mar/13  Updated: 08/Mar/13  Resolved: 08/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
This makes it easier to just copy the ini file in place :)

 Comments   
Comment by Trond Norbye [ 08/Mar/13 ]
http://review.couchbase.org/#/c/25052/




[PCBC-209] The default value for persistent instances should be contigurable Created: 08/Mar/13  Updated: 08/Mar/13  Resolved: 08/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
PCBC-192 fixed the default value for persistent instances, but we should allow for people to get the old behavior if they depend on that.

 Comments   
Comment by Trond Norbye [ 08/Mar/13 ]
http://review.couchbase.org/#/c/25051/




[PCBC-208] Add a bucket flush feature to ClusterManager class Created: 01/Mar/13  Updated: 11/Mar/13  Resolved: 11/Mar/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: 1.1.0, 1.1.1, 1.1.2
Fix Version/s: 1.1.4
Security Level: Public

Type: New Feature Priority: Major
Reporter: Matt Ingenthron Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
One thing that should be possible with the ClusterManager class is flushing a bucket by it's name. If instantiated with the Administrator credentials, the ClusterManager should be able to flush any bucket.

Note, this depends on flush being enabled.




[PCBC-207] Support to Spatial Views in PHP SDK Created: 28/Feb/13  Updated: 24/Sep/13  Resolved: 24/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: New Feature Priority: Major
Reporter: Tug Grall (Inactive) Assignee: Matt Ingenthron
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The release 1.1.2 does not allow developer to call Spatial Views.

We need to implement it for future release

 Comments   
Comment by Matt Ingenthron [ 01/Mar/13 ]
Note that this may be a while, as spatial support is still experimental at this stage. Best approach at the moment is to use the REST API directly as documented.
Comment by Brett Lawson [ 24/Sep/13 ]
Closing this ticket until spacial support is out of experimental support stage.




[PCBC-206] Add support for the config-caching interface in libcouchbase Created: 27/Feb/13  Updated: 08/Apr/13  Resolved: 08/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified





[PCBC-205] couchbase_res->rc not set on view execute failure Created: 18/Feb/13  Updated: 02/Apr/13  Resolved: 02/Apr/13

Status: Closed
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: Tim Smith (Inactive) Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: php-ext-couchbase git master @9a301ada0bf7


 Description   
In views.c in php_couchbase_view_impl(), the couchbase_res->rc result code is last set in case the lcb_timer can't be created. But it is not set in case of any further failures in actually processing the view results.

I expect it to clear the flag (set it to LCB_SUCCESS) on success, and set it to some meaningful error code in the failure branches:

https://github.com/couchbase/php-ext-couchbase/blob/cf70968ed3f0c781e75e4cc43de6c561019b459d/views.c#L357

https://github.com/couchbase/php-ext-couchbase/blob/cf70968ed3f0c781e75e4cc43de6c561019b459d/views.c#L369


 Comments   
Comment by Trond Norbye [ 02/Apr/13 ]
the rc value is set in the callback for other errors.




[PCBC-204] Persistent connections should be indexed on server list contents, not their order. Created: 13/Feb/13  Updated: 14/Feb/13  Resolved: 14/Feb/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.0.4, 1.1.2
Fix Version/s: 1.1.3
Security Level: Public

Type: Bug Priority: Major
Reporter: Mark Nunberg Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
In the current state, we simply treat the connection parameter as a string.

An example use case may be of several clients trying to load-balance between various entry points nodes (EPTs). Such a strategy ensures that they aren't all hitting the same node for configuration requests.

However when attempting to use this in conjunction with persistent connections, we have the consequence that each permutation of the "Server List" is treated as a separate key when using persistent connections; therefore something like:

$base_list = array("1.1.1.1", "2.2.2.2", "3.3.3.3", "4.4.4.4");

for ($i = 0; $i < 1000; $i++) {
 $cur_list = $base_list;
 shuffle($cur_list);
 $cb = new Couchbase($cur_list, "", "", "", true);
 $cb->set("foo", "bar");
 // other operations
}

In a nutshell, this code has a "base" set of four servers. In the "normal" initialization code, the list is copied and then shuffled around, so that the first server in the list is always something else. Since the first server in the list ends up becoming the EPT (unless the server is down, in which case the next node is used, etc.) this enables some kind of cheap load balancing.

However this also means the order of the array is different, which means the "canonical connection key" is different, which means that when considering whether an existing connection is available, a new one is created. Since we have 4 servers in the list, there is a potential of having 4*4=16 different client objects per process. These objects will never die.

The solution is then to "deconstruct" the connection string in such a way that the server list itself is always alphabetically sorted. The effective list (When actually connecting) will remain the same, but for indexing purposes, it shall be sorted.




[PCBC-203] document getResultCode() and getResultMessage() Created: 13/Feb/13  Updated: 21/Feb/13  Resolved: 21/Feb/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Matt Ingenthron Assignee: MC Brown (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The getResultCode() and getResultMessage() are not currently in the API reference. Also, there should be mention of the couchbase-api.php that is now included in the .zip file distribution.

 Comments   
Comment by MC Brown (Inactive) [ 15/Feb/13 ]
According to Trond, the getResultCode() and getResultMessage() methods are deprecated and should not be used in the OO interface, instead the exception raised should be caught.

I'll check on the couchbase-api.php file and update as necessary.
Comment by MC Brown (Inactive) [ 18/Feb/13 ]
I've downloaded all the packages available, and cannot find the couchbase-api.php file you mention.
Comment by MC Brown (Inactive) [ 21/Feb/13 ]
The PHP docs have been updated with the usage, examples, and codes for getResultCode() and getResultMessage(), in addition to the information on the new Exceptions structure.

The top level for the error handling in PHP can be found here:

http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-summary-errorhandling.html




[PCBC-202] Missing documentations how to setup php client on windows 7 Created: 12/Feb/13  Updated: 24/Apr/14  Resolved: 24/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.1.5
Security Level: Public

Type: Bug Priority: Minor
Reporter: Ilan Katz (Inactive) Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Ilan Katz (Inactive) [ 12/Feb/13 ]
There are no explanations in the following link http://www.couchbase.com/develop/php/current
Comment by Trond Norbye [ 02/Apr/13 ]
Windows is currently not a "supported" platform. see PCBC-53
Comment by Brett Lawson [ 24/Apr/14 ]
This was fixed ages ago.




[PCBC-201] Docs: Reference installation Created: 11/Feb/13  Updated: 30/Sep/13  Resolved: 30/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Customers have lots of choices at their fingertips, and many of those choices will result in a non-functioning installation, or at least a lot of time spent figuring out what the right pieces are.

Can we please provide as much details as possible about a reference installation that we can be sure will work for a customer who is just getting started? This is outside of our support for any one operatin system, but more about telling the customer "if you install with these versions and packages, this code will work"

-OS
-"language" version (PHP 5.x, etc)
-other packages/modules required and/or tested with

 Comments   
Comment by Brett Lawson [ 30/Sep/13 ]
Our documentation does this. It specifies a 'normal' install of PHP 5.4 running on Apache, which works flawlessly if that is what is used in all of my tests.




[PCBC-200] Docs: Documented supported versions of PHP Created: 11/Feb/13  Updated: 14/May/13  Resolved: 14/May/13

Status: Closed
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Minor
Reporter: Perry Krug Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Previous pages of the /develop/PHP/current mentioned support for a specific PHP version. There is no mention of that now.

Does that imply that any version of PHP will work with any of our supported libraries? If yes, let's please be specific about that. If no, can we please detail which PHP version is supported for each OS?

 Comments   
Comment by Trond Norbye [ 02/Apr/13 ]
Can you update the documentation on the site that the currently supported versions is PHP 5.3 and newer.
Comment by kzeller [ 14/May/13 ]
confirmed/updated

getting-started.xml:47: <para> PHP 5.3 and above installed. For more information, see <ulink
tutorial.xml:43: PHP 5.3 or later: The PHP SDK itself requires 5.3 or later,

appears:

http://www.couchbase.com/docs/couchbase-sdk-php-1.1/getting-started.html
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/tutorial.html
Comment by kzeller [ 14/May/13 ]
confirmed/updated

getting-started.xml:47: <para> PHP 5.3 and above installed. For more information, see <ulink
tutorial.xml:43: PHP 5.3 or later: The PHP SDK itself requires 5.3 or later,

appears:

http://www.couchbase.com/docs/couchbase-sdk-php-1.1/getting-started.html
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/tutorial.html




[PCBC-199] Docs: Add link to more code examples Created: 11/Feb/13  Updated: 18/Apr/14  Resolved: 27/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.2.1
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
https://github.com/couchbaselabs/DeveloperDay/tree/master/PHP

 Comments   
Comment by Brett Lawson [ 27/Sep/13 ]
Added link at the bottom of the Tutorial pointing to further samples.




[PCBC-198] Tag the 1.1.2 release Created: 09/Feb/13  Updated: 13/May/13  Resolved: 13/May/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.1.2
Security Level: Public

Type: Bug Priority: Blocker
Reporter: Mike Wiederhold Assignee: Matt Ingenthron
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
http://www.couchbase.com/forums/thread/github-tagging-php-ext-couchbase

Please follow up with the user who posted this forum question upon completion

 Comments   
Comment by Trond Norbye [ 13/May/13 ]
Its too old... use a more recent version




[PCBC-197] different parameter order for incremement Created: 05/Feb/13  Updated: 01/Oct/13  Resolved: 01/Oct/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: .future
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Brett Lawson
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
From IRC:

lachlan: can the latest php sdk (couchbase.so) still to be a drop in replacement for php memcached?
[2:39pm] trondn: lachlan: it is supposed to be compatible, but the constructor/factory methods are named differently etc..
[2:39pm] lachlan: reason I ask is the different order of parameters for increment() between memcached and couchbase sdk
[2:39pm] lachlan: Memcached::increment ( string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] )
[2:39pm] lachlan: Couchbase - $object->increment($key [, $offset ] [, $create ] [, $expiry ] [, $initial ])
[2:39pm] trondn: hmm.. I guess that's a bug...
[2:40pm] trondn: let me file that one...
[2:40pm]

 Comments   
Comment by Trond Norbye [ 16/Apr/13 ]
This will result in an API breakage... What should we do?
Comment by Matt Ingenthron [ 25/Sep/13 ]
Brett: can you evaluate what we should do here?

Note that there is pecl/memcache and pecl/memcached. We've sort of copied the later and try to be somewhat API compatible, though there are clearly some constructor and error handling differences.
Comment by Trond Norbye [ 25/Sep/13 ]
Changing the API will cause problems from others thats already using it :S
Comment by Brett Lawson [ 27/Sep/13 ]
I don't think changing this at this point is the best options, it will just confuse our existing users as Trond said. I think this is going to be something that was err'd on when the API was developed, that we may have to live with :) RFC!




[PCBC-196] Error handling documentation Created: 05/Feb/13  Updated: 27/Sep/13  Resolved: 27/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Improvement Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Please create some documentation specifying possible error/failures to operations, what they "look" like in the logs/exceptions/stack traces and what our recommendation is on how to handle them.

i.e. tmp_oom, timeouts (connection/operation/java-internal/etc), "get miss" (it's technically a failure, let's make it overly obvious what it means), CAS failure, add() failure, replace() failure,

Some of this should be covered in the API reference, but this bug is specifically for a single page where this information is aggregated that a customer/user could read about how to handle errors.

 Comments   
Comment by Brett Lawson [ 26/Sep/13 ]
This section exists within the existing documentation as of 1.1.5 under 'Using the APIs -> Error Handling'.
Comment by Brett Lawson [ 27/Sep/13 ]
I should add that the section was moved to a new block (used to be under its own section).
https://github.com/couchbaselabs/docs-ng/commit/e5942bbcc1c3414b4698799319beed18b41448de




[PCBC-195] Write the Getting Started with PHP on Linux section of the essentials guide Created: 04/Feb/13  Updated: 06/Sep/13  Resolved: 06/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: MC Brown (Inactive) Assignee: Michael Nitschinger
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Write the Getting started with PHP on Linux (Redhat and Debian) section of the Essentials Guide

Needs to cover:

Installation of the PHP Couchbase extensions and pre-requisites
Writing your first (small) app using Couchbase and PHP

Submissions should be to MC, either through the couchbase/docs repo, or direct to MC in whatever format suits. Must include both the text and images.

 Comments   
Comment by Matt Ingenthron [ 06/Sep/13 ]
We've deferred essentials guides indefinitely.




[PCBC-194] Write the Getting started with PHP on Mac OS X section of the essentials guide Created: 04/Feb/13  Updated: 18/Feb/13  Resolved: 18/Feb/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Task Priority: Major
Reporter: MC Brown (Inactive) Assignee: MC Brown (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Write the Getting started with PHP on Mac OS X section of the Essentials Guide

Needs to cover:

Installation of the PHP Couchbase extensions and pre-requisites
Writing your first (small) app using Couchbase and PHP

Submissions should be to MC, either through the couchbase/docs repo, or direct to MC in whatever format suits. Must include both the text and images.

 Comments   
Comment by Trond Norbye [ 04/Feb/13 ]
See http://trondn.blogspot.com/2013/02/accessing-couchbase-from-php-on-your-mac.html
Comment by MC Brown (Inactive) [ 18/Feb/13 ]
I've converted this information to a suitable XML fragment and added it to the Essentials Guide for PHP/Mac OS X. Thanks Trond.




[PCBC-193] Missing tag in github for 1.1.2 Created: 01/Feb/13  Updated: 15/Apr/13  Resolved: 15/Apr/13

Status: Closed
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.1.2
Security Level: Public

Type: Bug Priority: Minor
Reporter: James Mauss Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The current 1.1.2 release was never tagged in github. Prior releases up to 1.1.1 have all been tagged, but 1.1.2 is not tagged.

 Comments   
Comment by Matt Ingenthron [ 15/Apr/13 ]
Fixed some time ago: https://github.com/couchbase/php-ext-couchbase/tree/1.1.2




[PCBC-192] Persistent connections should be the default Created: 01/Feb/13  Updated: 25/Aug/13  Resolved: 14/Feb/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Mark Nunberg [ 04/Feb/13 ]
I don't think this is a good idea - we may end up "leaking" connections for other clients - or messing things up for clients which have randomized host lists.. (though for this, I guess we can have another fix - to make array lists containing the same hosts be made as the same key (for hashing purposes)) for persistent connections.

A better idea would be to make the persistent connection stuff enforcible by an INI config entry (so the code in the ctor doesn't need to change) - chances are such an option already exists - this would be a fairly sufficient workaround for some of the issues we've been seeing while not breaking code for those people who do not *want* these so-called persistent connections.




[PCBC-191] Segfault on malformed argument in setMulti() Created: 01/Feb/13  Updated: 02/Apr/13  Resolved: 02/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: 1.1.2
Fix Version/s: 1.1.4
Security Level: Public

Type: Bug Priority: Major
Reporter: Juan Simon Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Providing a malformed array as a parameter to setMulti() results in "Segmentation fault (core dumped)"

The issue can be replicated with the following script:
https://gist.github.com/8a08980573d47c22aecc#file-seg_fault-php

if instead of providing
$docs[]['TEST_DOC::' . $x] = '{"a" : 1}';
we provide the correct structure
$docs['TEST_DOC::' . $x] = '{"a" : 1}';

It works ok, but the first shouldn't segfault.



 Comments   
Comment by Trond Norbye [ 02/Apr/13 ]
http://review.couchbase.org/#/c/25432/




[PCBC-190] Need documentation on timeouts available for PHP Created: 29/Jan/13  Updated: 27/Sep/13  Resolved: 27/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Perry Krug Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
This link: http://www.couchbase.com/docs/couchbase-devguide-1.8/about-client-timeouts.html, states that there aren't any timeouts available for PHP

The PHP docs don't describe any.

However, I know that the underlying libcouchbase exposes at least one basic request timeout setting so either the PHP library needs some help exposing that, or it already does and we need to document it.

 Comments   
Comment by Matt Ingenthron [ 15/Apr/13 ]
Trond: Could you please review the existing documentation, recommend where we should put this information, then write up a draft and assign it back to me? Then I can review and get it over to Karen.

Let's try to do this one very soon.
Comment by Trond Norbye [ 16/Apr/13 ]
    /**
     * Retrieve the current operation timeout.
     *
     * @return integer The currently used timeout specified in usec
     */
    function getTimeout() {

    }

    /**
     * Specify an operation timeout.
     *
     * The operation timeout is the time it takes from the command is sent
     * to the cluster and the result should be returned back.
     *
     * @param integer $timeout the new operation timeout specified in usec
     */
    function setTimeout($timeout) {

    }

The keyDurability methods have a timeout parameter, and the view have the connection_timeout parameter one may set.
Comment by Perry Krug [ 16/Apr/13 ]
Thanks Trond. A few more questions:

-This bug was specifically requested for PHP...can you provide documentation on how to exercise those timeouts through PHP?
-And is there a separate timeout associated with the initial connection to 8091?
-Is there any logic/handling of a case where the comet stream becomes un responsive but is not actually reset?
Comment by Matt Ingenthron [ 25/Sep/13 ]
Brett: with your recent docs work, you can probably work out what is best for this.
Comment by Brett Lawson [ 27/Sep/13 ]
Added section to documentation.
https://github.com/couchbaselabs/docs-ng/commit/e5942bbcc1c3414b4698799319beed18b41448de




[PCBC-189] [Better sample needed] Code sample of PHP Get and Lock Created: 28/Jan/13  Updated: 24/Apr/14  Resolved: 24/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Major
Reporter: Anonymous Assignee: Matt Ingenthron
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates PCBC-275 Create PHP Getting Started for 2.0 Resolved
is duplicated by PCBC-185 Create an example to show how to use ... Resolved

 Description   
One of our users asked for a code example demonstrating Get and Lock in PHP for the Developer Guide.

 Comments   
Comment by Matt Ingenthron [ 28/Jan/13 ]
A code sample can be found here:
https://github.com/couchbase/php-ext-couchbase/blob/master/tests/Get.inc#L301

The description says in the developer guide? Do you want this there or in the API reference? In any event, I'm passing it back to you to update the appropriate document.
Comment by kzeller [ 29/Jan/13 ]
It was specifically asked for the Dev Guide, but if it makes more sense, I can just add the cross reference from there to the actual example in the PHP area.
Comment by kzeller [ 30/Jan/13 ]
Note to self, this is a test case with assertions vs. example of when to use in sample application.....
Comment by kzeller [ 26/Mar/13 ]
Dependancies/Blockers:

-Reviewed code with Technical Support (Perry)

-Need a better PHP Get and Lock code sample. Should demonstrate Get and Lock in sample application context.
-Need information on why get and lock suited for the context.
Comment by kzeller [ 26/Mar/13 ]
See blockers on sample and information.
Comment by Brett Lawson [ 24/Apr/14 ]
All important docs will be in the new getting started guide.




[PCBC-188] prioritized disk write queue - php client Created: 28/Jan/13  Updated: 02/Apr/13  Resolved: 02/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Alex Ma Assignee: Dipti Borkar
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
ability for the client to specify that a write should be prioritized and the server to fast track that write to disk ahead of whatever might be in the disk write queue. Especially important during the case of rebalance where they may be a million+ items in the queue and the write needs to be prioritized for whatever purpose.

 Comments   
Comment by Dipti Borkar [ 28/Jan/13 ]
Is this request only for the php client? This functionality needs to be available on the server side. Can you please move to MB?
Also, can you change from "bug" to "improvement"?
Comment by Trond Norbye [ 02/Apr/13 ]
There is no way this can be done in the PHP driver. It needs to be implemented on the server first




[PCBC-187] get() on a missing document should return false Created: 24/Jan/13  Updated: 14/Feb/13  Resolved: 14/Feb/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Brian Moon [ 24/Jan/13 ]
The de facto standard for operations in both PHP memcached clients is to return bool false on any failure. If you want to be consistent with those libs, you may want to check more than just get().
Comment by Trond Norbye [ 14/Feb/13 ]
I am going to write tests that verifies all of the return codes, but given that this is _the_ most common call we should get it in ASAP




[PCBC-186] Design document listing (Extends PCBC-85) Created: 23/Jan/13  Updated: 08/Apr/13  Resolved: 08/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.4
Security Level: Public

Type: Improvement Priority: Major
Reporter: Juan Simon Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Add listing capabilities to the current Design document management.


http://www.couchbase.com/issues/browse/PCBC-85

 Comments   
Comment by Trond Norbye [ 02/Apr/13 ]
http://review.couchbase.org/25441




[PCBC-185] Create an example to show how to use the getAndLock feature Created: 22/Jan/13  Updated: 24/Sep/13  Resolved: 24/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Major
Reporter: Tug Grall (Inactive) Assignee: Matt Ingenthron
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates PCBC-189 [Better sample needed] Code sample of... Resolved

 Description   
It will be useful for user to see how to use the getAndLock function in PHP here:
https://github.com/couchbase/php-ext-couchbase/tree/master/example

 Comments   
Comment by Tug Grall (Inactive) [ 22/Jan/13 ]
Coming from the community: http://www.couchbase.com/forums/thread/php-examples-code-getandlock-and-view




[PCBC-184] It would be nice to support the flags sections for the memcache extension Created: 22/Jan/13  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Simon Gavin [ 22/Jan/13 ]
I believe this is related to PCBC-180
Comment by Matt Ingenthron [ 15/Apr/13 ]
Trond is this related to PCBC-180? In other words, is this more than an improvement?
Comment by Trond Norbye [ 16/Apr/13 ]
The intention of this RFE is to fall back to try to use the flag values as specified in the memcache extension if we fail to deserialize with the currently used flag values.
Comment by Brett Lawson [ 13/Mar/14 ]
This behaviour is as closely matched as possible in 2.0.0-dp1, additionally, transcoders are available to allow specifying custom flag decoding.




[PCBC-183] Issues using the $callback parameter for get Created: 18/Jan/13  Updated: 18/Jan/13  Resolved: 18/Jan/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
This doesn't work as expected, and the test cases seems to skip this with a comment that there are issues... we should fix those..

 Comments   
Comment by Trond Norbye [ 18/Jan/13 ]
The callback signature looks like:

boolean function($resource, $id, &$val)





[PCBC-182] Update the documentation to show when a parameter is a copy or a reference Created: 17/Jan/13  Updated: 27/Sep/13  Resolved: 27/Sep/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0
Security Level: Public

Type: Bug Priority: Major
Reporter: Tug Grall (Inactive) Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
When I look at the PHP core documentation I see when a parameter is a reference or not. (so we should review all our function documentation)

For example if you look at:
http://www.php.net/sort

Not only I know the type but also when it is a reference it is mentionned as &$array

I think we should do the same in our documentation, when I see our API with cas, for example:
http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-retrieve-get.html#table-couchbase-sdk_php_get

it is not clear to me.



 Comments   
Comment by Trond Norbye [ 18/Jan/13 ]
As a workaround for now you should include couchbase-api.php in your project and have your IDE give you code completion ;)
Comment by Brett Lawson [ 26/Sep/13 ]
This information is now available through the API Reference which should be available shortly along with the updated documentation.




[PCBC-181] The documentation is wrong for get() in couchbase-api.php Created: 17/Jan/13  Updated: 18/Jan/13  Resolved: 18/Jan/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.1.3
Security Level: Public

Type: Bug Priority: Major
Reporter: Michael Nitschinger Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: MacOS X, PHP 5.4


 Description   
I just discovered this while fixing a bug in Basement.

The $cas variable callback is not working on get() but works on getMulti().

Simple example:

Works:
$client->set("foo", "bar");
$cas = null;
var_dump($client->getMulti(array("foo"), $cas));
var_dump($cas);

array(1) {
  ["foo"]=>
  string(3) "bar"
}
array(1) {
  ["foo"]=>
  string(20) "11699665754086047744"
}

Doesn't work:
$client->set("foo", "bar");
$cas = null;
var_dump($client->get("foo", $cas));
var_dump($cas);

string(3) "bar"
NULL

The doc gets returned properly, but the cas value is not set. Also, when you set $cas to "" or false (not null), then it complains with a dubios error:
Warning: Couchbase::get() expects parameter 2 to be a valid callback, no array or string given in /Users/michael/Webserver/basement-test/index.php on line 10
Note that its a warning and not an exception on the OOP interface!


 Comments   
Comment by Michael Nitschinger [ 17/Jan/13 ]
Okay after more investigation of course the notation is:

get(key, callback, cas)

then only the documentation needs to be updated here:

https://github.com/couchbase/php-ext-couchbase/blob/master/example/couchbase-api.php#L320
Comment by Trond Norbye [ 18/Jan/13 ]
http://review.couchbase.org/#/c/24053/




[PCBC-180] PHP Warning: Couchbase::get() could not decompress value (bad content) Created: 17/Jan/13  Updated: 26/Aug/13  Resolved: 26/Aug/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.1
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Critical
Reporter: Andrey Nikishaev Assignee: Trond Norbye
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: CentOS 5.6
Linux CentOS-56-64-minimal 2.6.18-308.16.1.el5 #1 SMP Tue Oct 2 22:01:43 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
PHP 5.2.17
Coucbase 1.8


 Description   
Forum thread with bug history
http://www.couchbase.com/forums/thread/php-warning-couchbaseget-could-not-decompress-value-bad-content

 Comments   
Comment by Trond Norbye [ 16/Apr/13 ]
Could you post some code sample I could use to reproduce the error? What kind of data are you storing, do you encode them in any special way etc?
Comment by Trond Norbye [ 26/Aug/13 ]
Its been open since 16th of April without more information




[PCBC-179] Couchbase PHP client library v1.1.1 returns random integer on get request Created: 09/Jan/13  Updated: 13/Mar/14  Resolved: 13/Mar/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.1
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Bug Priority: Major
Reporter: Andrey Nikishaev Assignee: Brett Lawson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: CentOS 5.6
Linux CentOS-56-64-minimal 2.6.18-308.16.1.el5 #1 SMP Tue Oct 2 22:01:43 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
PHP 5.2.17
Coucbase 1.8


 Description   
Forum thread with bug history
http://www.couchbase.com/forums/thread/couchbase-php-client-library-v1-1-1-returns-random-integer-get-request


 Comments   
Comment by Andrey Nikishaev [ 17/Jan/13 ]
if before broken get request make another request to non-existing key, then all be fine. this is hot fix for those who also has such problem.
Comment by Brett Lawson [ 27/Sep/13 ]
Do we have any information on how the value is being stored in the bucket? Is it being encoded with JSON before storage, igbinary or a raw value?
Comment by Brett Lawson [ 13/Mar/14 ]
As of 2.0.0-dp1, get calls will now return a 'MetaDoc' object as per the 2.0.0 spec.




[PCBC-178] Add support for 'connection_timeout' option in views Created: 03/Jan/13  Updated: 05/Apr/13  Resolved: 05/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.1.4
Security Level: Public

Type: Bug Priority: Major
Reporter: Mark Nunberg Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The "connection_timeout" parameter is not supported currently in the code. This is a simple addition of
{ "connection_timeout", num_param_handler }, in the handlers list.

Ideally the option handling code should be largely removed from PHP and migrated towards libcouchbase (there are pending commits to this effect) which would allow greater effectiveness in coercing and recognizing view options.

 Comments   
Comment by Trond Norbye [ 02/Apr/13 ]
http://review.couchbase.org/25439




[PCBC-177] inconsistent parameter setup for createBucket and modifyBucket Created: 02/Jan/13  Updated: 03/Jan/13  Resolved: 03/Jan/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.3
Security Level: Public

Type: Bug Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
There is an inconsistency between the ZEND macros and the implementation

 Comments   
Comment by Trond Norbye [ 02/Jan/13 ]
http://review.couchbase.org/#/c/23636/2
Comment by Matt Ingenthron [ 02/Jan/13 ]
Can you add some additional detail. I can understand that there may be a bug in the macros, but the underlying change looks like we're just changing the API. I'm still confused by this one. Sorry to be slow.
Comment by Trond Norbye [ 03/Jan/13 ]
The macros say we take multiple parameters, but the implementation takes two where the first one is the name, the second is the properties




[PCBC-176] move .[ch] files to src Created: 01/Jan/13  Updated: 08/Mar/13  Resolved: 08/Mar/13

Status: Closed
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Matt Ingenthron
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The toplevel directory is getting pretty crowded and its hard to locate files.. Its easier to navigate through the stuff if they're all located in a separate directory.

 Comments   
Comment by Trond Norbye [ 08/Mar/13 ]
Seems to be hard to make it work on windows... we could leave just "one" of the files in the directory to work around the windows problems, but let's do that on a day when we don't have any better things to do...




[PCBC-175] released bundle should contain the example php ini file and the couchbase api file Created: 01/Jan/13  Updated: 03/Jan/13  Resolved: 03/Jan/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1.3
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Comments   
Comment by Trond Norbye [ 01/Jan/13 ]
http://review.couchbase.org/#/c/23645/1




[PCBC-174] Create a php file with "javadoc-style" comments describing the api Created: 31/Dec/12  Updated: 03/Jan/13  Resolved: 03/Jan/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.2
Fix Version/s: 1.1.3
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
This allows users to add it to their IDE and get code completion and help (at least in NetBeans)




[PCBC-173] The php extension should have an example .ini file describing the tunables Created: 31/Dec/12  Updated: 18/Jan/13  Resolved: 18/Jan/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.1
Fix Version/s: 1.1.3
Security Level: Public

Type: Improvement Priority: Major
Reporter: Trond Norbye Assignee: Trond Norbye
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
It is easier for people to edit a template than writing their own file ;)

 Comments   
Comment by Trond Norbye [ 31/Dec/12 ]
http://review.couchbase.org/#/c/23634/




[PCBC-172] Document how to create a views from PHP Code Created: 30/Dec/12  Updated: 02/Apr/13  Resolved: 02/Apr/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.2
Fix Version/s: 1.1.4
Security Level: Public

Type: Improvement Priority: Major
Reporter: Tug Grall (Inactive) Assignee: Trond Norbye
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The latest PHP Library allows developer to create views from code.
We need to document this:
- in the tutorial
- in the API Method list : http://www.couchbase.com/docs/couchbase-sdk-php-1.1/api-reference-summary.html

 Comments   
Comment by Trond Norbye [ 01/Jan/13 ]
It is part of http://review.couchbase.org/#/c/23641/
Comment by Tug Grall (Inactive) [ 22/Jan/13 ]
We should also add this to https://github.com/couchbase/php-ext-couchbase/tree/master/example
Comment by Trond Norbye [ 02/Apr/13 ]
http://review.couchbase.org/#/c/25436/




[PCBC-171] Package build scripts don't build source correctly Created: 27/Dec/12  Updated: 24/Apr/14  Resolved: 24/Apr/14

Status: Resolved
Project: Couchbase PHP client library
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.0-dp1
Security Level: Public

Type: Bug Priority: Major
Reporter: Matt Ingenthron Assignee: Matt Ingenthron
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The prefix is missing the trailing slash, so the source packages are prefixed incorrectly.

 Comments   
Comment by Matt Ingenthron [ 25/Sep/13 ]
With the move to pecl, this is no longer as important as it once was.
Comment by Trond Norbye [ 25/Sep/13 ]
my opinion is that we should drop it entirely....




[PCBC-170] Document error code, etc. Created: 19/Dec/12  Updated: 30/Jan/13  Resolved: 30/Jan/13

Status: Resolved
Project: Couchbase PHP client library
Component/s: docs
Affects Version/s: 1.1.1
Fix Version/s: None
Security Level: Public

Type: Improvement Priority: Major
Reporter: Tim Smith (Inactive) Assignee: MC Brown (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Someone asked me: "Do you, by any chance know where I can find out what the error code will be if we try to get something that doesn't exist? It used to be Memcached::RES_NOTFOUND"

After searching our docs, my answer was:

https://github.com/couchbase/php-ext-couchbase/blob/master/tests/Errors.inc

Please add this info to the API reference for PHP.

 Comments   
Comment by Tim Smith (Inactive) [ 19/Dec/12 ]
See related bug PCBC-165 "Docs have return type scalar ( Binary object ), which doesn't help much". Return type and error code are related, and both need to be exhaustively documented, but they're not exactly the same thing.

Thanks!
Comment by MC Brown (Inactive) [ 30/Jan/13 ]
I've updated the PHP documentation and tables to be more precise about the information/data return from each call, the possible exceptions raised during the process, and I've provided a list of the error codes for PHP responses. There is some further work to do to ensure the links between the elements are complete, and I should be completing that shortly.




[PCBC-169] PHP 5.2 w/ 1.1.1 client doesn't connect to "default" bucket, named bucket works OK Created: 18/Dec/12  Updated: 03/Jan/13  Resolved: 03/Jan/13

Status: Closed
Project: Couchbase PHP client library
Component/s: library
Affects Version/s: 1.1.1
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Major
Reporter: Tim Smith (Inactive) Assignee: Matt Ingenthron
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: CentOS 5.8, PHP 5.2.17 binary from jason repo, libcouchbase 2.0.1 and friends, libevent 1.4.13, php-ext-couchbase built from git master branch (git pull; git clean -fdx; phpize; ./configure; cp modules/couchbase.so /usr/lib64/php/modules/)


 Description   
A simple test program fails when accessing the default bucket, but works OK when using a different bucket with either no password or a set password.

Telnet localhost 11211 and using get and set works OK.

Sample program is:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Couchbase Server PHP Test</title>
</head>
<body>

<p>
<?php

$cb = new Couchbase("127.0.0.1:8091", "Administrator", "password", "default");
$cb->set("a", "OSDIFOISJDFOIJ");

echo("The value for 'a' is: ");
var_dump($cb->get("a"));

?>
</p>
</body>
</html>

Changing "default" to "xyz" works (both are Couchbase buckets on the same cluster).


Failure looks like:

# php cb2.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Couchbase Server PHP Test</title>
</head>
<body>

<p>
PHP Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with message 'Failed to store value to server: Network error' in /usr/share/nginx/html/cb2.php:13
Stack trace:
#0 /usr/share/nginx/html/cb2.php(13): Couchbase->set('a', 'OSDIFOISJDFOIJ')
#1 {main}
  thrown in /usr/share/nginx/html/cb2.php on line 13


[root@localhost html]# strace php cb2.php
execve("/usr/bin/php", ["php", "cb2.php"], [/* 22 vars */]) = 0
brk(0) = 0x1ab3f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2afb80cc6000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2afb80cc7000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=71066, ...}) = 0
mmap(NULL, 71066, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2afb80cc8000
close(3) = 0
open("/lib64/libcrypt.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\t\240=1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=48600, ...}) = 0
mmap(0x313da00000, 2322880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x313da00000
mprotect(0x313da09000, 2093056, PROT_NONE) = 0
mmap(0x313dc08000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x8000) = 0x313dc08000
mmap(0x313dc0a000, 184768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x313dc0a000
close(3) = 0
open("/usr/lib64/libreadline.so.5", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\2209\201.1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=247544, ...}) = 0
mmap(0x312e800000, 2345400, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x312e800000
mprotect(0x312e835000, 2093056, PROT_NONE) = 0
mmap(0x312ea34000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x34000) = 0x312ea34000
mmap(0x312ea3c000, 2488, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x312ea3c000
close(3) = 0
open("/usr/lib64/libncurses.so.5", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\375\341?1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=380336, ...}) = 0
mmap(0x313fe00000, 2476872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x313fe00000
mprotect(0x313fe4e000, 2097152, PROT_NONE) = 0
mmap(0x314004e000, 57344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4e000) = 0x314004e000
mmap(0x314005c000, 2888, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x314005c000
close(3) = 0
open("/usr/lib64/libgmp.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pr\340:1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=236392, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2afb80cda000
mmap(0x313ae00000, 2329440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x313ae00000
mprotect(0x313ae38000, 2097152, PROT_NONE) = 0
mmap(0x313b038000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x38000) = 0x313b038000
close(3) = 0
open("/usr/lib64/libcurl.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \260\34061\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=252456, ...}) = 0
mmap(0x3136e00000, 2345576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3136e00000
mprotect(0x3136e3b000, 2097152, PROT_NONE) = 0
mmap(0x313703b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3b000) = 0x313703b000
close(3) = 0
open("/usr/lib64/libbz2.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\26\240A1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=67792, ...}) = 0
mmap(0x3141a00000, 2160784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3141a00000
mprotect(0x3141a0f000, 2093056, PROT_NONE) = 0
mmap(0x3141c0e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe000) = 0x3141c0e000
close(3) = 0
open("/lib64/libz.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\36\300-1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=85544, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2afb80cdb000
mmap(0x312dc00000, 2178544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x312dc00000
mprotect(0x312dc14000, 2093056, PROT_NONE) = 0
mmap(0x312de13000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x312de13000
close(3) = 0
open("/lib64/libpcre.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\35@.1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=129984, ...}) = 0
mmap(0x312e400000, 2222984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x312e400000
mprotect(0x312e41e000, 2097152, PROT_NONE) = 0
mmap(0x312e61e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e000) = 0x312e61e000
close(3) = 0
open("/lib64/librt.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \"@.1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=53448, ...}) = 0
mmap(0x312e400000, 2132936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2afb80cdc000
mprotect(0x2afb80ce3000, 2097152, PROT_NONE) = 0
mmap(0x2afb80ee3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x2afb80ee3000
close(3) = 0
open("/lib64/libresolv.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0203\24051\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=92816, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2afb80ee5000
mmap(0x3135a00000, 2181896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3135a00000
mprotect(0x3135a11000, 2097152, PROT_NONE) = 0
mmap(0x3135c11000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x11000) = 0x3135c11000
mmap(0x3135c13000, 6920, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3135c13000
close(3) = 0
open("/lib64/libm.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`>@-1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=614992, ...}) = 0
mmap(0x312d400000, 2629816, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x312d400000
mprotect(0x312d482000, 2093056, PROT_NONE) = 0
mmap(0x312d681000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x81000) = 0x312d681000
close(3) = 0
open("/lib64/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\16\200-1\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=23360, ...}) = 0
mmap(0x312d800000, 2109696, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x312d800000
mprotect(0x312d802000, 2097152, PROT_NONE) = 0
mmap(0x312da02000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x312da02000
close(3) = 0
open("/lib64/libnsl.so.1", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240@`51\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=114352, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2afb80ee6000
mmap(0x3135600000, 2194096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3135600000
mprotect(0x3135615000, 2093056, PROT_NONE) = 0
mmap(0x3135814000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x3135814000
mmap(0x3135816000, 6832, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3135816000
close(3) = 0
open("/usr/lib64/libxml2.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\262\24271\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1297360, ...}) = 0
mmap(0x3137a00000, 3395512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3137a00000
mprotect(0x3137b34000, 2093056, PROT_NONE) = 0
mmap(0x3137d33000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x133000) = 0x3137d33000
mmap(0x3137d3c000, 4024, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3137d3c000
close(3) = 0
open("/usr/lib64/libgssapi_krb5.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\222\34071\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=190976, ...}) = 0
mmap(0x3137e00000, 2283888, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3137e00000
mprotect(0x3137e2c000, 2097152, PROT_NONE) = 0
mmap(0x313802c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2c000) = 0x313802c000
close(3) = 0
open("/usr/lib64/libkrb5.so.3", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\222!71\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=613928, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2afb80ee7000
mmap(0x3137200000, 2706656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3137200000
mprotect(0x3137291000, 2097152, PROT_NONE) = 0
mmap(0x3137491000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x91000) = 0x3137491000
close(3) = 0
open("/usr/lib64/libk5crypto.so.3&qu