Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.1.0-dp2
-
Fix Version/s: None
-
Component/s: library
-
Security Level: Public
-
Labels:None
Description
Customer setup non-default bucket, created view and published to production.
The view is:
function (doc) {
//Check for dataCount, do not include it
if(doc.value != null)
emit(doc.sensorId, [doc.value, doc.timestamp]);
}
When querying with this:
$this->_CouchbaseHandle = new Couchbase($this->_Config->couchbase->host.":8091", $this->_Config->couchbase->user, $this->_Config->couchbase->password, $this->_Config->couchbase->bucket);
$result = $this->_CouchbaseHandle->view("_design/Sensors", "getSensorById");
foreach($result["rows"] as $row) {
echo $row->key;
}
The following error is returned:
Warning: Couchbase::view(): Failed to execute view: Protocol error in /var/domains/wesley.sensor-api.xanedo.com/library/Xanedo/Couchbase.php on line 87
Warning: Invalid argument supplied for foreach() in /var/domains/wesley.sensor-api.xanedo.com/library/Xanedo/Couchbase.php on line 88
-------------------------------------------------------
I was able to reproduce this in-house with similar setup. Using var_dump, the $result comes back as bool(false).
_all_docs works correctly, any production or development view does not seem to work according to these instructions: http://www.couchbase.com/develop/php/next
The view is:
function (doc) {
//Check for dataCount, do not include it
if(doc.value != null)
emit(doc.sensorId, [doc.value, doc.timestamp]);
}
When querying with this:
$this->_CouchbaseHandle = new Couchbase($this->_Config->couchbase->host.":8091", $this->_Config->couchbase->user, $this->_Config->couchbase->password, $this->_Config->couchbase->bucket);
$result = $this->_CouchbaseHandle->view("_design/Sensors", "getSensorById");
foreach($result["rows"] as $row) {
echo $row->key;
}
The following error is returned:
Warning: Couchbase::view(): Failed to execute view: Protocol error in /var/domains/wesley.sensor-api.xanedo.com/library/Xanedo/Couchbase.php on line 87
Warning: Invalid argument supplied for foreach() in /var/domains/wesley.sensor-api.xanedo.com/library/Xanedo/Couchbase.php on line 88
-------------------------------------------------------
I was able to reproduce this in-house with similar setup. Using var_dump, the $result comes back as bool(false).
_all_docs works correctly, any production or development view does not seem to work according to these instructions: http://www.couchbase.com/develop/php/next