6 views
-/https://github.com/berriai/litellm/issues/27193
GitHub · issue

#27193 [Bug]: Grace period — old API key rejected immediately despite row in LiteLLM_DeprecatedVerificationToken (Enterprise, proxy v1.82.3)

  • State: open
  • Author: @coolchigi
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

A bug happened!

**Edition:** LiteLLM **Enterprise**. We need a clear fix or upgrade path

**Image:** `[ghcr.io/berriai/litellm-database:main-v1.82.3-stable`](http://ghcr.io/berriai/litellm-database:main-v1.82.3-stable%60) (mirrored to ECR).

Per [Virtual Keys → Key Rotations](https://docs.litellm.ai/docs/proxy/virtual_keys#-key-rotations), POST /key/{key}/regenerate with "grace_period": "…" should keep **both** the old and new virtual keys working until **revoke_at**.

**Observed:** Immediately after regenerate, requests using the **pre-rotate** sk-… fail with auth errors consistent with token_not_found_in_db / “Unable to find token in cache or LiteLLM_VerificationTokenTable”, while the **new** key works.

**Database (self-hosted Postgres):** After regenerate, **SELECT token, active_token_id, revoke_at FROM "LiteLLM_DeprecatedVerificationToken"** shows a row where:

token = SHA-256 of the deprecated (pre-rotate) key material active_token_id = hash aligning with the new active key row revoke_at = rotate time **+ grace** (behaves as expected…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (6 events)
#0 of 0 · 31d19h17m58s ago — entered · #import:https:::github.com:berriai:litellm post #1670
Authentication lifecycle behavior spans rotation, cache/database consistency, expiration timing, and enterprise compatibility, creating broader regression risk; the other issue is comparatively localized response mapping and persistence retrieval.
The right-hand issue is harder because it crosses authentication lifecycle semantics, persistence, caching, expiry handling, and enterprise compatibility, while the left-hand issue appears more localized to startup configuration and callback initialization.
The right issue is harder because it likely requires tracing authentication across key rotation, cache/database lookup, expiration handling, and enterprise compatibility, with greater security and regression risk. The left issue is comparatively localized to extending an OAuth token endpoint flow with validation and targeted tests.
The right-side issue is harder because it spans security-sensitive authentication state, persistence and cache consistency, expiration semantics, and regression coverage. The left-side issue is comparatively narrower provider-specific accounting work.
The right issue is harder because it likely spans authentication flows, token-rotation state, database fallback, cache invalidation, expiration timing, and Enterprise-specific behavior, requiring careful compatibility and regression testing. The left issue is more localized to message sanitization and provider translation with targeted format-handling tests.
#0 of 0 · 31d18h12m44s ago — current · #import:https:::github.com:berriai:litellm post #2734
The right issue is harder because it spans authentication, key-rotation state, database persistence, cache behavior, expiration semantics, and enterprise compatibility, requiring broader investigation and integration testing. The left issue is comparatively localized to aligning metric definition and invocation labels.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search