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

Calling client.service.offline_user_data_job results in NameError: uninitialized constant Gapic::ServiceStub::ChannelPool #464

Closed
waynew111 opened this issue Nov 2, 2023 · 6 comments · Fixed by #469
Labels
bug Something isn't working triage New issues that need to be sorted into other labels

Comments

@waynew111
Copy link

Describe the bug:
Calling client.service.offline_user_data_job results in NameError: uninitialized constant Gapic::ServiceStub::ChannelPool

Steps to Reproduce:

def self.get_client
    Google::Ads::GoogleAds::GoogleAdsClient.new do |c|
        config.client_id = <client_id>
        config.client_secret = <client_secret>
        config.developer_token = <developer_token>
        config.refresh_token = <refresh_token>
    end
end

client = get_client
offline_user_data_service = client.service.offline_user_data_job

Expected behavior:
Return a new instance of offline_user_data_job

Client library version and API version:
Client library version: 25.0.0
Google Ads API version: v15

Gemfile.lock gems/dependencies:

google-ads-googleads (25.0.0)
google-protobuf (3.23.4)
google-protobuf (3.23.4-aarch64-linux)
googleapis-common-protos-types (1.9.0)
    google-protobuf (~> 3.18)
grpc (1.58.0)
    google-protobuf (~> 3.23)

Request/Response Logs:
NameError: uninitialized constant Gapic::ServiceStub::ChannelPool
/home/vagrant/.rvm/gems/ruby-2.6.3@automator/gems/google-ads-googleads-25.0.0/lib/google/ads/google_ads/v15/services/offline_user_data_job_service/operations.rb:721:in channel_pool' /home/vagrant/.rvm/gems/ruby-2.6.3@automator/gems/google-ads-googleads-25.0.0/lib/google/ads/google_ads/v15/services/offline_user_data_job_service/operations.rb:98:in initialize'
/home/vagrant/.rvm/gems/ruby-2.6.3@automator/gems/google-ads-googleads-25.0.0/lib/google/ads/google_ads/v15/services/offline_user_data_job_service/client.rb:135:in new' /home/vagrant/.rvm/gems/ruby-2.6.3@automator/gems/google-ads-googleads-25.0.0/lib/google/ads/google_ads/v15/services/offline_user_data_job_service/client.rb:135:in initialize'
/home/vagrant/.rvm/gems/ruby-2.6.3@automator/gems/google-ads-googleads-25.0.0/lib/google/ads/google_ads/factories/v15/services.rb:1966:in new' /home/vagrant/.rvm/gems/ruby-2.6.3@automator/gems/google-ads-googleads-25.0.0/lib/google/ads/google_ads/factories/v15/services.rb:1966:in offline_user_data_job'

Anything else we should know about your project / environment:
The exact same code snippet provided above works perfectly when using v13 / client library 22.0, as well as v14 / client library 24.0. It only fails for v15 / client library 25.0.

@waynew111 waynew111 added bug Something isn't working triage New issues that need to be sorted into other labels labels Nov 2, 2023
@beatbull
Copy link

beatbull commented Nov 6, 2023

Hi,

just by changing the google-ads-googleads gem version to 25.0.0, I got the same error as reported above, for any Ruby version I tried (3.2.1, 2.7.8). Since the issue is with gapic, I tried upgrading gapic-common to the latest version (0.20.0). This made the error disappear and the googleads gem in version 25.0.0 started working.

I think the issue is in https://github.com/googleads/google-ads-ruby/blob/main/google-ads-googleads.gemspec#L37 , the version needs to be adjusted for gapic-common in the gemspec, since the googleads gem in version 25.0.0 relies on the new channel pooling feature added in gapic-common 0.20.0, see https://github.com/googleapis/gapic-generator-ruby/releases/tag/gapic-common%2Fv0.20.0 .

Until the gemspec gets fixed, simply add following line in your local Gemfile and run bundle:

gem 'gapic-common', '~> 0.20'

@waynew111
Copy link
Author

^ ^ Thanks for figuring out the cause! I tried the above and things started working.

However, this seems to require googleauth 1.0.0. Our code base also uses google_drive 3.0.7, which requires googleauth < 1.0.0. I'm assuming even when gemspec gets fixed, this conflict would still remain. Does anybody know?

@danielfrg
Copy link
Contributor

danielfrg commented Nov 14, 2023

Thank you for the report. I tested older versions of gapic-common and confirmed that we need >0.20. It will be fixed with #469

I will make a release once thats merged.

@danielfrg
Copy link
Contributor

Version 25.0.1 has been released to include the fix.

@waynew111
Copy link
Author

Amazing! Thanks so much @danielfrg!

@waynew111
Copy link
Author

For anyone tracking this issue, 25.0.2 was released today to address a dependency issue in 25.0.1. Things are working on my end now.

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 New issues that need to be sorted into other labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants