mickael-kerjean/filestash · error

No such file or directory

Error message

No such file or directory

What it means

A generic sentinel error returned by ToolFSCd when userSession.Backend.Ls(path) fails for the target directory. It replaces whatever the real backend error was (missing directory, permission denial, backend outage), so the message may not reflect the actual cause; the faulting input is the resolved 'path' parameter.

Source

Thrown at server/plugin/plg_handler_mcp/impl/tools_fs.go:314

		},
	}, nil
}

func ToolFSPwd(params map[string]any, userSession *UserSession) (*ToolResponse, error) {
	return &ToolResponse{
		Content: []TextContent{
			{
				Type: "text",
				Text: userSession.CurrDir,
			},
		},
	}, nil
}

func ToolFSCd(params map[string]any, userSession *UserSession) (*ToolResponse, error) {
	path := EnforceDirectory(getPath(params, userSession, "path"))
	if _, err := userSession.Backend.Ls(path); err != nil {
		return nil, errors.New("No such file or directory")
	}
	userSession.CurrDir = EnforceDirectory(path)
	return &ToolResponse{
		Content: []TextContent{
			{
				Type: "text",
				Text: userSession.CurrDir,
			},
		},
	}, nil
}

func ToolFSMv(params map[string]any, userSession *UserSession) (*ToolResponse, error) {
	if isArgEmpty(params, "from") || isArgEmpty(params, "to") {
		return nil, ErrNotValid
	}
	if err := userSession.Backend.Mv(
		getPath(params, userSession, "from"),

View on GitHub (pinned to 78f756eb94)

Solutions

  1. Verify the 'path' parameter resolves to an existing directory on the configured backend
  2. Check backend credentials/permissions allow listing the target directory
  3. Log or wrap the original Ls error so real causes (not_found vs permission denied) are distinguishable
  4. Test the same path directly against the backend to isolate MCP-layer issues
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at server/plugin/plg_handler_mcp/impl/tools_fs.go:314 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of mickael-kerjean/filestash@78f756eb94 (2026-09-06). Data as JSON: /api/errors/7046226f13287444. Report an issue: GitHub.