You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any Client API (for example PubSub) can not work with emulator without grpc extension.
When we put in clientConfig 'emulatorHost' & 'hasEmulator' keys (PubSub client set it when exist PUBSUB_EMULATOR_HOST env)
then it config passing to RequestHandler constructor and using here
And without any conditions code try build array config with call \Grpc\ChannelCredentials::createInsecure() which part of GRPC extension.
In result:
Fatal error: Uncaught Error: Class "Grpc\ChannelCredentials" not found in /app/vendor/google/cloud-core/src/EmulatorTrait.php:44
Stack trace:
#0 /app/vendor/google/cloud-core/src/RequestHandler.php(72): Google\Cloud\Core\RequestHandler->emulatorGapicConfig('pubsub:8681')
#1 /app/vendor/google/cloud-pubsub/src/PubSubClient.php(215): Google\Cloud\Core\RequestHandler->__construct(Object(Google\ApiCore\Serializer), Array, Array)
Another (maybe related) issue when try avoid Fatal error with stub class & method for ChannelCredentials and put in config ['transport' => 'resr']
then I got different error:
In CurlFactory.php line 210:
[GuzzleHttp\Exception\ConnectException]
cURL error 35: OpenSSL/3.1.4: error:0A00010B:SSL routines::wrong version nu
mber (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://p
ubsub:8681/v1/projects/emulator-project/topics/local.esbNew:publish?%24alt=
json%3Benum-encoding%3Dint
Because client by some reason choose HTTPS schema instead of HTTP and emulator don't work with SSL...
Yes with gRPC extension it is worked properly.
But if google/cloud-pubsub v2.x and others (which depends on new EmulatorTrait) not works with emulators via http protocol - then it is major breaking changes?
Maybe this should reflect in changelog & documentation?
(BTW: in our case we can not use grpc extension in PHP because it conflict with swoole / openswoole extension)
No, because the emulators have never worked with REST, only with gRPC. To confirm this, I checked out v0.233.0 (which is the same as google/cloud-pubsub:v1.51.1, the last release before 2.0), and used composer install --prefer-lowest, and received the same error you have here. So AFAICT, REST has never worked in the emulator... there does not seem to be any regression here.
We could open this as a feature request against gcloud, but otherwise this is out of our (the client library team's) hands.
Hi
Any Client API (for example PubSub) can not work with emulator without grpc extension.
When we put in clientConfig 'emulatorHost' & 'hasEmulator' keys (PubSub client set it when exist PUBSUB_EMULATOR_HOST env)
then it config passing to RequestHandler constructor and using here
google-cloud-php/Core/src/RequestHandler.php
Line 71 in 8574838
And there call
$this->emulatorGapicConfig
function which part of EmulatorTraithttps://github.com/googleapis/google-cloud-php/blob/main/Core/src/EmulatorTrait.php#L44
And without any conditions code try build array config with call
\Grpc\ChannelCredentials::createInsecure()
which part of GRPC extension.In result:
Another (maybe related) issue when try avoid Fatal error with stub class & method for ChannelCredentials and put in config
['transport' => 'resr']
then I got different error:
Because client by some reason choose HTTPS schema instead of HTTP and emulator don't work with SSL...
So this is bug?
Environment details
Steps to reproduce
Code example
The text was updated successfully, but these errors were encountered: