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

Between Date call failing #105

Closed
charlesastwood opened this issue Jun 4, 2019 · 13 comments
Closed

Between Date call failing #105

charlesastwood opened this issue Jun 4, 2019 · 13 comments
Assignees

Comments

@charlesastwood
Copy link

My calls to the API using custom date ranges have started to fail with an error:

In GPBUtil.php line 182:
Expect float.                 

I am formatting them as shown here: https://developers.google.com/google-ads/api/docs/query/date-ranges

If I use a date range such as LAST_7_DAYS it works fine.

Non-working example:

SELECT ad_group.id, campaign.id, search_term_view.search_term, search_term_view.ad_group, search_term_view.status, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.ctr, metrics.average_position, metrics.conversions, metrics.conversions_value FROM search_term_view  WHERE segments.date BETWEEN '2019-03-28' AND '2019-06-04'  AND ad_group.id = 123456789 AND metrics.impressions > 5  ORDER BY metrics.impressions DESC  LIMIT 300

Working example:

SELECT ad_group.id, campaign.id, search_term_view.search_term, search_term_view.ad_group, search_term_view.status, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.ctr, metrics.average_position, metrics.conversions, metrics.conversions_value FROM search_term_view  WHERE segments.date DURING LAST_7_DAYS AND ad_group.id = 123456789 AND metrics.impressions > 5  ORDER BY metrics.impressions DESC  LIMIT 300
@fiboknacky
Copy link
Member

Could you provide the customer ID as well please?

Best,
Knack

@charlesastwood
Copy link
Author

4452602168

@fiboknacky
Copy link
Member

@PierrickVoulet Could you try replicating this issue?

@charlesastwood
Copy link
Author

This is the latest 1.3 version btw

@charlesastwood
Copy link
Author

Also FYI, if I revert back to 1.1 it works again

@PierrickVoulet
Copy link
Collaborator

Thanks @charlesastwood for the complete information, I will try reproducing ASAP.

@PierrickVoulet
Copy link
Collaborator

Alright, I did a few tests and here is what I found:

  • The error does not occur when there is 0 results returned
  • The following error occurs when there is a non-empty result and this regardless of if I use LAST_7_DAYS or BETWEEN '2019-03-28' AND '2019-06-04' in the query

Fatal error: Uncaught Exception: Expect float. in /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php:182
Stack trace:
#0 /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(61): Google\Protobuf\Internal\GPBUtil::checkDouble(Object(Google\Protobuf\DoubleValue))
#1 /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1009): Google\Protobuf\DoubleValue->setValue(Object(Google\Protobuf\DoubleValue))
#2 /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(79): Google\Protobuf\Internal\Message->mergeFromArray(Array)
#3 /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(38): Google\Protobuf\Internal\Message->__construct(Array)
#4 /google-ads-php/src/Google/Ads/GoogleAds/V1/Common/Metrics.php(3960): Google\Protobuf\DoubleValue->__construct(Array)
#5 /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(489): Google\Ads\GoogleAds\V1\Common\Metrics->setConversionsValue(Object(Go in /google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php on line 182

  • The error disappears when I remove metrics.conversions and metrics.conversions_value from the SELECT clause of the query

The error is likely related to a fix done in 1.2 and 1.3 releases. Before we move forward with more digging in this direction, could you:

  • Confirm that the trace I get is the same as the one you are experiencing, especially the root cause setConversionsValue
  • Confirm that you get the same error with 1.2 and 1.3

@charlesastwood
Copy link
Author

1.2 works fine. 1.3 is when the error is kicking in.

I tested taking out metrics.conversions and metrics.conversions_value from the SQL and this did help. I then did get an error:

Call to a member function getValue() on null

This was due to the code

$metrics->getConversions()->getValue()

That now doesn't seem to have a getValue() function?

The trace for the 1.3 call with the metrics in is:

#0 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(61): Google\Protobuf\Internal\GPBUtil::checkDouble(Object(Google\Protobuf\DoubleValue))
#1 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1009): Google\Protobuf\DoubleValue->setValue(Object(Google\Protobuf\DoubleValue))
#2 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(79): Google\Protobuf\Internal\Message->mergeFromArray(Array)
#3 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(38): Google\Protobuf\Internal\Message->__construct(Array)
#4 /var/www/symfony/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V1/Common/Metrics.php(3960): Google\Protobuf\DoubleValue->__construct(Array)
#5 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(489): Google\Ads\GoogleAds\V1\Common\Metrics->setConversionsValue(Object(Google\Protobuf\DoubleValue))
#6 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(760): Google\Protobuf\Internal\Message->parseFieldFromStream(562, Object(Google\Protobuf\Internal\CodedInputStream), Object(Google\Protobuf\Internal\FieldDescriptor))
#7 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php(289): Google\Protobuf\Internal\Message->parseFromStream(Object(Google\Protobuf\Internal\CodedInputStream))
#8 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(384): Google\Protobuf\Internal\GPBWire::readMessage(Object(Google\Protobuf\Internal\CodedInputStream), Object(Google\Ads\GoogleAds\V1\Common\Metrics))
#9 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(464): Google\Protobuf\Internal\Message::parseFieldFromStreamNoTag(Object(Google\Protobuf\Internal\CodedInputStream), Object(Google\Protobuf\Internal\FieldDescriptor), Object(Google\Ads\GoogleAds
\V1\Common\Metrics))
#10 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(760): Google\Protobuf\Internal\Message->parseFieldFromStream(34, Object(Google\Protobuf\Internal\CodedInputStream), Object(Google\Protobuf\Internal\FieldDescriptor))
#11 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBWire.php(289): Google\Protobuf\Internal\Message->parseFromStream(Object(Google\Protobuf\Internal\CodedInputStream))
#12 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(384): Google\Protobuf\Internal\GPBWire::readMessage(Object(Google\Protobuf\Internal\CodedInputStream), Object(Google\Ads\GoogleAds\V1\Services\GoogleAdsRow))
#13 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(464): Google\Protobuf\Internal\Message::parseFieldFromStreamNoTag(Object(Google\Protobuf\Internal\CodedInputStream), Object(Google\Protobuf\Internal\FieldDescriptor), Object(Google\Ads\GoogleAd
s\V1\Services\GoogleAdsRow))
#14 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(760): Google\Protobuf\Internal\Message->parseFieldFromStream(10, Object(Google\Protobuf\Internal\CodedInputStream), Object(Google\Protobuf\Internal\FieldDescriptor))
#15 /var/www/symfony/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(724): Google\Protobuf\Internal\Message->parseFromStream(Object(Google\Protobuf\Internal\CodedInputStream))
#16 /var/www/symfony/vendor/grpc/grpc/src/lib/AbstractCall.php(147): Google\Protobuf\Internal\Message->mergeFromString('\n\xBD\x02\x121\n(customer...')
#17 /var/www/symfony/vendor/grpc/grpc/src/lib/UnaryCall.php(71): Grpc\AbstractCall->_deserializeResponse('\n\xBD\x02\x121\n(customer...')
#18 /var/www/symfony/vendor/google/gax/src/Transport/Grpc/ForwardingUnaryCall.php(49): Grpc\UnaryCall->wait()
#19 /var/www/symfony/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V1/GoogleAdsLoggingUnaryCall.php(53): Google\ApiCore\Transport\Grpc\ForwardingUnaryCall->wait()
#20 /var/www/symfony/vendor/google/gax/src/Transport/GrpcTransport.php(242): Google\Ads\GoogleAds\Lib\V1\GoogleAdsLoggingUnaryCall->wait()
#21 /var/www/symfony/vendor/guzzlehttp/promises/src/Promise.php(246): Google\ApiCore\Transport\GrpcTransport->Google\ApiCore\Transport\{closure}(true)
#22 /var/www/symfony/vendor/guzzlehttp/promises/src/Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#23 /var/www/symfony/vendor/guzzlehttp/promises/src/Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#24 /var/www/symfony/vendor/guzzlehttp/promises/src/Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#25 /var/www/symfony/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#26 /var/www/symfony/vendor/google/gax/src/GapicClientTrait.php(591): GuzzleHttp\Promise\Promise->wait()
#27 /var/www/symfony/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V1/Services/Gapic/GoogleAdsServiceGapicClient.php(268): Google\Ads\GoogleAds\V1\Services\Gapic\GoogleAdsServiceGapicClient->getPagedListResponse('Search', Array, 'Google\\Ads\\Goog...', Object(Google\
Ads\GoogleAds\V1\Services\SearchGoogleAdsRequest))
#28 /var/www/symfony/src/Services/Google/Ads/Reports/GetSearchTerms.php(56): Google\Ads\GoogleAds\V1\Services\Gapic\GoogleAdsServiceGapicClient->search('4364489357', 'SELECT ad_group...', Array)

@Raibaz
Copy link
Contributor

Raibaz commented Jun 5, 2019

This is being caused by #92.

We're currently working on a fix for it, please bear with us.

@charlesastwood
Copy link
Author

#92 I think is the problem I am facing with $metrics->getConversions()->getValue() but is this also the cause for the

In GPBUtil.php line 182:
Expect float.

when calling the SQL

@PierrickVoulet
Copy link
Collaborator

Yes, getters and setters are both impacted by the issue #92 and as @Raibaz said we are currently working on a long term fix.

I would recommend to downgrade to 1.2 for the time being if possible on your side.

@Raibaz
Copy link
Contributor

Raibaz commented Jul 1, 2019

This should have been fixed by V2.0.0.

@Raibaz
Copy link
Contributor

Raibaz commented Jul 4, 2019

Closing this due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants