try with
new CouchbaseCluster('couchbase://stage.arcpoint.group.com')
try with
new CouchbaseCluster('couchbase://stage.arcpoint.group.com')
Notice my app code does this:
$cluster = new CouchbaseCluster('http://stage.arcpointgroup.com:8091'); $this->Couchbase = $cluster->openBucket('myBucket', '<password>'); print_r($cluster); die();
And I get this as the output (notice the objectās bucket name does not match the one I tried to open):
CouchbaseCluster Object (
[_manager:CouchbaseCluster:private] =>
[_dsn:CouchbaseCluster:private] => Array
(
[scheme] => http
[hosts] => Array
(
[0] => Array
(
[0] => stage.arcpointgroup.com
[1] => 8091
)
)
[bucket] => default
[options] => Array
(
)
)
[authenticator:CouchbaseCluster:private] => )
Thatās not working either (500 in the browser). Also, I assume you meant couchbase://stage.arcpointgroup.com (thereās no dot between āpointā and āgroupā).
Side question that might be related⦠does the default bucket need to be installed? Because I did not set that up when I instantiated my server.
You donāt need to have the default
bucket, but you do need to have the bucket youāre trying to connect to defined.
We have a small utility that weāve written for testing connectivity in situations like this. Itās not ready for wide use yet, but Iām wondering, can you run it with the same connection string youāre using in the PHP client and see if it identifies any problems @kevin?
The tool is called SDK Doctor, and there should be a binary for your platform. The output should be easy to interpret, but if you have questions please post it to a gist/pastebin and then point @brett19 and I to it.
you should put it into PHP code, not into the browser. And also try the doctor binary, it would help to diagnose the problem.
Just ran:
> sdk-doctor-linux diagnose couchbase://stage.arcpointgroup.com/arc
Received the following output:
http://pastebin.com/iEf6x5nA
Ok a little more info now. Iāve managed to get the SDK Doctor to connect successfully to my bucket (just needed to supply credentials properly):
And I have a PHP script that I can run from the command line that is also working.
The same exact code within my PHP application, however, still does not work:
LCB_ECONNREFUSED: The remote host refused the connection. Is the service up? Error: An Internal Error Has Occurred.
So there must be an issue with my PHP configuration. See attached image for what my phpinfo() looks like for Couchbase (libcouchbase seems to be OK).
Any ideas? I appreciate all the quick and very helpful responses so far!
To verify no trouble at the libcouchbase layer, you could use something like cbc-get
, which would use lcb directly without the PHP extension. Iām slightly stumped as to what would prevent the connection though.
If this were windows, Iād think of application level firewalling-- where Windows security extensions sometimes block apps from connecting to particular ports. Your sdk-doctor output indicates itās linux.
When you say āPHP applicationā, do you mean running under php-fpm, apache? I think to diagnose the next level Iād do one of two things. One is use strace on the process to look at attempted connections, so you can see the syscall return to the process. Another one that may be easier is look at a tcpdump of Couchbase ports (or use wireshark-- it understands Couchbaseās protocols).
Unfortunately, I donāt think we can diagnose this any further with logging at the SDK, unless @mnunberg or @brett19 have an idea. When our code gets connection refused from the OS, I donāt think itāll indicate why.
Yes. Calling the PHP code via the browser (thus invoking the Apache server) gives me the error I posted earlier.
Where would I find cbc-get?
Can you provide specifics? Apache2 may be most common, but there are options even there. Maybe thatāll trigger a thought on the cause.
On the cbc tools, they are installed as part of the ābinā package, so if you install that per the instructions, you should have the cbc binary on your machine. The docs also have an overview on how to use cbc.
Thank you very much, ingenthr for your thorough assistance with this issue. It turned out to be an application-specific issue on my end with how I was handling the CB connection within the appās data layer. Iām still trying to work out why exactly, but since itās app specific thereās no need to trouble you guys with it anymore. I can confirm that my PHP SDK is working for me correctly both via command line and via Apache server as PHP-FPM.
Glad to hear itās working now!