google-ads-php icon indicating copy to clipboard operation
google-ads-php copied to clipboard

V27.2.0 php8.4 Error: Maximum call stack size \CredentialsWrapper::getAuthorizationHeaderCallback()

Open DidierROY58 opened this issue 7 months ago • 4 comments

**Your client library and Google Ads API versions:

  • Client library version: v27.2.0
  • Google Ads API version: V19

Google\Ads\GoogleAds\Lib\V19\GoogleAdsClient

Description of the bug: Stack trace: #0 [internal function]: Google\ApiCore\CredentialsWrapper->{closure:Google\ApiCore\CredentialsWrapper::getAuthorizationHeaderCallback():244}() #1 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/grpc/grpc/src/lib/UnaryCall.php(43): Grpc\Call->startBatch() #2 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/grpc/grpc/src/lib/BaseStub.php(295): Grpc\UnaryCall->start() #3 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V19/GoogleAdsFailuresInterceptor.php(48): Grpc\BaseStub->{closure:Grpc\BaseStub::_GrpcUnaryUnary():273}() #4 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/grpc/grpc/src/lib/BaseStub.php(426): Google\Ads\GoogleAds\Lib\V19\GoogleAdsFailuresInterceptor->interceptUnaryUnary() #5 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V19/GoogleAdsLoggingInterceptor.php(60): Grpc\BaseStub->{closure:Grpc\BaseStub::_UnaryUnaryCallFactory():421}() #6 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/grpc/grpc/src/lib/BaseStub.php(426): Google\Ads\GoogleAds\Lib\V19\GoogleAdsLoggingInterceptor->interceptUnaryUnary() #7 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/grpc/grpc/src/lib/BaseStub.php(545): Grpc\BaseStub->{closure:Grpc\BaseStub::_UnaryUnaryCallFactory():421}() #8 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Transport/GrpcTransport.php(267): Grpc\BaseStub->_simpleRequest() #9 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/GapicClientTrait.php(664): Google\ApiCore\Transport\GrpcTransport->startUnaryCall() #10 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php(60): Google\Ads\GoogleAds\V19\Services\Client\GoogleAdsServiceClient->{closure:Google\ApiCore\GapicClientTrait::createCallStack():662}() #11 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(67): Google\ApiCore\Middleware\CredentialsWrapperMiddleware->__invoke() #12 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Middleware/RetryMiddleware.php(97): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke() #13 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Middleware/RequestAutoPopulationMiddleware.php(73): Google\ApiCore\Middleware\RetryMiddleware->__invoke() #14 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php(60): Google\ApiCore\Middleware\RequestAutoPopulationMiddleware->__invoke() #15 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Middleware/PagedMiddleware.php(65): Google\ApiCore\Middleware\OptionsFilterMiddleware->__invoke() #16 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(67): Google\ApiCore\Middleware\PagedMiddleware->__invoke() #17 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V19/UnaryGoogleAdsExceptionMiddleware.php(61): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke() #18 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V19/UnaryGoogleAdsResponseMetadataCallable.php(53): Google\Ads\GoogleAds\Lib\V19\UnaryGoogleAdsExceptionMiddleware->__invoke() #19 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/GapicClientTrait.php(856): Google\Ads\GoogleAds\Lib\V19\UnaryGoogleAdsResponseMetadataCallable->__invoke() #20 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/GapicClientTrait.php(813): Google\Ads\GoogleAds\V19\Services\Client\GoogleAdsServiceClient->getPagedListResponseAsync() #21 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/google/gax/src/GapicClientTrait.php(572): Google\Ads\GoogleAds\V19\Services\Client\GoogleAdsServiceClient->getPagedListResponse() #22 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/google-ads-php/V27/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V19/Services/Client/GoogleAdsServiceClient.php(1785): Google\Ads\GoogleAds\V19\Services\Client\GoogleAdsServiceClient->startApiCall() #23 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/googleads/bids/googleads_V2.php(226): Google\Ads\GoogleAds\V19\Services\Client\GoogleAdsServiceClient->search() #24 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/googleads/bids/googleads_V2.php(134): googleads_send_bids::get_geo_target_constant() #25 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/googleads/bids/googleads_send_bids_V2.php(235): googleads_send_bids::send_googleads_request() #26 /home/didier-roy/dmp_google_hotel_ads_campaign_service/legacy-bids/googleads/bids/crontab_googleads_send_bids_debug.php(28): googleads_send_bids::main()

Steps to reproduce:

Expected behavior:

Request/Response Logs: No request sent

Anything else we should know about your project / environment:

DidierROY58 avatar May 27 '25 09:05 DidierROY58

I am also experiencing the same issue:

Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infini
  te recursion?

~~I didn't have this issue with previous versions.~~

It seems that is a problem in previous versions and it seems that it's a issue related to the extension. The workaround is increase maximum stack size.

juanparati avatar Jun 02 '25 12:06 juanparati

Thank you for providing the workaround, juanparati. DidierROY58, did the workaround of increasing the maximum stack size work for you?

@juanparati So I get more context, you originally wrote you didn't have this issue with previous versions, but changed it, saying it seems that it's a issue related to the extension. So I can better investigate on my end, do you mean the 'grpc' dependency, the 'gax' dependency or something else?

Brothman avatar Jun 20 '25 13:06 Brothman

In previous versions I was also using different versions of the GRPC extension that may be the reason by I am not sure.

juanparati avatar Jun 20 '25 16:06 juanparati

Thank you for the lead about the GRPC extension being a possible culprit, I'll investigate it. I hope you have a wonderful weekend! :)

Brothman avatar Jun 20 '25 21:06 Brothman

I spoke with the GRPC team, and they let me know this is an issue they're aware of and actively working on.

They recommended a workaround of using setting the "grpc/grpc" dependency on line 9 of composer.json to 1.68.0.

The issue occurs after that version of GRPC.

In parallel, when we release the next version of the PHP client lib, we will pin the version of GRPC to 1.68.0 so no one else runs into this issue.

I'll keep this bug open until the GRPC team let us know this issue is resolved with future versions of the GRPC dependency.

Brothman avatar Jul 09 '25 17:07 Brothman

I did some experimentation, it turns out the most recent working version of the GRPC C extension was 1.66.0. In v30, we pinned the dependency, so you should not run into this Maximum call stack size error anymore. If you're running into this issue, you should upgrade to v30.0.0 AND do a clean dependency installation to ensure the new GRPC versions are picked up.

We are closing this issue now. Please follow issue 1095, which we will use as a tracking bug for updates when the underlying issue is fixed, so we can remove the pin on the GRPC C extension.

Brothman avatar Jul 21 '25 14:07 Brothman