GRPC error

832 views
Skip to first unread message

Kiran MK

unread,
Apr 18, 2022, 8:36:00 AM4/18/22
to Google Ads API and AdWords API Forum
Hi,
I have been trying to use Google Ads API for a project.
ruby version: 2.6.9
rails version: 5.1.7

I was just trying out this example here from the google ads repo, to get the campaigns info in the console. While running the block of code below

responses.each do |response|
  response.results.each do |row|
    puts "Campaign with ID #{row.campaign.id} and name '#{row.campaign.name}' was found."
  end
end

its showing an error like this 

GRPC::Unimplemented: 12:Operation is not implemented, or supported, or enabled.. debug_error_string:{"created":"@1650273920.527183000","description":"Error received from peer ipv4:142.250.183.202:443","file":"src/core/lib/surface/call.cc","file_line":906,"grpc_message":"Operation is not implemented, or supported, or enabled.","grpc_status":12}


If the code is run again its showing another error 

GRPC::Core::CallError: Cannot run batch on closed call


Complete code I tried 

client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|

  config.client_id = ' '

  config.client_secret = ' '

  config.refresh_token = ' '

  config.developer_token = ' '

end


responses = client.service.google_ads.search_stream(
customer_id: ' ',
query: 'SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id',
)


# Output of responses 

#<Enumerator: ...>



responses.each do |response|
  response.results.each do |row|
  puts "Campaign with ID #{row.campaign.id} and name '#{row.campaign.name}' was found."
  end
end



Google Ads API Forum Advisor

unread,
Apr 19, 2022, 2:04:26 AM4/19/22
to ki...@makemine.co, adwor...@googlegroups.com

Hi Kiran,

Thanks for reaching out to the Google Ads API Forum.

I can see that you’ve encountered an error with the message “Operation is not implemented, or supported, or enabled.”. However, could you provide us with the complete request and response logs with the request-id generated, so our team can investigate further?

For the ruby library, logging can be enabled by following this guide. You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2a4EFe:ref
Message has been deleted

Tyler Chrestoff

unread,
Apr 25, 2022, 1:22:05 PM4/25/22
to Google Ads API and AdWords API Forum
Hello,

I am receiving the same error. I am able to authenticate with OAuth2 successfully and retrieve the refresh token, but when I try to use either the `#search` or `#search_stream` methods I receive the `GRPC::Unimplemented` error when the stream tries to open. The synchronous `#search` method returns the error immediately while the `#search_stream` error returns an `Enumerable` object which throws the error when trying to navigate the enumerable with a method like `#next` or `#to_a`.

I have a Ruby module with a client method that returns the Ads client:
```
def self.client
  Google::Ads::GoogleAds::GoogleAdsClient.new(Rails.root.join("google_ads_config.rb").to_s)
end
```

Then I've implemented a `.get_campaigns` method as:
```
def self.get_campaigns
  responses = client.service.google_ads.search_stream(
    :customer_id => CUSTOMER_ID,
    :query => "SELECT campaign.idcampaign.name FROM campaign ORDER BY campaign.id"
  )

  responses.each do |response|
    response.results.each do |row|
      puts "Campaign with ID #{row.campaign.id} and name '#{row.campaign.name}' was found."
    end
  end
end
```

Here's the full output with logging enabled:
```
irb(main):001:0> GoogleAdsService.get_campaigns
I, [2022-04-25T09:11:58.498912 #1828]  INFO -- : CID: REDACTED, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v6.services.GoogleAdsService/SearchStream, IsFault: no
W, [2022-04-25T09:11:59.050785 #1828]  WARN -- : CID: REDACTED, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v6.services.GoogleAdsService/SearchStream, IsFault: yes
I, [2022-04-25T09:11:59.051284 #1828]  INFO -- : Outgoing request: Headers: {"developer-token":"REDACTED","login-customer-id":"REDACTED","x-goog-api-client":"gl-ruby/2.7.4 gax/0.3.4 gapic/10.0.0 grpc/1.45.0","x-goog-request-params":"customer_id=9380164633"} Payload: {"customerId":"REDACTED","query":"SELECT campaign.idcampaign.name FROM campaign ORDER BY campaign.id"}
I, [2022-04-25T09:11:59.051510 #1828]  INFO -- : Incoming response (errors):
  GRPC::Unimplemented(12:Operation is not implemented, or supported, or enabled.. debug_error_string:{"created":"@1650892319.050462000","description":"Error received from peer ipv6:[2607:f8b0:4009:809::200a]:443","file":"src/core/lib/surface/call.cc","file_line":906,"grpc_message":"Operation is not implemented, or supported, or enabled.","grpc_status":12}):
  called from: /Users/tylerchrestoff/code/data-warehouse/app/services/google_ads_service.rb:59:in `each'
Traceback (most recent call last):
        4: from (irb):1
        3: from app/services/google_ads_service.rb:59:in `get_campaigns'
        2: from app/services/google_ads_service.rb:59:in `each'
        1: from app/services/google_ads_service.rb:59:in `each'
GRPC::Unimplemented (12:Operation is not implemented, or supported, or enabled.. debug_error_string:{"created":"@1650892319.050462000","description":"Error received from peer ipv6:[2607:f8b0:4009:809::200a]:443","file":"src/core/lib/surface/call.cc","file_line":906,"grpc_message":"Operation is not implemented, or supported, or enabled.","grpc_status":12})
irb(main):002:0>
```

Any help is greatly appreciated.

Google Ads API Forum Advisor

unread,
Apr 26, 2022, 5:15:23 AM4/26/22
to tyler.c...@joinroot.com, adwor...@googlegroups.com

Hi Tyler,

Thanks for commenting on this forum thread. 

However, I am unable to proceed with the investigation. To investigate further, our team would require the complete logs in the format of the request and response logs as seen in their respective links. Since you're using a Ruby client library, you may first enable logging by navigating to the Client libraries > Your client library (ex. Ruby) > Logging documentation, which you can access from this link. Kindly provide these details to our team via reply to author Privately option.

Regards,

Reply all
Reply to author
Forward
0 new messages