Client SDK: PHP
Error occurs when trying to retrieve documents from Couchbase server using PHP.
The error messages are as follow:
ShowError=
Failed to get a value from server: Generic network failure. Enable detailed error codes (via LCB_CNTL_DETAILED_ERRCODES, or via det ailed_errcodes
in the connection string) and/or enable logging to get more information
Any help would be appreciated, thanks!
Hey Peter,
As the error suggests, there has been a problem connecting to the Couchbase node, however this error is very generic and does not shed much light on the underlying problem here.
Instead you will want to enable the detailed error codes, this can be done in the PHP SDK as follows by altering your Cluster declaration string to resemble the following:
$cluster = new \CouchbaseCluster('http://127.0.0.1:8091?detailed_errcodes=1');
When your application fails to connect to the cluster it will show a more detailed error, such as:
CouchbaseException in CouchbaseBucket.class.php line 74: The remote host refused the connection. Is the service up?
Which indicates that Couchbase is likely not running on the node.
Let me know if you need any help interpreting the detailed error code that you receive.