From 0803d7db92da1d02331f86d263190362cb155320 Mon Sep 17 00:00:00 2001 From: kappa Date: Sun, 8 Feb 2026 11:21:08 +0900 Subject: [PATCH] Fix health check: DB file is always local, not remote In REMOTE_MODE the SQLite database lives inside the MCP container, not on the remote HAProxy host. Check db_file with os.path.exists instead of remote_file_exists. Co-Authored-By: Claude Opus 4.6 --- haproxy_mcp/tools/health.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/haproxy_mcp/tools/health.py b/haproxy_mcp/tools/health.py index fbea193..45c33c5 100644 --- a/haproxy_mcp/tools/health.py +++ b/haproxy_mcp/tools/health.py @@ -90,7 +90,11 @@ def register_health_tools(mcp): files_ok = True file_status: dict[str, str] = {} for name, path in [("map_file", MAP_FILE), ("db_file", DB_FILE)]: - exists = remote_file_exists(path) if REMOTE_MODE else __import__('os').path.exists(path) + # DB file is always local (SQLite runs in MCP container), map_file may be remote + if name == "db_file" or not REMOTE_MODE: + exists = __import__('os').path.exists(path) + else: + exists = remote_file_exists(path) if exists: file_status[name] = "ok" else: