litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Bug]: NoneType object is not iterable

Open Mte90 opened this issue 10 months ago • 7 comments

What happened?

Image I get this and in console

11:33:48 - LiteLLM Proxy:ERROR: internal_user_endpoints.py:395 - litellm.proxy.proxy_server.user_info(): Exception occured - 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/litellm/proxy/management_endpoints/internal_user_endpoints.py", line 308, in user_info
    return await _get_user_info_for_proxy_admin()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/litellm/proxy/management_endpoints/internal_user_endpoints.py", line 431, in _get_user_info_for_proxy_admin
    for key in _keys_in_db:
TypeError: 'NoneType' object is not iterable

Relevant log output


Are you a ML Ops Team?

No

What LiteLLM version are you on ?

latest

Twitter / LinkedIn details

No response

Mte90 avatar Feb 04 '25 11:02 Mte90

same issue

jaceyang97 avatar Feb 05 '25 04:02 jaceyang97

https://github.com/BerriAI/litellm/blob/main/litellm/proxy/management_endpoints/internal_user_endpoints.py#L445

Looking here if there is no key there is the error as that case is not handled.

@ishaan-jaff it seems an easy fix but probably require some alerting to the user.

Mte90 avatar Feb 05 '25 15:02 Mte90

can we get help from a contributor PR on this + with testing ?

ishaan-jaff avatar Feb 05 '25 15:02 ishaan-jaff

Same issue here!

fredmorais avatar Mar 13 '25 20:03 fredmorais

Same issue

sarkaramitabh300 avatar Mar 14 '25 10:03 sarkaramitabh300

Same! Please advise how we can resolve this

CGives avatar Mar 15 '25 04:03 CGives

same

szhorvath avatar Mar 15 '25 19:03 szhorvath

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jun 14 '25 00:06 github-actions[bot]

the problem is still valid

Mte90 avatar Jun 16 '25 08:06 Mte90

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Sep 16 '25 00:09 github-actions[bot]

sigh

Mte90 avatar Sep 16 '25 09:09 Mte90