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

Google::Cloud::DocumentAI::V1: uninitialized constant GRPC::Core::Channel when setting credentials in DocumentProcessorService::Client.configure block #29312

Open
jibiel opened this issue Mar 7, 2025 · 0 comments
Assignees

Comments

@jibiel
Copy link

jibiel commented Mar 7, 2025

Environment details

  • Ruby version: 3.4.2
  • Gem name and version: google-cloud-document_ai-v1 1.4.0

Steps to reproduce

  1. Set credentials in the Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.configure block.

Code example

Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.configure do |config|
  config.credentials = {} # ...
end

Full backtrace

~/gems/ruby-3.4.2@gemset/gems/google-cloud-document_ai-v1-1.4.0/lib/google/cloud/document_ai/v1/document_processor_service/client.rb:2507:in 'block in <class:Configuration>': uninitialized constant GRPC::Core::Channel (NameError)

                allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
                                        ^^^^^^^^^
	from ~/gems/ruby-3.4.2@gemset/gems/gapic-common-0.25.0/lib/gapic/config.rb:84:in 'block in Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client::Configuration#create_setter'
	from ~/gems/ruby-3.4.2@gemset/gems/google-cloud-document_ai-v1-1.4.0/lib/google/cloud/document_ai/v1/document_processor_service/client.rb:94:in 'Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.configure'

Additional information

grpc 1.70.1 doesn't have these constants:

> ls GRPC::Core
constants: StatusCodes
Zeitwerk::ConstAdded#methods: const_added

Providing credentials in the Google::Cloud::DocumentAI#configure doesn't work either (google-cloud-document_ai 2.0.0, behaves like credentials are missing altogether). Only works when credentials are provided directly when initializing a client instance:

Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new do |config|
  config.credentials = {} # ...
end
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

2 participants