vmcp optimizer tool search permanently fails with FTS5 disk I/O error (6410) under operator security hardening
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go, kubernetes, sqlite
調査の方向性
Start by reading pkg/vmcp/optimizer/internal/toolstore/sqlite_store.go and pkg/container/kubernetes/security.go, then trace how the operator configures vmcp's read-only root filesystem and temporary storage. Reproduce the FTS5 find_tool failure under that configuration and compare the proposed writable /tmp mount with setting SQLite temp_store to MEMORY. Done means optimizer search works with the intended hardened setup and has coverage for the failure scenario.
索引モデルが issue の本文から書いたものです。
説明
Environment
- ToolHive operator on Kubernetes, operator and vmcp images v0.66.0
VirtualMCPServerwithoptimizer.enabled(embedding service configured viaembeddingService)- Session storage: Redis provider (Dragonfly), single replica
What happens
On the vmcp gateway, find_tool fails on every call, on every fresh session, for every client:
find_tool failed: tool search failed: FTS5 query failed: disk I/O error (6410)
Direct call_tool execution by name works fine, so only tool discovery (the optimizer's search path) is affected. The failure persists across pod restarts and gateway version bumps (observed continuously on v0.63–v0.66 deploys over ~2 weeks).
Diagnosis
- Extended code 6410 is
SQLITE_IOERR_GETTEMPPATH: the VFS could not resolve a writable directory for temporary files. - The optimizer tool store is an in-memory SQLite database (
file:memdb?mode=memory&cache=shared) with FTS5, frompkg/vmcp/optimizer/internal/toolstore/sqlite_store.go. FTS5 queries spill to file-backed temp storage (temp_storedefaults to FILE), andos.TempDir()has nowhere usable to go. - The operator hardens vmcp containers with
readOnlyRootFilesystem: true(pkg/container/kubernetes/security.go) and setsHOME=/tmp/XDG_CONFIG_HOME=/tmp, but does not mount a writable volume at/tmp. The image's/tmpis on the read-only rootfs.
Evidence from the running pod (ephemeral container probe):
HOME=/tmp
XDG_CONFIG_HOME=/tmp
# ls -ld /proc/1/root/tmp
drwxrwxrwt 2 root root 6 ... /proc/1/root/tmp
# touch /proc/1/root/tmp/zprobe
touch: /proc/1/root/tmp/zprobe: Read-only file system
And the gateway serves a healthy MCP session at the same time (fresh initialize → tools/list → reuse all 200), so the failure is isolated to the search path needing temp files.
Workaround
Adding an emptyDir at /tmp through the CRD's podTemplateSpec fixes it — that patch is applied as a strategic merge, so it combines cleanly with operator-set fields:
podTemplateSpec:
spec:
containers:
- name: vmcp
volumeMounts:
- mountPath: /tmp
name: vmcp-tmp
volumes:
- name: vmcp-tmp
emptyDir: {}
Suggestion
Since the operator already points HOME and XDG_CONFIG_HOME at /tmp, it should probably mount a writable emptyDir there for vmcp by default when the rootfs is read-only. Alternatively, the tool store could set temp_store=MEMORY for the memdb so FTS5 never touches the filesystem — the store is in-memory anyway, and that would keep the hardening untouched.
- 主要言語
- Go
- スター
- 2.3k
- フォーク
- 332
- 平均マージ
- 19時間 39分
- マージ済み PR(30日)
- 174
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stacklok/toolhive のほかの issue
-
Reduce log spam of vMCP pod by logging cache sync messages at debug再び着手できるかも @FOWEPJF255 が 8 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンkubernetes
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
stacklok/toolhive#7109 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
stacklok/toolhive#6925 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
proxyrunner tool-filter middleware strips SEP-2322 Modern envelope from tools/list, breaking vMCP health checks再び着手できるかも @alex-feel が 56 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
stacklok/toolhive#6684 · コメント 5 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
HttpClientBuilder.Build() ignores HTTP(S)_PROXY (auth-server OAuth/DCR calls bypass forward proxy)対応中かも @schonmann が 46 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
stacklok/toolhive#6671 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Delete the dead pkg/vmcp/server/adapter package再び着手できるかも @suantea が 40 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンneeds-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
stacklok/toolhive の issue をすべて見る
似ている issue
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
messaging/v1: IsGRPCProtocol and InternalMetadataToGrpcMetadata panic on empty or nil metadata values対応中かも @patelshivani2283-lab が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
stacklok/toolhive-catalog#2024 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信