Skip to content

Fix NoneType error of outputs#2315

Merged
hsliuustc0106 merged 2 commits into
vllm-project:mainfrom
QiuMike:none_stream_fix_with_log
Apr 17, 2026
Merged

Fix NoneType error of outputs#2315
hsliuustc0106 merged 2 commits into
vllm-project:mainfrom
QiuMike:none_stream_fix_with_log

Conversation

@QiuMike
Copy link
Copy Markdown
Contributor

@QiuMike QiuMike commented Mar 30, 2026

if --enable-log-outputs --enable-log-requests in cli, it will result an error of NoneType for none-stream requests

PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.

Purpose

Fix omni crash when start with --enable-log-outputs --enable-log-requests

Test Plan

python -m vllm_omni.entrypoints.cli.main serve /root/Jonathan1909/Ming-flash-omni-2.0/ --omni --port 8091 --allowed-local-media-path /root/vllm-omni --stage-configs-path vllm_omni/model_executor/stage_configs/ming_flash_omni.yaml --log-stats --enable-log-outputs --enable-log-requests

Test Result

(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Chat completion failed: 'NoneType' object has no attribute 'outputs'
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Traceback (most recent call last):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/api_server.py", line 853, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] generator = await handler.create_chat_completion(request, raw_request)
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 418, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] return await self.chat_completion_full_generator(
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 1587, in chat_completion_full_generator
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] if choice.index < len(final_res.outputs):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] AttributeError: 'NoneType' object has no attribute 'outputs'

final_res does not been initialized.

Essential Elements of an Effective PR Description Checklist

(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Chat completion failed: 'NoneType' object has no attribute 'outputs'
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] Traceback (most recent call last):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/api_server.py", line 853, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] generator = await handler.create_chat_completion(request, raw_request)
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 418, in create_chat_completion
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] return await self.chat_completion_full_generator(
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] File "/root/vllm-omni/vllm_omni/entrypoints/openai/serving_chat.py", line 1587, in chat_completion_full_generator
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] if choice.index < len(final_res.outputs):
(APIServer pid=190855) ERROR 03-30 11:54:43 [api_server.py:855] AttributeError: 'NoneType' object has no attribute 'outputs'

BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)

@QiuMike QiuMike requested a review from hsliuustc0106 as a code owner March 30, 2026 04:22
@hsliuustc0106
Copy link
Copy Markdown
Collaborator

@fake0fan PTAL

@david6666666
Copy link
Copy Markdown
Collaborator

Please add describtion and fix DCO

@QiuMike
Copy link
Copy Markdown
Contributor Author

QiuMike commented Mar 31, 2026

Please add describtion and fix DCO

@david6666666 Done

@fake0fan
Copy link
Copy Markdown
Contributor

Good catch. LGTM.

But I’m just wondering if we should also add some tests for this path, so that this issue does not come back later. cc @Gaohan123 @yenuo26

Copy link
Copy Markdown
Collaborator

@lishunyang12 lishunyang12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes the text case but final_res is still None for audio/image-only responses. The logging block at L1588 (if choice.index < len(final_res.outputs)) will crash the same way when there's no text output.

Need to guard that access:

if final_res is not None and choice.index < len(final_res.outputs):

role,
reasoning_parser,
)
final_res = omni_outputs.request_output
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good — this was the missing assignment. But the same final_res is used in the logging block ~40 lines below without a None check, so audio/image-only requests still crash.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

audio/image the output_text should be "", and will not crash, anything wrong?

@hsliuustc0106
Copy link
Copy Markdown
Collaborator

fix dco please

if --enable-log-outputs --enable-log-requests in cli, it will result an
error of NoneType for none-stream requests

Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
@QiuMike QiuMike force-pushed the none_stream_fix_with_log branch from 2365996 to c34da1a Compare April 16, 2026 12:44
@QiuMike
Copy link
Copy Markdown
Contributor Author

QiuMike commented Apr 16, 2026

fix dco please

@hsliuustc0106 Done

@hsliuustc0106 hsliuustc0106 added the ready label to trigger buildkite CI label Apr 16, 2026
@hsliuustc0106 hsliuustc0106 merged commit 6b7be88 into vllm-project:main Apr 17, 2026
7 of 8 checks passed
lvliang-intel pushed a commit to lvliang-intel/vllm-omni that referenced this pull request Apr 20, 2026
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
lengrongfu pushed a commit to lengrongfu/vllm-omni that referenced this pull request May 1, 2026
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
clodaghwalsh17 pushed a commit to clodaghwalsh17/nm-vllm-omni-ent that referenced this pull request May 12, 2026
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
daixinning pushed a commit to daixinning/vllm-omni that referenced this pull request May 28, 2026
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
quyifei23 pushed a commit to quyifei23/vllm-omni that referenced this pull request Jun 6, 2026
Signed-off-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Mike_Qiu <qiudayu.qdy@antgroup.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants