Closed mdworkin21 closed 7 months ago
Sorry for late response. So, have you figured out what implementation (PHP or C) your system is using based on https://developers.google.com/google-ads/api/docs/client-libs/php/protobuf?
Hey, thanks for getting back to me. I think it's the PHP implementation. When I run protoc --version
protoc is not installed. Are you aware of a better way to check?
Could you use my instructions shared above - https://developers.google.com/google-ads/api/docs/client-libs/php/protobuf#determine_which_implementation_is_being_used?
Ah, sorry missed that. Yeah ran it and empty response, so it would seem php.
I have checked vendor, and the file is there, along with the method.
If PHP, would you be able to find a way to debug that in your IDE or print out something in the files along the call stack to confirm that they're called like you think?
Ok, so I traced through the code in the vendor files, and found where the getRealContainingOneof
method is being called. It is being called in isSettingEmptyOneof
method in Google\Ads\GoogleAds\Util\FieldMasks
. I printed some things out to make sure that that line was indeed being hit, and it is.
One of the things I printed out was the $fieldDescriptor
that supposedly has the getRealContainingOneof
method on it. This gives me back a reference: Google\Protobuf\FieldDescriptor Object
. When I go into that file in my vendor folder, I and add some print statements to other methods (which I called from isSettingEmptyOneof
), those prints do not appear. So it seems like for some reason, this file is not being called.
Within the Google\Protobuf
directory, in addition to Google\Protobuf\FieldDescriptor
, there is also a Google\Protobuf\Internal\FieldDescriptor
file. This file does not have the getRealContainingOneof
method. However, I'm not sure this is being called either, since I did the same sort of test (print lines, call from FieldMasks) and nothing printed.
So I have no idea what Google\Protobuf\FieldDescriptor
is being called. I've been searching through vendor for conflicts, trying to see if this exists twice (for whatever reason), but as far as I can tell it doesn't.
Would it be possible for you to refresh your vendor/
like removing it and do composer install
again?
I've tried that a number of times, and unfortunately no change.
So, your protobuf is a latest version now? I ask because the version you mentioned above is 3.19.4
, which seems to be released around Jan 2022, whereas the support for getRealContainingOneOf
was added around June 2022 (which was later released).
Ah I see, we have an older version of the extension installed (3.19.4). I kept trying to update the proto library that composer uses. So if we update the extension, presumably the error should go away?
Yep. Upgrading it to any versions after June 2022 should work.
Closing due to inactivity.
Hey, sorry for the long delay, I was on parental leave and am still getting caught up. For those facing similar problems, upgrading the extension does seem to have made the error disappear.
I'm getting other errors for what I'm trying to do, but not the one discussed above : )
Your client library and Google Ads API versions:
Client library version:
21.0
Google Ads API version:
V15
Your environment:
PHP Version 8.1.26
Description of the bug:
I'm running into what seems like the same issue as https://github.com/googleads/google-ads-php/issues/891. I have followed the links and suggestions but have not been able to resolve the issue.(The issue was closed so I didn't know if I should post there, apologies for duplication if it was better to post in the other!)
The error:
Call to undefined method Google\Protobuf\FieldDescriptor::getRealContainingOneof() Code: 0
I have checked vendor, and the file is there, along with the method.
I've been trying to track down how I can tell if I have 2 protobufs running (a PHP and a C, and one is interfering with the other) but have not been able to tell.
Steps to reproduce:
This has been happening when I've tried to update a campaign to a new bidding type. The error occurs when I call setUpdateFieldMasks. Below is some of the code used to update campaigns
Expected behavior:
Request/Response Logs:
Anything else we should know about your project / environment: We're able to update campaigns when the updates are "simple", e.g., updating the status. When trying to update the bid strategy for a campaign, a few fields need to be updated at once, could this be part of the issue?