modelcontextprotocol / modelcontextprotocol/java-sdk

NullPointerException in McpClientSession

未關閉
#605 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug P2
主要語言
Java
星號
3.7k
分支
1.1k
平均合併
1 天 15 小時
30 天內合併 PR
9

描述

Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create.
If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:

Bug description

In https://github.com/enola-dev/enola/issues/1862, I've run into:

java.lang.NullPointerException: data
	at java.base/java.util.Objects.requireNonNull(Objects.java:259)
	at reactor.core.publisher.FluxHandle$HandleSubscriber.next(FluxHandle.java:251)
	at io.modelcontextprotocol.spec.McpClientSession.lambda$sendRequest$12(McpClientSession.java:280)
	at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:113)
	at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)
	at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.onNext(FluxTimeout.java:181)
	at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:176)

I guess that this means that this is null?

Environment

0.14.1

Steps to reproduce

Unfortunately I'm unable to reproduce it locally even myself, but I am consistently seeing this on a failing CI build.

Expected behavior

Clear error message instead of NPE.

Minimal Complete Reproducible example

N/A

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 mcp-core/src/main/java/io/modelcontextprotocol/spec/McpClientSession.java 第 280 行開始,檢查與回報的 FluxHandle NPE 相關的 sendRequest 流程。以 enola-dev/enola#1862 中描述的故障和 0.14.1 環境作為背景;完成的條件是該故障不再產生資訊不足的 NPE,而是改為回報清楚的錯誤。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
api
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。