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

JSON parsing fails when gRPC PHP Extension is enabled and REST transport is used #641

Open
PierrickVoulet opened this issue Sep 2, 2021 · 1 comment
Labels
bug Something isn't working P3 Prospects for future development or feature requests that would be nice to have. Typos or minor bugs

Comments

@PierrickVoulet
Copy link
Collaborator

When C implementation of grpc is enabled in php.ini and rest transport is enabled from code ->withTransport('rest') the ConversionUploadServiceGapicClient.uploadClickConversions method fails:

#0 /home/vagrant/google-oct/app/Vendor/google/gax/src/Transport/RestTransport.php(125): Google\Protobuf\Internal\Message->mergeFromJsonString()
#1 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/Promise.php(204): Google\ApiCore\Transport\RestTransport->Google\ApiCore\Transport\{closure}()
#2 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler()
#3 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 /home/vagrant/google-oct/app/Vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(118): GuzzleHttp\Promise\TaskQueue->run()
#5 /home/vagrant/google-oct/app/Vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(145): GuzzleHttp\Handler\CurlMultiHandler->tick()
#6 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/Promise.php(248): GuzzleHttp\Handler\CurlMultiHandler->execute()
#7 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/Promise.php(224): GuzzleHttp\Promise\Promise->invokeWaitFn()
#8 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/Promise.php(269): GuzzleHttp\Promise\Promise->waitIfPending()
#9 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/Promise.php(226): GuzzleHttp\Promise\Promise->invokeWaitList()
#10 /home/vagrant/google-oct/app/Vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#11 /home/vagrant/google-oct/app/Vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V8/Services/Gapic/ConversionUploadServiceGapicClient.php(302): GuzzleHttp\Promise\Promise->wait()
#12 /home/vagrant/google-oct/app/Controller/Component/GoogleAdsApiComponent.php(383): Google\Ads\GoogleAds\V8\Services\Gapic\ConversionUploadServiceGapicClient->uploadClickConversions()
#13 /home/vagrant/google-oct/app/Controller/Component/GoogleAdsApiComponent.php(129): GoogleAdsApiComponent->uploadOfflineConversion()
#14 /home/vagrant/google-oct/app/Controller/ServicesController.php(8544): GoogleAdsApiComponent->handleOfflineConversion()
#15 [internal function]: ServicesController->testGoogleAdsLib()
#16 /home/vagrant/google-oct/lib/Cake/Controller/Controller.php(499): ReflectionMethod->invokeArgs()
#17 /home/vagrant/google-oct/lib/Cake/Routing/Dispatcher.php(193): Controller->invokeAction()
#18 /home/vagrant/google-oct/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke()
#19 /home/vagrant/google-oct/app/webroot/index.php(110): Dispatcher->dispatch()
#20 {main}

Error: Error occurred during parsing: Error parsing JSON @7:87: Type was not found

Originally posted by @rpmgr in #640 (comment)

@PierrickVoulet PierrickVoulet added bug Something isn't working P3 Prospects for future development or feature requests that would be nice to have. Typos or minor bugs labels Sep 2, 2021
@PierrickVoulet
Copy link
Collaborator Author

A few other things to note:

  • A workaround is to disable the grpc PHP extension.
  • This does not seem to happen when using GoogleAdsServiceGapicClient.search.
  • This has a fairly low impact because the rest transport is typically used when grpc is unavailable (i.e. the gRPC PHP extension cannot be installed and enabled on the environment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 Prospects for future development or feature requests that would be nice to have. Typos or minor bugs
Projects
None yet
Development

No branches or pull requests

1 participant