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

Error getting view results on non-default bucket

    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

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

        Activity

        Hide
        daschl Michael Nitschinger added a comment -

        This is definitely an issue, should be fixed when this commit gets pushed through http://review.couchbase.com/#change,19250

        Show
        daschl Michael Nitschinger added a comment - This is definitely an issue, should be fixed when this commit gets pushed through http://review.couchbase.com/#change,19250
        Hide
        ingenthr Matt Ingenthron added a comment -

        Mark: Please determine if this issue is still valid and help me triage it into the appropriate release. I've assigned it to you for triage, not necessarily to fix it.

        Show
        ingenthr Matt Ingenthron added a comment - Mark: Please determine if this issue is still valid and help me triage it into the appropriate release. I've assigned it to you for triage, not necessarily to fix it.
        Hide
        mnunberg Mark Nunberg added a comment -

        Works for me.

        <?php
        $cb = new Couchbase("10.0.0.99",
        "Administrator",
        "123456",
        "beer-sample");

        $res = $cb->view("beer", "brewery_beers",
        array("limit" => "10"));

        var_dump($res);

        – perhaps he shouldn't be using _design there.

        Show
        mnunberg Mark Nunberg added a comment - Works for me. <?php $cb = new Couchbase("10.0.0.99", "Administrator", "123456", "beer-sample"); $res = $cb->view("beer", "brewery_beers", array("limit" => "10")); var_dump($res); – perhaps he shouldn't be using _design there.

          People

          • Assignee:
            mnunberg Mark Nunberg
            Reporter:
            perry Perry Krug
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes