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
291 stars 260 forks source link

proto descriptor was previously loaded (included in multiple metadata bundles?) #540

Closed cgunnels closed 3 years ago

cgunnels commented 3 years ago

[DO NOT INCLUDE ANY PERSONAL OR SENSITIVE DATA - MAKE SURE TO REDACT CONTENT WHEN NECESSARY]

What versions of the client library and Google Ads API are you using? V5

What environment are you using? PHP 7.4 NGINX Laravel 5.8.38

Actions taken $googleAdsClient->getGoogleAdsServiceClient()->search($customerId, $query, $page_size);

Expected result To receive the result of the query

Actual result The Error

Anything else we should know about your project / environment Yes more details can be found at my stackoverflow question https://stackoverflow.com/questions/66355856/will-anyone-help-me-debug-proto-descriptor-was-previously-loaded-from-google-a

PierrickVoulet commented 3 years ago

Hi @cgunnels

This issue is logged since the version 3.15.0 of the Protobuf extension (see here). This is logged as a warning E_USER_WARNING so this should not make your API request fail. Is there anything that should be configured in your Laravel to avoid crashing due to warnings?

modernben commented 3 years ago

Having the same issue. Installed today.

Env vars APP_ENV=local APP_DEBUG=true

EDIT: I installed the protobuf C implementation. After switching to the PHP implementation, I was able to get it to work correctly.

AngieRd commented 3 years ago

I had the same issue but I was getting an "error exception" not a warning. The solution by @modernben worked for me too but it's a shame that we can't use the C implementation. Protobuf extension installed version: 3.15.5 grpc extension installed version: 1.35.0

ErrorException
proto descriptor was previously loaded (included in multiple metadata bundles?): google/ads/googleads/v6/enums/customer_match_upload_key_type.proto
cgunnels commented 3 years ago

Sorry I couldn't comment. Github was telling “You can’t comment at this time”. I had to figure that out first.

The fix: I had to install the c protobuf lib version 3.14.0.

cgunnels commented 3 years ago

I tried @modernben's solution, which worked, but was to slow. It literally took 20 times or more the time.

madsem commented 3 years ago

I have the same issue when trying to create an offline conversion goal in a manager account.

$response = $conversionActionServiceClient->mutateConversionActions(
                $this->client->getCustomerId(),
                [$conversionActionOperation]
            );

Protobuf C extension version: 3.15.6

Is there any way other than using the php implementation?! This api still feels beta tbh :( Lots of issues sadly

cgunnels commented 3 years ago

@AngieRd @madsem check out my answer to this issue on stackoverflow https://stackoverflow.com/a/66533574

chiragvels commented 3 years ago

I am still getting same with protobuf 3.15.7.

@PierrickVoulet / @cgunnels Can we make this issue open as this is not resolved yet?

Thanks,

PierrickVoulet commented 3 years ago

This is a duplicate of #500 which is still opened.

cgunnels commented 3 years ago

I'll open it as I didn't receive the warnings until v3.15. #500 is for v3.14. All I did was downgrade protobuf to v3.14 and it worked with no warnings.

leongersen commented 3 years ago

Could this receive another look? Suppressing/catching random user warnings that might come from anywhere (such as calling a constructor on any random resource) is very inconvenient, and these are promoted into exceptions by many default error handlers (such as in Symfony and, as in this case, in Laravel).

PierrickVoulet commented 3 years ago

It is prioritized but the fix is not trivial. We will keep everyone posted as progress is made.

PierrickVoulet commented 3 years ago

The Protobuf team just made a fix to mitigate the issue https://github.com/protocolbuffers/protobuf/pull/8720. It should be released in the next version of Protobuf.

divyeshgajja commented 3 years ago

Hello Every one

i need help to create Billing Setup .

$stream = $googleAdsClient->getGoogleAdsServiceClient()->searchStream($customerId, $query); /* @var GoogleAdsRow $googleAdsRow / $googleAdsRow = $stream->iterateAllElements()->current();

my code is stuck hear ho can i solve this.

PierrickVoulet commented 3 years ago

Hello Every one

i need help to create Billing Setup .

$stream = $googleAdsClient->getGoogleAdsServiceClient()->searchStream($customerId, $query); /* @var GoogleAdsRow $googleAdsRow / $googleAdsRow = $stream->iterateAllElements()->current();

my code is stuck hear ho can i solve this.

Hi @divyeshgajja - Is it related to this particular bug? If it is not, please create a new issue.

steve-ico3 commented 3 years ago

Hi Pierrick

I'm still getting this issue on the latest version

Package  Version State
grpc     1.38.0  stable
protobuf 3.17.3  stable

Using "googleads/google-ads-php": "^10.0",

[critical] Error thrown while running command "app:project:vendor:google:adwords:test". Message: "User Warning: proto descriptor was previously loaded (included in multiple metadata bundles?): google/ads/googleads/v8/enums/policy_topic_entry_type.proto"

Anything else I can try to fix this?

PierrickVoulet commented 3 years ago

Hi Pierrick

I'm still getting this issue on the latest version

Package  Version State
grpc     1.38.0  stable
protobuf 3.17.3  stable

Using "googleads/google-ads-php": "^10.0",

[critical] Error thrown while running command "app:project:vendor:google:adwords:test". Message: "User Warning: proto descriptor was previously loaded (included in multiple metadata bundles?): google/ads/googleads/v8/enums/policy_topic_entry_type.proto"

Anything else I can try to fix this?

It will be fixed in the next protobuf version (it is not fixed in 3.17.3).

PierrickVoulet commented 3 years ago

Update: This issue was fixed in the version 3.18.0 of protobuf.

ViktorShchepkin commented 2 years ago

Hello!

Client library version: v12.0.0

Google Ads API version: v8

PHP Version => 7.3.31-2+ubuntu20.04.1+deb.sury.org+1

System => Linux dadicc 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021 x86_64 Build Date => Oct 22 2021 12:34:45 Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /etc/php/7.3/cli Loaded Configuration File => /etc/php/7.3/cli/php.ini Scan this dir for additional .ini files => /etc/php/7.3/cli/conf.d Additional .ini files parsed => /etc/php/7.3/cli/conf.d/10-mysqlnd.ini, /etc/php/7.3/cli/conf.d/10-opcache.ini, /etc/php/7.3/cli/conf.d/10-pdo.ini, /etc/php/7.3/cli/conf.d/15-psr.ini, /etc/php/7.3/cli/conf.d/15-xml.ini, /etc/php/7.3/cli/conf.d/20-amqp.ini, /etc/php/7.3/cli/conf.d/20-apcu.ini, /etc/php/7.3/cli/conf.d/20-ast.ini, /etc/php/7.3/cli/conf.d/20-bcmath.ini, /etc/php/7.3/cli/conf.d/20-bz2.ini, /etc/php/7.3/cli/conf.d/20-calendar.ini, /etc/php/7.3/cli/conf.d/20-ctype.ini, /etc/php/7.3/cli/conf.d/20-curl.ini, /etc/php/7.3/cli/conf.d/20-dba.ini, /etc/php/7.3/cli/conf.d/20-dom.ini, /etc/php/7.3/cli/conf.d/20-enchant.ini, /etc/php/7.3/cli/conf.d/20-exif.ini, /etc/php/7.3/cli/conf.d/20-fileinfo.ini, /etc/php/7.3/cli/conf.d/20-ftp.ini, /etc/php/7.3/cli/conf.d/20-gd.ini, /etc/php/7.3/cli/conf.d/20-gearman.ini, /etc/php/7.3/cli/conf.d/20-geoip.ini, /etc/php/7.3/cli/conf.d/20-gettext.ini, /etc/php/7.3/cli/conf.d/20-gmp.ini, /etc/php/7.3/cli/conf.d/20-gnupg.ini, /etc/php/7.3/cli/conf.d/20-iconv.ini, /etc/php/7.3/cli/conf.d/20-igbinary.ini, /etc/php/7.3/cli/conf.d/20-imagick.ini, /etc/php/7.3/cli/conf.d/20-imap.ini, /etc/php/7.3/cli/conf.d/20-interbase.ini, /etc/php/7.3/cli/conf.d/20-intl.ini, /etc/php/7.3/cli/conf.d/20-json.ini, /etc/php/7.3/cli/conf.d/20-ldap.ini, /etc/php/7.3/cli/conf.d/20-lua.ini, /etc/php/7.3/cli/conf.d/20-lz4.ini, /etc/php/7.3/cli/conf.d/20-mbstring.ini, /etc/php/7.3/cli/conf.d/20-mcrypt.ini, /etc/php/7.3/cli/conf.d/20-memcache.ini, /etc/php/7.3/cli/conf.d/20-mongodb.ini, /etc/php/7.3/cli/conf.d/20-msgpack.ini, /etc/php/7.3/cli/conf.d/20-mysqli.ini, /etc/php/7.3/cli/conf.d/20-oauth.ini, /etc/php/7.3/cli/conf.d/20-odbc.ini, /etc/php/7.3/cli/conf.d/20-pcov.ini, /etc/php/7.3/cli/conf.d/20-pdo_dblib.ini, /etc/php/7.3/cli/conf.d/20-pdo_firebird.ini, /etc/php/7.3/cli/conf.d/20-pdo_mysql.ini, /etc/php/7.3/cli/conf.d/20-pdo_odbc.ini, /etc/php/7.3/cli/conf.d/20-pdo_pgsql.ini, /etc/php/7.3/cli/conf.d/20-pdo_sqlite.ini, /etc/php/7.3/cli/conf.d/20-pgsql.ini, /etc/php/7.3/cli/conf.d/20-phalcon.ini, /etc/php/7.3/cli/conf.d/20-phar.ini, /etc/php/7.3/cli/conf.d/20-pinba.ini, /etc/php/7.3/cli/conf.d/20-posix.ini, /etc/php/7.3/cli/conf.d/20-propro.ini, /etc/php/7.3/cli/conf.d/20-ps.ini, /etc/php/7.3/cli/conf.d/20-pspell.ini, /etc/php/7.3/cli/conf.d/20-radius.ini, /etc/php/7.3/cli/conf.d/20-raphf.ini, /etc/php/7.3/cli/conf.d/20-readline.ini, /etc/php/7.3/cli/conf.d/20-recode.ini, /etc/php/7.3/cli/conf.d/20-redis.ini, /etc/php/7.3/cli/conf.d/20-rrd.ini, /etc/php/7.3/cli/conf.d/20-shmop.ini, /etc/php/7.3/cli/conf.d/20-simplexml.ini, /etc/php/7.3/cli/conf.d/20-smbclient.ini, /etc/php/7.3/cli/conf.d/20-soap.ini, /etc/php/7.3/cli/conf.d/20-sockets.ini, /etc/php/7.3/cli/conf.d/20-solr.ini, /etc/php/7.3/cli/conf.d/20-sqlite3.ini, /etc/php/7.3/cli/conf.d/20-ssh2.ini, /etc/php/7.3/cli/conf.d/20-stomp.ini, /etc/php/7.3/cli/conf.d/20-sysvmsg.ini, /etc/php/7.3/cli/conf.d/20-sysvsem.ini, /etc/php/7.3/cli/conf.d/20-sysvshm.ini, /etc/php/7.3/cli/conf.d/20-tideways.ini, /etc/php/7.3/cli/conf.d/20-tidy.ini, /etc/php/7.3/cli/conf.d/20-tokenizer.ini, /etc/php/7.3/cli/conf.d/20-uopz.ini, /etc/php/7.3/cli/conf.d/20-uploadprogress.ini, /etc/php/7.3/cli/conf.d/20-uuid.ini, /etc/php/7.3/cli/conf.d/20-wddx.ini, /etc/php/7.3/cli/conf.d/20-xdebug.ini, /etc/php/7.3/cli/conf.d/20-xhprof.ini, /etc/php/7.3/cli/conf.d/20-xmlreader.ini, /etc/php/7.3/cli/conf.d/20-xmlrpc.ini, /etc/php/7.3/cli/conf.d/20-xmlwriter.ini, /etc/php/7.3/cli/conf.d/20-xsl.ini, /etc/php/7.3/cli/conf.d/20-yaml.ini, /etc/php/7.3/cli/conf.d/20-zip.ini, /etc/php/7.3/cli/conf.d/20-zmq.ini, /etc/php/7.3/cli/conf.d/25-apcu_bc.ini, /etc/php/7.3/cli/conf.d/25-http.ini, /etc/php/7.3/cli/conf.d/25-mailparse.ini, /etc/php/7.3/cli/conf.d/25-memcached.ini, /etc/php/7.3/cli/conf.d/25-swoole.ini, /etc/php/7.3/cli/conf.d/30-decimal.ini, /etc/php/7.3/cli/conf.d/30-ds.ini, /etc/php/7.3/cli/conf.d/30-grpc.ini, /etc/php/7.3/cli/conf.d/30-inotify.ini, /etc/php/7.3/cli/conf.d/30-maxminddb.ini, /etc/php/7.3/cli/conf.d/30-protobuf.ini, /etc/php/7.3/cli/conf.d/30-vips.ini, /etc/php/7.3/cli/conf.d/30-zstd.ini

PHP API => 20180731 PHP Extension => 20180731 Zend Extension => 320180731 Zend Extension Build => API320180731,NTS PHP Extension Build => API20180731,NTS Debug Build => no Thread Safety => disabled Zend Signal Handling => enabled Zend Memory Manager => enabled Zend Multibyte Support => provided by mbstring IPv6 Support => enabled DTrace Support => available, disabled

Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, smb, ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp, zip, phar, compress.zstd Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2 Registered Stream Filters => zlib., string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, dechunk, bzip2., convert.iconv., mcrypt., mdecrypt., http.*

This program makes use of the Zend Scripting Language Engine: Zend Engine v3.3.31, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.31-2+ubuntu20.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans

The PHP Extension grpc is installed: 1.41.0 The PHP Extension protobuf is installed: 3.17.3

===========================================================

PROBLEM:

I deployed my project in local. I installed lib google-ads-php to the root of the project. I try tested methods and i have error - 'proto descriptor was previously loaded (included in multiple metadata bundles?): google/ads/googleads/v8/enums/customer_pay_per_conversion_eligibility_failure_reason.proto'. The problem is in my shell, and in the code from the examples (I check and debug on it)

Next i search problem in inet.

I searched problem here:

https://github.com/googleads/google-ads-php/issues/540 https://github.com/googleads/google-ads-php/issues/500

Next i search guide for install grpc and protobuf here https://cloud.google.com/php/grpc#windows_3 I went through all the steps and installed the required packages.

After installing and configuring the code from the examples worked, the code from my shell still returns the previously received error. The code from the examples and the shell is identical. The only difference is that it is called from different places (different environments). I listed the grpc and protobuf versions of the system above, the versions in the "grpc / grpc" lib: "^ 1.39", "google / protobuf": "^ 3.18.0"

Perhaps the reason is in the environment and different versions of grpc and protobuf?

INFO: To work with Api and the library, I made my own shell. The wrapper methods are based on the code and methods in the examples folder. Earlier I debugged and completed the trace: createAccount (create Customer), sendInviteUserWithAccessRole, addBillingSetup, addAccountBudgetProposal, getAccountBudget