This is using nginx and PHP FPM on MacOS 10.15.3 Catalina (my dev machine)
The PHP and CB specifics:
---- PHP Info ----
PHP:7.4.3
---- Couchbase Client Info ----
couchbase
couchbase support enabled
extension version 3.0.2
libcouchbase runtime version 3.0.0_18_gc3179958d4 (git: c3179958d4db71ee70243a1f8470edbf9e405f08)
libcouchbase headers version 3.0.0_18_gc3179958d4 (git: c3179958d4db71ee70243a1f8470edbf9e405f08)
zlib compressor enabled
Directive Local Value Master Value
couchbase.log_level WARN WARN
couchbase.encoder.format json json
couchbase.encoder.compression off off
couchbase.encoder.compression_threshold 0 0
couchbase.encoder.compression_factor 0.0 0.0
couchbase.decoder.json_arrays 0 0
couchbase.pool.max_idle_time_sec 60 60
I run the following block of code and get a SIGSEGV crash in my php-fpm logs on the $cluster->query line.
$connectionString = "couchbase://localhost";
$options = new \Couchbase\ClusterOptions();
$options->credentials("admin", "password");
$cluster = new \Couchbase\Cluster($connectionString, $options);
$query = 'SELECT x.* FROM `travel-sample` x WHERE x.`type`="hotel" LIMIT 10';
$opts = new QueryOptions();
$opts->scanConsistency(QueryScanConsistency::REQUEST_PLUS);
$res = $cluster->query($query, $opts); // This line causes SIGSEGV
dd($res); // this is a Laravel function "die and dump" - like var_dump except it also stops execution
KV operations ($collection->upsert(), $collection->get()) in the exact same environment function properly.
Hi, @jrlawhorne. Thanks for feedback. I’ve just tried to reproduce it on my mac, and it does not fail. The only difference is that I’ve used var_dump() as I don’t have laravel configured. Does it fail with var_dump($res); on your machine? Could you post stacktrace here?
To ask PHP-FPM for coredump you would need to add rlimit_core = unlimited into config, find a stacktrace somewhere in ~/Library/Logs/DiagnosticReports/php-fpm*.crash
After some tweaking, I got it to dump a core file but nothing showed up in the DiagnosticReports folder.
This doesn’t have much detail.
I did build the client and the PHP SDK from the GitHub source. I think I attempted the install process from the docs but it wouldn’t work for some reason. If you have the same environment and it doesn’t crash with the same code, it’s likely my installed libcouchbase or couchbase.so that I built locally.
If you have good install instructions for MacOS, please share. Thanks. I’d prefer to use the 3.x version if it’s stable for basic operations. If not, I’ll fall back to 2.6 on this project.
That change prevents the crash. I’ve got the build working for KV upsert and get via collection but having issues with N1QL - will post in a separate thread since it’s a separate issue.