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

searchStream pagination after support for page size was removed #1073

Open
sanpaku72 opened this issue Feb 17, 2025 · 1 comment
Open

searchStream pagination after support for page size was removed #1073

sanpaku72 opened this issue Feb 17, 2025 · 1 comment
Labels
bug Something isn't working triage Need triage

Comments

@sanpaku72
Copy link

Your client library and Google Ads API versions:

  • Client library version: v25.0.0
  • Google Ads API version: V18

Your environment:

  • The PHP version: 8.1.17

Description of the bug:
searchStream followed by iterateAllElements produces a memory error "Allowed memory size of xxx bytes exhausted" if the result is large, because of lacking pagination.

Steps to reproduce:

    $stream = $this->googleAdsClient->getGoogleAdsServiceClient()->searchStream(
		SearchGoogleAdsStreamRequest::build(env('GOOGLE_CUSTOMER_ID'),
		"SELECT campaign.resource_name, campaign.name, campaign.status "
			. "FROM campaign ")
	);
    foreach ($stream->iterateAllElements() as $row) {

Expected behavior:
No memory error, or some mechanism to paginate results.

Request/Response Logs:

This is also mentioned in https://groups.google.com/g/adwords-api/c/kBZ9CBk9AWQ/m/wLU2Gq6uAAAJ?utm_medium=email&utm_source=footer
Using next_page_token wil not help in this case, as you want less results per time not more results over time.

@sanpaku72 sanpaku72 added bug Something isn't working triage Need triage labels Feb 17, 2025
@fiboknacky
Copy link
Member

Could you share your customer ID and login-customer-id with us via googleadsapi-support@google.com? Ensure to mention this GitHub issue so the agent there can pass the information to me to take a closer look. Thanks.

In the meantime, could you please share what gRPC and protobuf versions are you using?

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

2 participants