I’m maintainer for the Couchbase/Drupal 8 integration.
Recently on a deployment I found out that if the port used to run N1QL queries is blocked (8093) when you try to run a N1QL the call to $bucket->query() will return AN EMPTY ARRAY instead of throwing a timeout exception.
Steps to reproduce:
Build a simple PHP script that runs an N1QL query against a remote Couchbase Server (4.1) using the latest PHP SDK, such as this one:
$cluster = new \CouchbaseCluster(‘couchbase://127.0.0.1’);
$bucket = $cluster->openBucket(‘couch’, ‘couch’);
$query = \CouchbaseN1qlQuery::fromString(“SELECT COUNT(*) AS RESULT FROM couch WHERE event = ‘user.failed_login_ip’”);
$result = $bucket->query($query, array(), FALSE);
This will output:
Block port 8093 in the couchbase server.
Try to run the script, it will output:
The expected result is that an exception is thrown indicating that the the service is down or not reachable.