Google longrunning operation can't map binding to any Uri template

一世执手 提交于 2019-12-11 07:38:43

问题


I attempt to implement this example https://cloud.google.com/vision/docs/pdf#vision-pdf-detection-gcs-php to get some information form a .pdf file but i get this error when the scritp make a "long polling operation" while the script wait gooogle response

I attempt to get some information form a scanned pdf

This is the error showed in console

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

The code in my script is the same as in example Thanks


回答1:


After contact a Gooogle support opend a issue on gitHub project and soon the bug will be solved. This is the issue link:

https://github.com/googleapis/google-cloud-php/issues/1863



来源:https://stackoverflow.com/questions/55903626/google-longrunning-operation-cant-map-binding-to-any-uri-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!