flipped-aurora/gin-vue-admin · error
等待 MCP 独立服务启动超时,请查看日志: %s
Error message
等待 MCP 独立服务启动超时,请查看日志: %s
What it means
waitForManagedProcess gives up when the start deadline (mcpStartWaitTimeout) expires without the standalone MCP process ever becoming reachable via health checks. The error includes the log file path so developers can diagnose why startup never completed.
Source
Thrown at server/mcp/standalone_manager.go:280
if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices {
return true, nil
}
return false, fmt.Errorf("MCP 健康检查失败: %s", resp.Status)
}
func waitForManagedProcess(ctx context.Context, meta *managedProcessMeta) (ManagedStandaloneStatus, error) {
deadline := time.NewTimer(mcpStartWaitTimeout)
ticker := time.NewTicker(300 * time.Millisecond)
defer deadline.Stop()
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return GetManagedStandaloneStatus(context.Background()), ctx.Err()
case <-deadline.C:
return GetManagedStandaloneStatus(context.Background()), fmt.Errorf("等待 MCP 独立服务启动超时,请查看日志: %s", meta.LogPath)
case <-ticker.C:
current := GetManagedStandaloneStatus(context.Background())
if current.Reachable {
return current, nil
}
if meta.PID > 0 && !processExists(meta.PID) {
return current, fmt.Errorf("MCP 独立进程已退出,请查看日志: %s", meta.LogPath)
}
}
}
}
func resolveManagedStartCommand() (string, []string, string, string, error) {
serverRoot := resolveMCPServerRoot()
if serverRoot == "" {
return "", nil, "", "", errors.New("未找到 server 根目录,无法启动 MCP 独立服务")
}
View on GitHub (pinned to 3136500ef3)
Solutions
- Open meta.LogPath referenced in the message — startup errors (port in use, bad config, panic) are written there.
- Verify the config at GVA_MCP_CONFIG path: port free (lsof -i :port), DB/Redis reachable.
- Increase mcpStartWaitTimeout if the environment is legitimately slow to start.
- Run the binary manually with the same -config flag to see the error directly.
Example fix
// before GVA_MCP_CONFIG=/etc/gva/mcp.yaml ./server-mcp -config /etc/gva/mcp.yaml // after: verify config and port first GVA_MCP_CONFIG=/etc/gva/mcp.yaml ./server-mcp -config /etc/gva/mcp.yaml # then: ss -ltnp | grep <configured-port> (is it bound? is it the right port?)
Defensive patterns
Strategy: fallback
Validate before calling
// validate config before attempting a managed start
cfg, err := os.ReadFile(configPath)
if err != nil { return fmt.Errorf("GVA_MCP_CONFIG unreadable: %w", err) }
if port := extractPort(cfg); !portFree(port) {
return fmt.Errorf("port %d already in use", port)
} Try / catch
status, err := StartManagedStandalone(ctx)
if err != nil && strings.Contains(err.Error(), "超时") {
// fallback: read the log file cited in the error and surface it
if logs, lerr := os.ReadFile(meta.LogPath); lerr == nil {
log.Printf("mcp start timed out; log tail: %s", tail(logs, 50))
}
return err
} Prevention
- Always check the log file path from the error before retrying blindly.
- Pre-check that the configured port is free.
- Keep mcpStartWaitTimeout generous for slow/cold environments.
- Validate GVA_MCP_CONFIG schema at boot (DB/Redis addresses reachable).
When it happens
Trigger: StartManagedStandalone spawns the process, cmd.Start succeeds, but repeated GetManagedStandaloneStatus polls never report Reachable before the deadline: config errors, port binding failure, DB connect failure, or extremely slow startup (slow disk, cold build).
Common situations: Wrong GVA_MCP_CONFIG (bad port, occupied port, unreachable DB/Redis); binary panics on boot but slowly; firewall silently drops health probes; system under heavy load making startup exceed the timeout.
Related errors
- MCP 健康检查失败: %s
- LLM stream request timed out
- 未找到 MCP 独立配置文件,请在当前目录、cmd/mcp 目录或通过 -config / GVA_MCP_CONFIG
- 未能自动识别项目根目录,请在 MCP 配置中设置 autocode.root
- go.mod 中未找到 module 定义
AI-assisted analysis of flipped-aurora/gin-vue-admin@3136500ef3 (2026-08-31).
Data as JSON: /api/errors/1e93d60d54b228db.
Report an issue: GitHub.