# X_RATE_LIMIT_INVALID

## Means

a declared rate limit computes to numbers the limiter cannot run on

## Typical cause

a `{ limit, windowMs }` pair `toBucket` cannot convert: `limit` below 1 refuses the first caller, which is a policy's job and never a rate limit's, and `windowMs: 0` or `{ limit: MAX_VALUE, windowMs: 1 }` compute an infinite refill — a bucket that never empties. Raised in `@ultimat3/http`, which owns `Bucket` and the maths, so an action's and a query's `rateLimit:` are refused by one check and not two

## Fix

edit the `rateLimit:` on the declaration `cause` names to a whole allowance over a real window — `{ limit: 5, windowMs: 600_000 }` for five per ten minutes — or delete it to keep the `default` bucket

[HTTP](/error-codes#http)
