{"record":{"id":"f01a54e91bbee3fb","repo":"googleapis/mcp-toolbox","slug":"directory-q-cannot-be-resolved-w","errorCode":null,"errorMessage":"directory %q cannot be resolved: %w","messagePattern":"directory %q cannot be resolved: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/cloudstorage/cloudstoragecommon/paths.go","lineNumber":148,"sourceCode":"\t}\n\tif filepath.IsAbs(rel) {\n\t\treturn \"\", fmt.Errorf(\"path %q must be relative\", rel)\n\t}\n\n\tcleanDest := filepath.Clean(filepath.Join(cleanDir, rel))\n\tout, err := escapes(cleanDir, cleanDest)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"path %q cannot be resolved within %q: %w\", rel, cleanDir, err)\n\t}\n\tif out {\n\t\treturn \"\", fmt.Errorf(\"path %q escapes configured directory %q\", rel, cleanDir)\n\t}\n\n\t// Repeat the check against the real targets. A symlink under cleanDir can\n\t// point anywhere, so the name-level check above proves nothing on its own.\n\tresolvedDir, err := ResolveSymlinks(cleanDir)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"directory %q cannot be resolved: %w\", cleanDir, err)\n\t}\n\tresolvedDest, err := ResolveSymlinks(cleanDest)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"path %q cannot be resolved: %w\", rel, err)\n\t}\n\tout, err = escapes(resolvedDir, resolvedDest)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"path %q cannot be resolved within %q: %w\", rel, cleanDir, err)\n\t}\n\tif out {\n\t\treturn \"\", fmt.Errorf(\"path %q resolves through a symbolic link to a target outside configured directory %q\", rel, cleanDir)\n\t}\n\treturn cleanDest, nil\n}\n","sourceCodeStart":130,"sourceCodeEnd":163,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragecommon/paths.go#L130-L163","documentation":"Wrap of a ResolveSymlinks failure on the configured directory during the second, symlink-aware containment pass in ResolveWithinDir: the real path of destination_dir could not be resolved (e.g. a broken symlink in the chain or an OS error).","triggerScenarios":"Thrown at internal/tools/cloudstorage/cloudstoragecommon/paths.go:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Repair or remove broken symlinks inside destination_dir","Point destination_dir at a real directory that resolves without error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}