Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

User-rate limit exception/error returns wrong retry-after time, creating forwarding filter not possible

Open
#20,544 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
api

Research direction

Reproduce the Gmail filter creation with Google::Apis::GmailV1::GmailService#create_user_setting_filter and inspect the Google::Apis::RateLimitError output, focusing on the reported Retry after value. Done means the client reports a retry time consistent with the service response; the issue names no file or test to run.

Written by the indexing model from the issue text.

Description

Environment details
  • OS: macOS 15.1 (doesn't matter)
  • Ruby version: ruby 3.3.6
  • Gem name and version: google-apis-gmail_v1 (0.41.0)
Steps to reproduce

When creating a Filter via the GMail API (Google::Apis::GmailV1) which includes a forward action, this is apparently user-rate limit throttled.

In my Ruby API client I get the following error messages: rateLimitExceeded: User-rate limit exceeded. Retry after 2024-11-12T11:16:42.247Z (Forwarding rules)

Unfortunately, the time returned when to try again is wrong.

My code waits until this time plus a grace period of 60 seconds. When trying at 11:17:42 UTC I get another rateLimitExceeded: User-rate limit exceeded. Retry after 2024-11-12T11:32:42.968Z (Forwarding rules).

Even when I tried the code a couple of hours later, I still get that error on the first request. So the given retry-after time is clearly wrong.

Code example
begin
  @client = Google::Apis::GmailV1::GmailService.new # Authorization code skipped
  criteria = Google::Apis::GmailV1::FilterCriteria.new(…some query…)
  action = Google::Apis::GmailV1::FilterAction.new(forward: "test@email.com") # This is a verified address, cross-checked with list_user_setting_forwarding_addresses
  filter = Google::Apis::GmailV1::Filter.new(criteria: criteria, action: action)
  result = @client.create_user_setting_filter('me', filter_content)
rescue Google::Apis::RateLimitError => e
  puts "Rate Limit Exceeded: #{e}
end
> User-rate limit exceeded.  Retry after 2024-11-12T11:16:42.247Z (Forwarding rules)
Dominant language
Ruby
Stars
2.9k
Forks
888
Avg merge
8m
Merged PRs (30d)
241

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-api-ruby-client

All issues in googleapis/google-api-ruby-client

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.