googleapis / gax-php

Google API Extensions for PHP
http://googleapis.github.io/gax-php/
BSD 3-Clause "New" or "Revised" License
234 stars 50 forks source link

GAX Error - Could not construct ApplicationDefaultCredentials #340

Closed SubaKrishnan closed 2 years ago

SubaKrishnan commented 3 years ago

Environment details

Steps to reproduce

Upgrading google-ads-php from version 6 to version 11, shouts Error.

Error

Google\ApiCore\ValidationException
  Could not construct ApplicationDefaultCredentials From gax

Previously I'm using google-ads-php v6.0.0. I got error as Version v6 is deprecated. Therefore, I updraged to the current version v11.0.0 where I'm getting Error from gax.

Help me to sort this issue. Thanks in advance

hkdevandla commented 2 years ago

@noahdietz , can you please triage this? Thanks!

noahdietz commented 2 years ago

@pierrickvoulet could you help us triage what has changed between v6 and v11 of the google-ads-php library?

PierrickVoulet commented 2 years ago

@noahdietz The only related change that I can find is that we bumped the minimal version of gax-php from ^1.5.0 to ^1.7.0. We did not change anything in the authentication logic as far as I know.

@SubaKrishnan Do you know by any chance what versions of gax-php you were using before upgrading google-ads-php to 11.0.0 and after upgrading?

noahdietz commented 2 years ago

Thanks @PierrickVoulet that helps.

Do you know by any chance what versions of gax-php you were using before upgrading google-ads-php to 11.0.0 and after upgrading?

@SubaKrishnan can you answer this?

SubaKrishnan commented 2 years ago

Sorry for the delay, Earlier I used gax-php V1.6 After Updating to v1.7 I received this error.

I fixed this issue. In Laravel Application, $clientOptions variable which passes the credentials doesn't return any value. Because Oauth hadn't been recognized properly in AppServiceProvider. Now, It works fine.

Thanks guys

noahdietz commented 2 years ago

@SubaKrishnan so there is no bug and I can close this?

If there is an issue can you share more details like dependency versions, stack traces, etc. thanks.

SubaKrishnan commented 2 years ago

Sure..Thanks for your time