Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogflow operations call throws ValidationException #2070

Closed
HarinJoshi25 opened this issue Jun 27, 2019 · 3 comments
Closed

Dialogflow operations call throws ValidationException #2070

HarinJoshi25 opened this issue Jun 27, 2019 · 3 comments
Assignees
Labels
api: dialogflow Issues related to the Dialogflow API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@HarinJoshi25
Copy link

This is the file i am running on my local to train my agent through php client library.
Following is the code that i am running on my local server:

<?php

require 'vendor/autoload.php';
use Google\Cloud\Dialogflow\V2\SessionsClient;
use Google\Cloud\Dialogflow\V2\AgentsClient;

function get_agent($projectId,$sessionId){

$test = array('credentials' => 'client-secret.json');
    $sessionsClient = new SessionsClient($test);
    $session = $sessionsClient->sessionName($projectId, $sessionId ?: uniqid());
    printf('Session path: %s' . PHP_EOL, $session);

$agentsClient = new AgentsClient();
try {
    $formattedParent = $agentsClient->projectName($projectId);
    $operationResponse = $agentsClient->trainAgent($formattedParent);
    $operationResponse->pollUntilComplete();
    if ($operationResponse->operationSucceeded()) {
        // operation succeeded and returns no value
        print("training successful!");
    } else {
        $error = $operationResponse->getError();
        handleError($error);
        print($error);
    }
    }
    finally {
    $agentsClient->close();
    }
}
get_agent('<<myprojectid>>','12346');

Here myprojectid is the project id of my agent on dialogflow which i am providing as an input.
following is the error that i am getting when i run this script:

PHP Fatal error: Uncaught Google\ApiCore\ValidationException: Failed to build request, as the provided path (google.longrunning.Operations/GetOperation) was not found in the configuration. in /home/mandar/composer/vendor/google/gax/src/RequestBuilder.php:80
Stack trace:
#0 /home/mandar/composer/vendor/google/gax/src/Transport/RestTransport.php(109): Google\ApiCore\RequestBuilder->build('google.longrunn...', Object(Google\LongRunning\GetOperationRequest), Array)
#1 /home/mandar/composer/vendor/google/gax/src/GapicClientTrait.php(479): Google\ApiCore\Transport\RestTransport->startUnaryCall(Object(Google\ApiCore\Call), Array)
#2 /home/mandar/composer/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php(61): Google\ApiCore\LongRunning\Gapic\OperationsGapicClient->Google\ApiCore{closure}(Object(Google\ApiCore\Call), Array)
#3 /home/mandar/composer/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(67): Google\ApiCore\Middleware\CredentialsWrapperMiddleware->__invoke(Object(Google\ApiCore\Call), Array)
#4 /hom in /home/mandar/composer/vendor/google/gax/src/RequestBuilder.php on line 80

@dwsupplee dwsupplee added the api: dialogflow Issues related to the Dialogflow API. label Jun 27, 2019
@dwsupplee dwsupplee changed the title validationException Dialogflow operations call throws ValidationException Jun 27, 2019
@dwsupplee dwsupplee added the status: investigating The issue is under investigation, which is determined to be non-trivial. label Jun 27, 2019
@dwsupplee
Copy link
Contributor

Thanks for the report @HarinJoshi25, we're taking a look.

@dwsupplee
Copy link
Contributor

It looks like the repository which hosts the configurations for building out our generated clients has an issue with information required for our REST based transport. We've gone ahead and opened a change to get this fixed internally - in the meantime you should be able to work around this by enabling the gRPC extension. I'll ping back here when the fix lands. Thanks again for the report!

@dwsupplee dwsupplee added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jul 3, 2019
@dwsupplee dwsupplee self-assigned this Jul 3, 2019
@dwsupplee dwsupplee removed the status: investigating The issue is under investigation, which is determined to be non-trivial. label Jul 3, 2019
@dwsupplee
Copy link
Contributor

@HarinJoshi25 a fix for this just landed in: #2102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dialogflow Issues related to the Dialogflow API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants