Skip to content

[BUG] 简洁阐述问题 / Concise description of the issue #5425

@jackrous

Description

@jackrous

TypeError: string indices must be integers, not 'str'
2025-12-22 13:05:15.673 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:15.682 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:15.689 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:15.689 | ERROR | chatchat.webui_pages.utils:to_json:233 - AttributeError: API未能返回正确的JSON。'NoneType' object has no attribute 'json'
2025-12-22 13:05:15.951 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:15.960 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:15.966 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:15.967 | ERROR | chatchat.webui_pages.utils:to_json:233 - AttributeError: API未能返回正确的JSON。'NoneType' object has no attribute 'json'
2025-12-22 13:05:21.261 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:21.270 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:21.277 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /tools: Invalid port: ':1'
2025-12-22 13:05:21.278 | ERROR | chatchat.webui_pages.utils:to_json:233 - AttributeError: API未能返回正确的JSON。'NoneType' object has no attribute 'json'
INFO: 127.0.0.1:50480 - "POST /chat/chat/completions HTTP/1.1" 200 OK
2025-12-22 13:05:21,706 httpx 59507 INFO HTTP Request: POST http://127.0.0.1:7861/chat/chat/completions "HTTP/1.1 200 OK"
2025-12-22 13:05:21,725 httpx 59361 INFO HTTP Request: POST http://127.0.0.1:9997/v1/chat/completions "HTTP/1.1 200 OK"
2025-12-22 13:05:27.098 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /knowledge_base/list_knowledge_bases: Invalid port: ':1'
2025-12-22 13:05:27.107 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /knowledge_base/list_knowledge_bases: Invalid port: ':1'
2025-12-22 13:05:27.114 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /knowledge_base/list_knowledge_bases: Invalid port: ':1'
2025-12-22 13:05:27.114 | ERROR | chatchat.webui_pages.utils:to_json:233 - AttributeError: API未能返回正确的JSON。'NoneType' object has no attribute 'json'
2025-12-22 13:05:27.115 Uncaught app exception
Traceback (most recent call last):
File "/home/boss/Llama-factory/conda/envs/deepseek/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/home/boss/Llama-factory/conda/envs/deepseek/lib/python3.11/site-packages/chatchat/webui.py", line 71, in
kb_chat(api=api)
File "/home/boss/Llama-factory/conda/envs/deepseek/lib/python3.11/site-packages/chatchat/webui_pages/kb_chat.py", line 118, in kb_chat
kb_list = [x["kb_name"] for x in api.list_knowledge_bases()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
2025-12-22 13:05:27.346 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /knowledge_base/list_knowledge_bases: Invalid port: ':1'
2025-12-22 13:05:27.355 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /knowledge_base/list_knowledge_bases: Invalid port: ':1'
2025-12-22 13:05:27.362 | ERROR | chatchat.webui_pages.utils:get:64 - InvalidURL: error when get /knowledge_base/list_knowledge_bases: Invalid port: ':1'
2025-12-22 13:05:27.362 | ERROR | chatchat.webui_pages.utils:to_json:233 - AttributeError: API未能返回正确的JSON。'NoneType' object has no attribute 'json'
2025-12-22 13:05:27.362 Uncaught app exception
Traceback (most recent call last):
File "/home/boss/Llama-factory/conda/envs/deepseek/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/home/boss/Llama-factory/conda/envs/deepseek/lib/python3.11/site-packages/chatchat/webui.py", line 71, in
kb_chat(api=api)
File "/home/boss/Llama-factory/conda/envs/deepseek/lib/python3.11/site-packages/chatchat/webui_pages/kb_chat.py", line 118, in kb_chat
kb_list = [x["kb_name"] for x in api.list_knowledge_bases()]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions