Lib event error with C SDK & PHP


#1

I am trying to test a couchbase connection in php v5.5 with the 2.0.7 cb sdk. I am getting the following out put when I run the code below. The server I am trying to connect to is remote and I do not have the the cb server app installed on this machine. I do have the C Lib for CB. It appears to be something with my dev system. The error is happening on CentOS 6.4 but not on CentOS 6.5. Any additional info on this libev error or ways to go about troubleshooting it further is appreciated.

Error messages:

[warn] event_pending: event has no event_base set.
[warn] event_add: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_add: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
Generic error

Code:

<?php
$cb = new CouchbaseCluster('couchbase://ip.add.re.ss', 'user', 'pass');
try{

    $b = $cb->openBucket('default');
}
catch( CouchbaseException $e){
    print $e->getMessage();
}

libevent packages:

# yum list | grep libevent
libcouchbase2-libevent.x86_64              2.5.0-1.el6                  @couchbase
libevent.x86_64                            1.4.13-4.el6                 @base
libevent-last.x86_64                       2.0.21-4.el6.remi            installed
libevent.i686                              1.4.13-4.el6                 base
libevent-devel.i686                        1.4.13-4.el6                 base
libevent-devel.x86_64                      1.4.13-4.el6                 base
libevent-doc.noarch                        1.4.13-4.el6                 base
libevent-headers.noarch                    1.4.13-4.el6                 base

#2

You seem to have multiple versions of libevent. You can bypass using libevent entirely by setting LCB_IOPS_PLUGIN=select (to use the select-based plugin) in the environment.


#3

Also ensure that you are not forking the process and using the library in both parent and child. Is this little snippet all that’s causing the issue?


#4

v2.0.7 for the PHP SDK, as stated in phpinfo(). I followed the current couchbase docs and the given perl script for the base C SDK packages - so everything should be latest version.

Could you provide more info on the LCB_IOPS_PLUGIN=select method?

Yes, I believe this no event_base set is the only issue.

I see that on my CentOS 6.5 machine I am missing libevent-last.x86_64 2.0.21-4.el6.remi installed so this could be what is causing the issue.


#5

Yep, that would seem to be the issue. Regarding LCB_IOPS_PLUGIN; for example…

mnunberg@mbp15 ~ $ LCB_IOPS_NAME=select cbc version
cbc:
  Runtime: Version=2.5.0, Changeset=4195258f5a1b47dc9151329d94ce04c91c9afee6
  Headers: Version=2.5.0, Changeset=4195258f5a1b47dc9151329d94ce04c91c9afee6
  IO: Default=libevent, Current=select
  SSL: .. SUPPORTED

(Apparently it’s LCB_IOPS_NAME)


#6

Thank you very much for your help and instant responses. I removed the package libevent-last.x86_64 2.0.21-4.el6.remi installed and had to reinstall a few php libraries that we removed along with it.

Now, everything works!

-Carter