vmcp optimizer tool search permanently fails with FTS5 disk I/O error (6410) under operator security hardening
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 54/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, kubernetes, sqlite
- Lĩnh vực
- backend, databases, infrastructure
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 2.3k
- Fork
- 332
- Merge trung bình
- 19 giờ 39 phút
- Pull request đã merge (30 ngày)
- 174
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stacklok/toolhive
-
Reduce log spam of vMCP pod by logging cache sync messages at debugCó thể làm lại được @FOWEPJF255 đã nhận 8 ngày trước và không có pull request nào đang mở. Đang mởkubernetes
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
stacklok/toolhive#7109 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
stacklok/toolhive#6925 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
proxyrunner tool-filter middleware strips SEP-2322 Modern envelope from tools/list, breaking vMCP health checksCó thể làm lại được @alex-feel đã nhận 56 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
stacklok/toolhive#6684 · 5 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HttpClientBuilder.Build() ignores HTTP(S)_PROXY (auth-server OAuth/DCR calls bypass forward proxy)Có thể đã có người làm @schonmann đã nhận 46 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
stacklok/toolhive#6671 · 2 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Delete the dead pkg/vmcp/server/adapter packageCó thể làm lại được @suantea đã nhận 40 ngày trước và không có pull request nào đang mở. Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của stacklok/toolhive
Issue tương tự
-
type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
messaging/v1: IsGRPCProtocol and InternalMetadataToGrpcMetadata panic on empty or nil metadata valuesCó thể đã có người làm @patelshivani2283-lab đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
stacklok/toolhive-catalog#2024 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày