Google-cloud-php: Google longrunning operation can't map binding to any Uri template

Created on 2 May 2019  路  2Comments  路  Source: googleapis/google-cloud-php

I attempt to implement this example https://cloud.google.com/vision/docs/pdf#vision-pdf-detection-gcs-php to read a text in a pdf but an error occurs in a long polling request

Environment details

  • WIndows 10 (64x) & Ubuntu 18.04.2 LTS:
  • PHP 7.2.5 (cli) (built: Apr 25 2018 02:39:21) ( ZTS MSVC15 (Visual C++ 2017) x86 ):
  • Package name and version:

    • google/cloud-vision: ^0.21.1

    • google/cloud-storage: ^1.12

Steps to reproduce

I have used the code in example without change anything

Error output

PS D:\www\google\Text_ORC> php pdf_detect.php
Make Request.
Waiting for operation to finish.
PHP Fatal error:  Uncaught Google\ApiCore\ValidationException: Could not map bindings for google.longrunning.Operations/GetOperation to any Uri template.
Bindings: Array
(
    [name] => projects/riconoscimento-bolletta/operations/192575c87c35529b
)
UriTemplates: Array
(
    [0] => /v1/{name=operations/*}
    [1] => /v1/{name=locations/*/operations/*}
)
 in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php:117
Stack trace:
#0 D:\www\google\Text_ORC\vendor\google\gax\src\Transport\RestTransport.php(109): Google\ApiCore\RequestBuilder->build('google.longrunn...', Object(Google\LongRunning\GetOperationRequest), Array)
#1 D:\www\google\Text_ORC\vendor\google\gax\src\GapicClientTrait.php(478): Google\ApiCore\Transport\RestTransport->startUnaryCall(Object(Google\ApiCore\Call), Array)
#2 D:\www\google\Text_ORC\vendor\google\gax\src\Middleware\CredentialsWrapperMiddleware.php(61): Google\ApiCore\LongRunning\Gapic\OperationsGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array)
#3 D:\www\google\Text_ORC\ in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php on line 117

Fatal error: Uncaught Google\ApiCore\ValidationException: Could not map bindings for google.longrunning.Operations/GetOperation to any Uri template.
Bindings: Array
(
    [name] => projects/riconoscimento-bolletta/operations/192575c87c35529b
)
UriTemplates: Array
(
    [0] => /v1/{name=operations/*}
    [1] => /v1/{name=locations/*/operations/*}
)
 in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php:117
Stack trace:
#0 D:\www\google\Text_ORC\vendor\google\gax\src\Transport\RestTransport.php(109): Google\ApiCore\RequestBuilder->build('google.longrunn...', Object(Google\LongRunning\GetOperationRequest), Array)
#1 D:\www\google\Text_ORC\vendor\google\gax\src\GapicClientTrait.php(478): Google\ApiCore\Transport\RestTransport->startUnaryCall(Object(Google\ApiCore\Call), Array)
#2 D:\www\google\Text_ORC\vendor\google\gax\src\Middleware\CredentialsWrapperMiddleware.php(61): Google\ApiCore\LongRunning\Gapic\OperationsGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array)
#3 D:\www\google\Text_ORC\ in D:\www\google\Text_ORC\vendor\google\gax\src\RequestBuilder.php on line 117

Another info

I have created also a question on stackOverflow : https://stackoverflow.com/questions/55903626/google-longrunning-operation-cant-map-binding-to-any-uri-template

Thanks!

vision p1 bug

All 2 comments

Thanks for the report @ElderTugBoat786, I've opened https://github.com/googleapis/google-cloud-php/pull/1864 to address this. It looks like the expected format of an operation name has changed, and we need to regenerate our client to pick up on it.

While we work on getting #1864 merged you should be able to install the gRPC extension and have the sample work properly, this issue will only come up when the library utilizes the REST API. We have some instructions on how to install gRPC here.

We've updated the client and the samples should be pulling in the correct dependency now. I think we're all set here. Thanks again @ElderTugBoat786

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joseflorido picture joseflorido  路  3Comments

highstrike picture highstrike  路  5Comments

codeflorist picture codeflorist  路  5Comments

tmatsuo picture tmatsuo  路  4Comments

castaneai picture castaneai  路  7Comments