Google-cloud-php: [Spanner] Running spanner emulator causes UNAUTHENTICATED error

Created on 17 Mar 2021  路  11Comments  路  Source: googleapis/google-cloud-php

When I try to connect to the Spanner emulator, I get the following error.

Fatal error: Uncaught Google\Cloud\Core\Exception\ServiceException: {
    "message": "Established channel does not have a sufficient security level to transfer call credential.",
    "code": 16,
    "status": "UNAUTHENTICATED",
    "details": []
} in /app/vendor/google/cloud-core/src/GrpcRequestWrapper.php:257
Stack trace:
#0 /app/vendor/google/cloud-core/src/GrpcRequestWrapper.php(146): Google\Cloud\Core\GrpcRequestWrapper->convertToGoogleException(Object(Google\ApiCore\ApiException))
#1 /app/vendor/google/cloud-core/src/GrpcTrait.php(79): Google\Cloud\Core\GrpcRequestWrapper->send(Array, Array, Array)
#2 /app/vendor/google/cloud-spanner/src/Connection/Grpc.php(301): Google\Cloud\Spanner\Connection\Grpc->send(Array, Array)
#3 /app/vendor/google/cloud-spanner/src/Instance.php(264): Google\Cloud\Spanner\Connection\Grpc->getInstance(Array)
#4 /app/vendor/google/cloud-spanner/src/Instance.php(230): Google\Cloud\Spanner\Instance->reload(Array)
#5 /app/test.php(11): Google\Cloud\Spanner\Instance->exists()
#6 {main}
  thrown in /app/vendor/google/cloud-core/src/GrpcRequestWrapper.php on line 257

This only happens with grpc v1.36.
Grpc v1.35 does not have this issue.

Environment details

  • OS: Debian
  • PHP version: 7.4
  • Package name and version: grpc v1.36

Steps to reproduce

I've created a simple sample code to reproduce the error below.

https://github.com/taka-oyama/grpc-bug-test

spanner p2 bug

Most helpful comment

@taka-oyama we fixed by downgrading grpc to version 1.35.0

sudo pecl uninstall grpc
sudo pecl install grpc-1.35.0

All 11 comments

@AVaksman would you or someone in your team be able to please take a look?

Not an isolated case. Same issue here after we upgraded our ubuntu containers

@taka-oyama we fixed by downgrading grpc to version 1.35.0

sudo pecl uninstall grpc
sudo pecl install grpc-1.35.0

I noticed cloud-spanner v1.36 included https://github.com/googleapis/google-cloud-php/pull/3912.
I upgraded to 1.36 and retried the test but I'm still seeing the same error.
Was this suppose to fix the issue?
Is there something that needs to be done on the client side?

@taka-oyama unfortunately the latest Spanner release will not fix the problem. The underlying issue is in gRPC v1.36. @larkee filed an issue in the gRPC repo (https://github.com/grpc/grpc/issues/25810). I pinged the issue just now as well.

@AVaksman this issue is meant to be fixed against gRPC v1.37. Could you please confirm by upgrading the version locally just to confirm that the customer can upgrade their gRPC version to get the fix?

@skuruppu I upgrade to version 1.37.0 of gRPC:

sudo pecl uninstall grpc
sudo pecl install grpc-1.37.0
pecl list
Installed packages, channel pecl.php.net:
=========================================
Package Version State
grpc    1.37.0  stable

However I still get the error mentioned in this ticket when running the emulator with PHP.

@gsouf I'm so sorry. I didn't type in the minor version number in my comment earlier :(

Would you please be able to try installing grpc-1.37.1?

@skuruppu it seems to work well with version 1.37.1 thanks 馃憤馃徑

@taka-oyama would you also be able to confirm if the issue is fixed on your side if you update to grpc-1.37.1?

@skuruppu I was able to confirm that it works with 1.37.1.
Thank you! I will close the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smalot picture smalot  路  6Comments

lorenzosfarra picture lorenzosfarra  路  7Comments

mjniuz picture mjniuz  路  6Comments

ammopt picture ammopt  路  6Comments

ghost picture ghost  路  8Comments