{"id":"29cebc9a19e91097","repo":"docker/cli","slug":"invalid-output-path-directory-q-does-not-exist","errorCode":null,"errorMessage":"invalid output path: directory %q does not exist","messagePattern":"invalid output path: directory %q does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/utils.go","lineNumber":66,"sourceCode":"\t\t\t// \"label != some-value\" conflicts with \"label = some-value\"\n\t\t\tif pruneFilters[\"label\"][v] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpruneFilters.Add(k, v)\n\t\tdefault:\n\t\t\tpruneFilters.Add(k, v)\n\t\t}\n\t}\n\n\treturn pruneFilters\n}\n\n// ValidateOutputPath validates the output paths of the \"docker cp\" command.\nfunc ValidateOutputPath(path string) error {\n\tdir := filepath.Dir(filepath.Clean(path))\n\tif dir != \"\" && dir != \".\" {\n\t\tif _, err := os.Stat(dir); os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"invalid output path: directory %q does not exist\", dir)\n\t\t}\n\t}\n\t// check whether `path` points to a regular file\n\t// (if the path exists and doesn't point to a directory)\n\tif fileInfo, err := os.Stat(path); !os.IsNotExist(err) {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif fileInfo.Mode().IsDir() || fileInfo.Mode().IsRegular() {\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := ValidateOutputPathFileMode(fileInfo.Mode()); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid output path: %q must be a directory or a regular file: %w\", path, err)\n\t\t}\n\t}\n\treturn nil","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/utils.go#L48-L84","documentation":"Error \"invalid output path: directory %q does not exist\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/utils.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}