Операция Google longrunning не может привязать привязку к любому шаблону Uri - PullRequest
1 голос
/ 29 апреля 2019

Я пытаюсь реализовать этот пример https://cloud.google.com/vision/docs/pdf#vision-pdf-detection-gcs-php, чтобы получить некоторую информацию из файла .pdf, но я получаю эту ошибку, когда сценарий выполняет "длинную операцию опроса", пока скрипт ожидает ответа gooogle

Я пытаюсь получить некоторую информацию из отсканированного файла pdf

Эта ошибка отображается в консоли

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

Код в моем скрипте такой же, как в примере Спасибо

1 Ответ

1 голос
/ 02 мая 2019

После обращения в службу поддержки Gooogle откройте проблему в проекте gitHub, и вскоре ошибка будет решена. Это ссылка на проблему:

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

...