{"id":"ca100d44cecf44e6","repo":"docker/cli","slug":"destination-s-s-must-be-a-directory","errorCode":null,"errorMessage":"destination \"%s:%s\" must be a directory","messagePattern":"destination \"(.+?):(.+?)\" must be a directory","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/container/cp.go","lineNumber":414,"sourceCode":"\t\t// not exist, but the parent directory does, the extraction will still\n\t\t// succeed.\n\t\t_ = err // Intentionally ignore stat errors (see above)\n\t}\n\n\tvar (\n\t\tcontent         io.ReadCloser\n\t\tresolvedDstPath string\n\t\tcopiedSize      int64\n\t\tcontentSize     int64\n\t\tsizeErr         error\n\t)\n\n\tif srcPath == \"-\" {\n\t\tcontent = os.Stdin\n\t\tresolvedDstPath = dstInfo.Path\n\t\tsizeErr = errors.New(\"content size not available for stdin\")\n\t\tif !dstInfo.IsDir {\n\t\t\treturn fmt.Errorf(`destination \"%s:%s\" must be a directory`, copyConfig.container, dstPath)\n\t\t}\n\t} else {\n\t\t// Prepare source copy info.\n\t\tsrcInfo, err := archive.CopyInfoSourcePath(srcPath, copyConfig.followLink)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcontentSize, sizeErr = localContentSize(srcInfo.Path)\n\n\t\tsrcArchive, err := archive.TarResource(srcInfo)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer srcArchive.Close()\n\n\t\t// With the stat info about the local source as well as the\n\t\t// destination, we have enough information to know whether we need to","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/container/cp.go#L396-L432","documentation":"Error \"destination \"%s:%s\" must be a directory\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/container/cp.go:414 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}