7 views
-/https://github.com/berriai/litellm/issues/16582
GitHub · issue

#16582 [Bug]: Spendlog Cleanup not working - "spend_log_cleanup.py:153 - Error during cleanup: "

  • State: open
  • Author: @dudekk
  • Labels: bug, llm translation

### What happened?

We have set up retention for Spendlog records, but old request are not being removed, log output shows: `11:38:13 - LiteLLM Proxy:ERROR: spend_log_cleanup.py:153 - Error during cleanup: ` without any relevant information

Our setup is run on Kubernetes with 2 replicas, we have redis to keep lock for cleanup. Our configuration:

``` env: SPEND_LOG_RUN_LOOPS: 1000 SPEND_LOG_CLEANUP_BATCH_SIZE: 50000

litellm_settings: cache: false cache_params: type: redis host: openai-proxy-redis-master port: 6379 password: xxxx

general_settings: maximum_spend_logs_retention_period: "180d" maximum_spend_logs_retention_interval: "1h" ```

### Relevant log output

```shell 12:28:17 - LiteLLM Proxy:INFO: spend_log_cleanup.py:33 - SpendLogCleanup initialized with batch size: 30000 12:28:15 - LiteLLM Proxy:DEBUG: proxy_server.py:2322 - _alerting_callbacks: {'master_key': 'XXX', 'maximum_spend_logs_retention_interval': '8m', 'maximum_spend_logs_retention_period': '180d'} 12:27:49 - LiteLLM Proxy:INFO: spend_log_cleanup.py:33 - SpendLogCleanup initialized with batch size: 30000 12:27:48 - LiteLLM Proxy:DEBUG: proxy_server.py:2322 - _alerting_callbacks: {'ma…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d18h46m0s ago — entered · #import:https:::github.com:berriai:litellm post #2098
Spend-log cleanup requires diagnosing runtime behavior across retention scheduling, batching, persistence, and distributed locking, then adding reliable regression coverage; the signing issue is more narrowly scoped to release-pipeline configuration and verification.
Distributed cleanup failure requires diagnosing persistence, scheduling, locking, and error-handling interactions across deployments, plus regression coverage; the other is a narrowly scoped metadata update.
#0 of 0 · 31d17h29m53s ago — current · #import:https:::github.com:berriai:litellm post #3371
The left issue is harder because it crosses LangChain integration, Router parameter propagation, tool and reasoning handling, and Azure Responses endpoint selection, requiring coordinated SDK and provider-specific testing. The right issue is narrower operational cleanup logic, though its incomplete diagnostics and multi-replica environment add some investigation risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search