googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
288 stars 260 forks source link

Composer dependency google/auth v1.34.0 breaks the API requests #981

Closed bqader closed 8 months ago

bqader commented 8 months ago

Your client library and Google Ads API versions:

Your environment:

PHP 8.2.14 (cli) (built: Dec 21 2023 20:19:50) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.14, Copyright (c) Zend Technologies with Zend OPcache v8.2.14, Copyright (c), by Zend Technologies

OS: Linux 5.15.0-91-generic 101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 Protobuf: 3.25.1 GRPC: 1.60.0

Description of the bug:

If you run a composer update, 'google/auth' is updated to the last version v1.34.0 and it breaks the API requests. The developer token is not sent in the headers anymore resulting in this error:

Request

Method Name: /google.ads.googleads.v14.services.GoogleAdsService/SearchStream Host: googleads.googleapis.com Headers: { "x-goog-api-client": "gl-php\/8.2.14 gccl\/21.1.0 gapic\/21.1.0 gax\/1.26.1 grpc\/1.60.0 rest\/1.26.1 pb\/3.25.1+c", "User-Agent": "gcloud-php-new\/21.1.0", "x-goog-request-params": "customer_id=xxxxxxxxx" } Request: {"customerId":"xxxxxxxxx","query":"SELECT label.id, label.resource_name, label.name FROM label WHERE label.status != 'REMOVED' "}

Response

Headers: { "request-id": "tXNIz6CXQpnnHWN_yGqQfw", "date": "Tue, 09 Jan 2024 10:15:11 GMT", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" }

Fault

Status code: 3 Details: Request contains an invalid argument. Failure: {"errors":[{"errorCode":{"requestError":"DEVELOPER_TOKEN_PARAMETER_MISSING"},"message":"developer-token parameter is missing."}],"requestId":"tXNIz6CXQpnnHWN_yGqQfw"}

fiboknacky commented 8 months ago

I created https://github.com/googleapis/gax-php/issues/514 to follow up. Please stay tuned.

bshaffer commented 8 months ago

@fiboknacky @bqader I have submitted a fix here: https://github.com/googleapis/gax-php/pull/515 I'll comment again once the fix has been released

bshaffer commented 8 months ago

Fixed and released in https://github.com/googleapis/gax-php/releases/tag/v1.26.2

Please run composer update and you should have your problem resolved.

bqader commented 8 months ago

It works, thanks for the quick fix!

fiboknacky commented 8 months ago

Thanks for fixing this so fast @bshaffer