litellm - 💡(How to fix) Fix [Bug]: _group_keys_by_hash_tag() skips slot grouping for non-OSS-Cluster Redis, causing CROSSSLOT errors on Azure Redis Enterprise [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

22:18:25 - LiteLLM Proxy:WARNING: parallel_request_limiter_v3.py:2315 - TTL preservation failed, falling back to regular pipeline: CROSSSLOT Keys in request don't hash to the same slot (context='', command='evalsha', original-slot='15058', wrong-slot='8436', first-key='{REDACTED}:max_parallel_requests', violating-key='{team:1f44b322-dead-41d9-9244-09515df45269}:tokens') 22:18:25 - LiteLLM Proxy:WARNING: parallel_request_limiter_v3.py:2315 - TTL preservation failed, falling back to regular pipeline: CROSSSLOT Keys in request don't hash to the same slot (context='', command='evalsha', original-slot='10869', wrong-slot='3664', first-key='{REDACTED}:max_parallel_requests', violating-key='{user:158f44bb-f418-4e26-81e9-7001f60721ad}:tokens')

22:18:25 - LiteLLM:ERROR: dual_cache.py:258 - Traceback (most recent call last): File "/app/.venv/lib/python3.13/site-packages/litellm/caching/dual_cache.py", line 243, in async_get_cache redis_result = await self.redis_cache.async_get_cache( key, parent_otel_span=parent_otel_span ) File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 172, in wrapper result = await method(self, *args, **kwargs) File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 1015, in async_get_cache key = self.check_and_fix_namespace(key=key) File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 358, in check_and_fix_namespace if self.namespace is not None and not key.startswith(self.namespace): ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'startswith'

Fix Action

Fixed

Code Example

22:18:25 - LiteLLM Proxy:WARNING: parallel_request_limiter_v3.py:2315 - TTL preservation failed, falling back to regular pipeline: CROSSSLOT Keys in request don't hash to the same slot (context='', command='evalsha', original-slot='15058', wrong-slot='8436', first-key='{REDACTED}:max_parallel_requests', violating-key='{team:1f44b322-dead-41d9-9244-09515df45269}:tokens')
22:18:25 - LiteLLM Proxy:WARNING: parallel_request_limiter_v3.py:2315 - TTL preservation failed, falling back to regular pipeline: CROSSSLOT Keys in request don't hash to the same slot (context='', command='evalsha', original-slot='10869', wrong-slot='3664', first-key='{REDACTED}:max_parallel_requests', violating-key='{user:158f44bb-f418-4e26-81e9-7001f60721ad}:tokens')



22:18:25 - LiteLLM:ERROR: dual_cache.py:258 - Traceback (most recent call last):
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/dual_cache.py", line 243, in async_get_cache
    redis_result = await self.redis_cache.async_get_cache(
        key, parent_otel_span=parent_otel_span
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 172, in wrapper
    result = await method(self, *args, **kwargs)
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 1015, in async_get_cache
    key = self.check_and_fix_namespace(key=key)
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 358, in check_and_fix_namespace
    if self.namespace is not None and not key.startswith(self.namespace):
                                          ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'startswith'
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

_group_keys_by_hash_tag() in parallel_request_limiter_v3.py only groups keys by hash slot when _is_redis_cluster() returns True (i.e., when the cache is a RedisClusterCache instance). For all other Redis configurations, it groups all keys under a single tag and sends them in one EVALSHA call.

This causes CROSSSLOT errors on Azure Redis Enterprise (and Azure Managed Redis) with the EnterpriseCluster clustering policy, which enforces cross-slot restrictions despite exposing a single endpoint and not using the OSS Cluster protocol. Since _is_redis_cluster() only checks for RedisClusterCache, it returns False for these deployments.

Steps to Reproduce

  1. upgraded to v1.88.1
  2. configured azure enterprise redis
  3. deployed

Relevant log output

22:18:25 - LiteLLM Proxy:WARNING: parallel_request_limiter_v3.py:2315 - TTL preservation failed, falling back to regular pipeline: CROSSSLOT Keys in request don't hash to the same slot (context='', command='evalsha', original-slot='15058', wrong-slot='8436', first-key='{REDACTED}:max_parallel_requests', violating-key='{team:1f44b322-dead-41d9-9244-09515df45269}:tokens')
22:18:25 - LiteLLM Proxy:WARNING: parallel_request_limiter_v3.py:2315 - TTL preservation failed, falling back to regular pipeline: CROSSSLOT Keys in request don't hash to the same slot (context='', command='evalsha', original-slot='10869', wrong-slot='3664', first-key='{REDACTED}:max_parallel_requests', violating-key='{user:158f44bb-f418-4e26-81e9-7001f60721ad}:tokens')



22:18:25 - LiteLLM:ERROR: dual_cache.py:258 - Traceback (most recent call last):
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/dual_cache.py", line 243, in async_get_cache
    redis_result = await self.redis_cache.async_get_cache(
        key, parent_otel_span=parent_otel_span
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 172, in wrapper
    result = await method(self, *args, **kwargs)
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 1015, in async_get_cache
    key = self.check_and_fix_namespace(key=key)
  File "/app/.venv/lib/python3.13/site-packages/litellm/caching/redis_cache.py", line 358, in check_and_fix_namespace
    if self.namespace is not None and not key.startswith(self.namespace):
                                          ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'startswith'

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.88.1

Twitter / LinkedIn details

https://www.linkedin.com/in/maarmenta/

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING