Hi,
I installed pop os 19.10 today on a brand new latop and wanted to setup my usual laravel environment for one of my projects, however I ran into a segfault issue with the firestore library and I'm unsure if it's related to something that this library uses, php issue or Pop OS issue.
{
"require": {
"google/cloud-firestore": "^1.10"
}
}
<?php
require 'vendor/autoload.php';
use Google\Cloud\Firestore\FirestoreClient;
$firestore = new FirestoreClient([
'keyFilePath' => '/home/your-user/generate-firestore-keyfile.json'
]);
$collectionReference = $firestore->collection('users')->document('hello-world')->set(['name' => 'Test']);
var_dump($collectionReference);
Installed packages, channel pecl.php.net:
=========================================
Package Version State
grpc 1.26.0 stable
protobuf 3.11.2 stable
I've also tried this on 7.2 and 7.1 using the ondrej/php ppa repository and no luck, same error same code.
php -r "print_r(get_loaded_extensions());"
Array
(
[0] => Core
[1] => date
[2] => libxml
[3] => openssl
[4] => pcre
[5] => zlib
[6] => filter
[7] => hash
[8] => pcntl
[9] => Reflection
[10] => SPL
[11] => sodium
[12] => session
[13] => standard
[14] => grpc
[15] => protobuf
[16] => mysqlnd
[17] => PDO
[18] => xml
[19] => bcmath
[20] => calendar
[21] => ctype
[22] => curl
[23] => dom
[24] => mbstring
[25] => fileinfo
[26] => ftp
[27] => gettext
[28] => iconv
[29] => json
[30] => exif
[31] => mysqli
[32] => pdo_mysql
[33] => Phar
[34] => posix
[35] => readline
[36] => shmop
[37] => SimpleXML
[38] => sockets
[39] => sysvmsg
[40] => sysvsem
[41] => sysvshm
[42] => tokenizer
[43] => wddx
[44] => xmlreader
[45] => xmlwriter
[46] => xsl
[47] => zip
[48] => Zend OPcache
)
It's worth noting that I have a similar setup at home with Pop OS 19.04 and php 7.2 and I have absolutely no issues and the same goes for my MacBook which also runs on php 7.2 (Mojave) so I am not sure where the real issue is here.
Have you tried disabling the protobuf extension? gRPC is required, but the protobuf extension is optional. Give that a shot, may help us narrow down the source of the problem.
Just tried that, it seems to be working now, both the test file and on my laravel app which has a bunch of firestore calls.
Glad to hear that! Can you verify that the same versions of PHP, gRPC and protobuf running on your Macbook work without a segmentation fault? If so, it sounds as though there may be an issue specific to the protobuf extension and Pop OS. For that, we'll probably need to open an issue here so the protobuf team can take a look.
So my OSX runs on
grpc 1.22.1 stable
protobuf 3.9.1 stable
I did however downgrade both my protobuf and grpc version on PopOS to match OS X so this very much seems to be a protobuf issue. The same is true for the newest versions as this was tried on a colleagues laptop running Pop OS 18.04 LTS
If you'd like to proceed with this, please do open an issue with the protobuf team so that they can investigate potential OS conflicts with the extension. I'm happy we were able to help you work around the issues, though!
Most helpful comment
Have you tried disabling the protobuf extension? gRPC is required, but the protobuf extension is optional. Give that a shot, may help us narrow down the source of the problem.