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

Failed to build request, as the provided path (google.ads.googleads.v9.services.GoogleAdsService/SearchStream) was not found in the configuration #722

Closed
superlion28 opened this issue Jan 26, 2022 · 16 comments
Assignees
Labels
bug Something isn't working triage Need triage

Comments

@superlion28
Copy link

Library version 13.0.0
System Information
https://adwords.context-tramplin.ru/info.php

I filled in google_ads_php.ini, in the GetCampaigns.php example I entered
private const CUSTOMER_ID = ***; as int and run it

Fatal error: Uncaught Google\ApiCore\ValidationException: Failed to build request, as the provided path (google.ads.googleads.v9.services.GoogleAdsService/SearchStream) was not found in the configuration. in /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/RequestBuilder.php:81 Stack trace: #0 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/Transport/RestTransport.php(160): Google\ApiCore\RequestBuilder->build('google.ads.goog...', Object(Google\Ads\GoogleAds\V9\Services\SearchGoogleAdsStreamRequest)) #1 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/GapicClientTrait.php(608): Google\ApiCore\Transport\RestTransport->startServerStreamingCall(Object(Google\ApiCore\Call), Array) #2 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php(61): Google\Ads\GoogleAds\V9\Services\Gapic\GoogleAdsServiceGapicClient->Google\ApiCore{closure}(Object(Google\ApiCore\Call), Array) #3 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(66): Google\ApiCore\Middleware\CredentialsWrapperMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #4 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/Middleware/RetryMiddleware.php(85): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #5 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php(63): Google\ApiCore\Middleware\RetryMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #6 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(66): Google\ApiCore\Middleware\OptionsFilterMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #7 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/src/Google/Ads/GoogleAds/Lib/V9/ServerStreamingGoogleAdsExceptionMiddleware.php(61): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #8 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/src/Google/Ads/GoogleAds/Lib/V9/ServerStreamingGoogleAdsResponseMetadataCallable.php(40): Google\Ads\GoogleAds\Lib\V9\ServerStreamingGoogleAdsExceptionMiddleware->__invoke(Object(Google\ApiCore\Call), Array) #9 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/GapicClientTrait.php(583): Google\Ads\GoogleAds\Lib\V9\ServerStreamingGoogleAdsResponseMetadataCallable->__invoke(Object(Google\ApiCore\Call), Array) #10 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/src/Google/Ads/GoogleAds/V9/Services/Gapic/GoogleAdsServiceGapicClient.php(523): Google\Ads\GoogleAds\V9\Services\Gapic\GoogleAdsServiceGapicClient->startCall('SearchStream', 'Google\Ads\Goog...', Array, Object(Google\Ads\GoogleAds\V9\Services\SearchGoogleAdsStreamRequest), 3) #11 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/examples/BasicOperations/GetCampaigns.php(103): Google\Ads\GoogleAds\V9\Services\Gapic\GoogleAdsServiceGapicClient->searchStream(9418254929, 'SELECT campaign...') #12 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/examples/BasicOperations/GetCampaigns.php(60): Google\Ads\GoogleAds\Examples\BasicOperations\GetCampaigns::runExample(Object(Google\Ads\GoogleAds\Lib\V9\GoogleAdsClient), 9418254929) #13 /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/examples/BasicOperations/GetCampaigns.php(119): Google\Ads\GoogleAds\Examples\BasicOperations\GetCampaigns::main() #14 {main} thrown in /home/u38252/adwords.context-tramplin.ru/www/google-ads-php-main/vendor/google/gax/src/RequestBuilder.php on line 81

Help find the source of the problem

@superlion28 superlion28 added bug Something isn't working triage Need triage labels Jan 26, 2022
@fiboknacky
Copy link
Member

How did you install the library? Have you followed the instructions? If so, could you please also provide other info like the versions of PHP, gax-php, protobuf?

@fiboknacky fiboknacky self-assigned this Jan 26, 2022
@superlion28
Copy link
Author

I installed the library according to the instructions.
When starting composer, I had to enter
php composer.phar install --ignore-platform-reqs
I posted all the information about the system using your script here
https://adwords.context-tramplin.ru/info.php

PHP Extension grpc is not installed The PHP Extension protobuf is not installed

I'm buying a server and I can't install php-protobuf myself. Is it required in this case?

@superlion28
Copy link
Author

The old adwords api works without problems. Too bad you have to redo everything. The new api even run a problem. I hope you can tell me what else I need to do.

@superlion28
Copy link
Author

vendor/google/gax/VERSION -> 1.11.2

@PierrickVoulet
Copy link
Collaborator

PierrickVoulet commented Jan 26, 2022

Hi @superlion28 - It is currently impossible to use GoogleAdsService.SearchStream with REST. Could you either install grpc or use GoogleAdsService.Search?

@superlion28
Copy link
Author

Installing grpc now I ask you to make a support service. Can you please tell me in which file you need to replace the function?

@PierrickVoulet
Copy link
Collaborator

PierrickVoulet commented Jan 26, 2022

It is used in the GetCampaign example you are running, see here.

You would need to replace $googleAdsServiceClient->searchStream($customerId, $query); by $googleAdsServiceClient->search($customerId, $query); in this case.

If you install grpc, you will not need to make this change though.

@superlion28
Copy link
Author

Thank you. Until I got it

ApiException was thrown with message '{ "message": "Google Ads API has not been used in project 979966369712 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/googleads.googleapis.com/overview?project=979966369712 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.", "code": 7, "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com/google.rpc.Help", "links": [ { "description": "Google developers console API activation", "url": "https://console.developers.google.com/apis/api/googleads.googleapis.com/overview?project=979966369712" } ] }, { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "SERVICE_DISABLED", "domain": "googleapis.com", "metadata": { "service": "googleads.googleapis.com", "consumer": "projects/979966369712" } } ] }'.

I'll try to follow the link and include something

@superlion28
Copy link
Author

I want to ask right away, will the old API stop working if I turn it on?

@superlion28
Copy link
Author

Almost got it. Can you tell me what kind of access he needs? I have access to the client

ApiException was thrown with message '{ "message": "The caller does not have permission", "code": 7, "status": "PERMISSION_DENIED", "details": [ { "@type": "type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure", "errors": [ { "errorCode": { "authorizationError": "USER_PERMISSION_DENIED" }, "message": "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid" } ], "requestId": "4GSCPyVSbVADf_6gq-N9NA" } ] }'.

@superlion28
Copy link
Author

I think everything will turn out if you insert
customer id must be set in the 'login-customer-id' header
but can't find it in the library. Can you tell me where to enter it?

@superlion28
Copy link
Author

https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
I realized that I need to insert "login-customer-id" in the header, but I can't find where to do it

@PierrickVoulet
Copy link
Collaborator

The library builds the requests for you based on your configuration and request parameters.

Did you have the chance to follow the instructions Set up your OAuth2 credentials from the Getting Started section of the documentation yet?

@superlion28
Copy link
Author

If you have the adsapi_php.ini file you used for the AdWords API, copy and name it as google_ads_php.ini. Simply change the section name from [ADWORDS] to [GOOGLE_ADS].
Did so

@PierrickVoulet
Copy link
Collaborator

Here is an example of how you can specify the Login Customer ID from your configuration.

@superlion28
Copy link
Author

Thanks a lot. I got a list of campaigns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Need triage
Projects
None yet
Development

No branches or pull requests

3 participants