{"record":{"id":"514565f730bc895a","repo":"kopia/kopia","slug":"create-directory","errorCode":null,"errorMessage":"create directory","messagePattern":"create directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"snapshot/restore/restore.go","lineNumber":281,"sourceCode":"\n\t\treturn onCompletion()\n\n\tdefault:\n\t\treturn errors.Errorf(\"invalid FS entry type for %q: %#v\", targetPath, e)\n\t}\n}\n\nfunc (c *copier) copyDirectory(ctx context.Context, d fs.Directory, targetPath string, currentdepth, maxdepth int32, onCompletion parallelwork.CallbackFunc) error {\n\tc.stats.RestoredDirCount.Add(1)\n\n\tif SafelySuffixablePath(targetPath) && currentdepth > maxdepth {\n\t\tde, ok := d.(snapshot.HasDirEntry)\n\t\tif !ok {\n\t\t\treturn errors.Errorf(\"fs.Directory '%s' object is not HasDirEntry?\", d.Name())\n\t\t}\n\n\t\tif err := c.shallowoutput.WriteDirEntry(ctx, targetPath, de.DirEntry(), d); err != nil {\n\t\t\treturn errors.Wrap(err, \"create directory\")\n\t\t}\n\n\t\treturn onCompletion()\n\t}\n\n\tif err := c.output.BeginDirectory(ctx, targetPath, d); err != nil {\n\t\treturn errors.Wrap(err, \"create directory\")\n\t}\n\n\tif c.deleteExtra {\n\t\t// deleting existing files only makes sense in the context of an actual filesystem (compared to a tar or zip)\n\t\tif fsOutput, isFileSystem := c.output.(*FilesystemOutput); isFileSystem {\n\t\t\tif err := c.deleteExtraFilesInDir(ctx, fsOutput, d, targetPath); err != nil {\n\t\t\t\treturn errors.Wrap(err, \"delete extra\")\n\t\t\t}\n\t\t}\n\t}\n","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/kopia/kopia/blob/82495e54b584c1ef6073c9e1be048f57f8aef078/snapshot/restore/restore.go#L263-L299","documentation":"Wrapper in copyDirectory's shallow path: WriteDirEntry on the shallow (tar/zip) output failed while emitting a placeholder directory entry for a subtree beyond maxdepth, so the shallow restore cannot represent that directory.","triggerScenarios":"Thrown at snapshot/restore/restore.go:281 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check target filesystem permissions and space.","Retry; if persistent, avoid shallow restore for this snapshot."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82495e54b584c1ef6073c9e1be048f57f8aef078","analyzedAt":"2026-09-07T20:35:21.689Z","contentChangedAt":"2026-09-07T20:35:21.689Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}