litellm - 💡(How to fix) Fix [Bug]: OTEL NoneType crash

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

20:53:05 - LiteLLM:ERROR: litellm_logging.py:2910 - LiteLLM.LoggingError: [Non-Blocking] Exception occurred while success logging Traceback (most recent call last): File "/app/.venv/lib/python3.13/site-packages/litellm/litellm_core_utils/litellm_logging.py", line 2842, in async_success_handler await callback.async_log_success_event( ...<4 lines>... ) File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 376, in async_log_success_event raise e File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 370, in async_log_success_event await self.async_service_success_hook( ...<3 lines>... ) File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 213, in async_service_success_hook await _otel_logger_to_use.async_service_success_hook( ...<5 lines>... ) File "/app/.venv/lib/python3.13/site-packages/litellm/integrations/opentelemetry.py", line 559, in async_service_success_hook _start_time_ns = self._to_ns(start_time) File "/app/.venv/lib/python3.13/site-packages/litellm/integrations/opentelemetry.py", line 2638, in _to_ns return int(dt.timestamp() * 1e9) ^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'timestamp'

Code Example

20:53:05 - LiteLLM:ERROR: litellm_logging.py:2910 - LiteLLM.LoggingError: [Non-Blocking] Exception occurred while success logging Traceback (most recent call last):
  File "/app/.venv/lib/python3.13/site-packages/litellm/litellm_core_utils/litellm_logging.py", line 2842, in async_success_handler
    await callback.async_log_success_event(
    ...<4 lines>...
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 376, in async_log_success_event
    raise e
  File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 370, in async_log_success_event
    await self.async_service_success_hook(
    ...<3 lines>...
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 213, in async_service_success_hook
    await _otel_logger_to_use.async_service_success_hook(
    ...<5 lines>...
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/integrations/opentelemetry.py", line 559, in async_service_success_hook
    _start_time_ns = self._to_ns(start_time)
  File "/app/.venv/lib/python3.13/site-packages/litellm/integrations/opentelemetry.py", line 2638, in _to_ns
    return int(dt.timestamp() * 1e9)
               ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'timestamp'
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?

When OTEL collector callback is enabled containers are constantly crashing

Steps to Reproduce

  1. Enabled otel callback
  2. deployed litellm
  3. pods continuously restart

Relevant log output

20:53:05 - LiteLLM:ERROR: litellm_logging.py:2910 - LiteLLM.LoggingError: [Non-Blocking] Exception occurred while success logging Traceback (most recent call last):
  File "/app/.venv/lib/python3.13/site-packages/litellm/litellm_core_utils/litellm_logging.py", line 2842, in async_success_handler
    await callback.async_log_success_event(
    ...<4 lines>...
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 376, in async_log_success_event
    raise e
  File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 370, in async_log_success_event
    await self.async_service_success_hook(
    ...<3 lines>...
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/_service_logger.py", line 213, in async_service_success_hook
    await _otel_logger_to_use.async_service_success_hook(
    ...<5 lines>...
    )
  File "/app/.venv/lib/python3.13/site-packages/litellm/integrations/opentelemetry.py", line 559, in async_service_success_hook
    _start_time_ns = self._to_ns(start_time)
  File "/app/.venv/lib/python3.13/site-packages/litellm/integrations/opentelemetry.py", line 2638, in _to_ns
    return int(dt.timestamp() * 1e9)
               ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'timestamp'

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.88.1

Twitter / LinkedIn details

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