Closed mjainavas closed 6 months ago
If you've not made any changes to your code, it's likely that it's caused by the recent unintentional breaking change of google/gax
. Could you please run composer update
to update it to the latest version?
Yes, I run the
composer require googleads/google-ads-php:21.1
and
composer update googleads/google-ads-php
Do you want me to upgrade google/gax
version also?
If yes then what would be the competible version with 21.1
I have tried again by
composer require google/gax
and
composer require googleads/google-ads-php:22.0
but getting same issue:
Modules\ADS\Services\Google\Contracts\SpendsPerAccount::get 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.v15.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": "DOLQJqNSm09UQJPhBPp7ow" } ] }'.
Could you share your google/gax
version too?
Yes, its
"google/gax": "^1.26",
Could you tell the exact version that is installed in your project? (You can see that in composer.lock
file)
I ask because 1.26.2
will have this bug fixed, but 1.26.1
will not.
In composer.lock
file It looks like this,
But in my project I installed it additionally by
composer require google/gax:1.26.3
Also I have updated the composer by composer update
But still getting same error. Any Idea to run with v15 as my existing API code calling v13 which is going to sunset on 30th January. and I wanted to upgrade it to v15
Another way to quickly check this is, in the vendor
directory, do you see the change like in this PR?
And I know you haven't changed anything, but just to be sure, what's the customer ID you want to access, and did you try regenerating a refresh token using the Google account that can access that customer?
Yes I can see the Code in GAX directory.
} else {
// Ads is using this method in their new surface clients, so we need to call it.
// However, this method is not used anywhere else for the new surface clients
// @TODO: Remove this in GAX V2
$this->modifyClientOptions($options);
}
And customeID and other details I can share with you via email or slack if we can connect over there. It's strange that if all things are perfect then why I am getting same error again and again.
Could you please post on the Google Ads API forum first? There will be a function Reply privately to author where we can exchange files that are more sensitive like credentials. Once you do it, please let me know the link to that forum so I can take over there. Thanks!
And I know you haven't changed anything, but just to be sure, what's the customer ID you want to access, and did you try regenerating a refresh token using the Google account that can access that customer?
BTW, did you try above too?
Wonder if there is a resolution to this as I have exactly the same problem, all worked fine for years until I bumped the ads lib version above "^19.0.0"
Environment: docker image FROM php:8.0-apache
The most recent working combination is composer version "^19.0.0" targeting API Version V14
I've checked all the higher versions of the composer library and they all fail with this error:
"The caller does not have permission"
I'm using a service account, impersonating an email, Implementation below: (as mentioned this all works fine until updating to "googleads/google-ads-php": "^20.0" or above. (I've had to revert to 19 for now).
@DorsetDevStudio There are a couple of factors that can possibly affect this. When you mentioned, your code has worked for years, what client library version and the Google Ads API version you've been using?
@fiboknacky Hi, I have used many versions as you'd expect, given the release schedule.
Library version "^19.0.0" with API Version V14 being the highest version that still works, all older versions work too.
Library version 20 and above do not work.
Thanks. Stuart
So, it sounds like after upgrading to v15, your request starts to fail. The changes that would be related to the permission thing is in the Account Management section. Is there any item that may be applied to your case?
The bug of google/gax
is fixed in v1.26.2
, but I see you already upgraded to v1.26.3
, so that shouldn't be a problem anymore.
Could you please post on the Google Ads API forum first? There will be a function Reply privately to author where you can send me a request and response log. Please include a link to this GitHub issue and mention that the PHP client library owner ask you to send your information. Thanks.
Yes, I posted over there already but no solution at all.
@mjainavas Did you mention the link to this GitHub issue? And what's your post? Could you share it here too?
@fiboknacky Yes Here it is:
https://groups.google.com/g/adwords-api/c/dQTWw4PDxRk/m/jzc5DrgGBgAJ
https://groups.google.com/g/adwords-api/c/sA2CBGayJdU/m/M04GD1a5AQAJ
https://groups.google.com/g/adwords-api/c/tOjoRIUPWLQ/m/q_rOnVM_AAAJ
But all of the responses I got there is automated, Still not able to figure out why it is not working.
So far I am using 19.2 version as it is supporting v14 API call which is ok till May2024 but For future usecase I wanted to upgrade it till v15.
@mjainavas
Thanks for your information. I checked those posts and the log you shared (request id 6BZqXXXXXXXX) and found that you sent a request with login-customer-id
to be the same as your customer_id
(it's 7108xxxxxx) to GoogleAdsService, correct?
Could you try sending a request to v14 and share us the request and response logs in the same post? To the best of my knowledge, I'm not aware of anything that changes the specification of the request in v15, so I need to compare the results between two versions.
If possible, please share the whole request and response logs too. Thanks.
Closing due to inactivity.
I had the same error, and nothing proposed seemed to work. All packages where up to date: googleads/google-ads-php:22.0 google/gax:1.27
the solution was removing: ->withLinkedCustomerId while building the client
which was either unnecessary/redundant or used wrongly on my end, and the api started complaining starting with version 15.
Closing due to inactivity.
So you fixed it then ?
I had the same error, and nothing proposed seemed to work. All packages where up to date: googleads/google-ads-php:22.0 google/gax:1.27
the solution was removing: ->withLinkedCustomerId while building the client
which was either unnecessary/redundant or used wrongly on my end, and the api started complaining starting with version 15.
will try this.
I had the same error, and nothing proposed seemed to work. All packages where up to date: googleads/google-ads-php:22.0 google/gax:1.27
the solution was removing: ->withLinkedCustomerId while building the client
which was either unnecessary/redundant or used wrongly on my end, and the api started complaining starting with version 15.
THIS WORKS, thank you, just commented out this line and it started working again. Thank you.
Which version of the client library are you using? 21.1.0
Which version of PHP are you using? PHP-FPM 8.2
Which operating system (Linux, Windows, ...)? CentOS
Issue is happening with me too, as things are working normal to get spent per account but after upgrading API to V15 via, composer require googleads/google-ads-php:21.1 then I started getting this issue.
Wondering , how it can get fix, or what changes I need to make, I have gone through the documents https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid
any Idea what to do next?
I am using https://github.com/googleads/google-ads-php and upgraded it on 21.1
Thanks