{"record":{"id":"39925ad074a2b0fd","repo":"portainer/portainer","slug":"failed-to-extract-dir-s","errorCode":null,"errorMessage":"Failed to extract dir %s","messagePattern":"Failed to extract dir (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/archive/targz.go","lineNumber":114,"sourceCode":"\n\tfor {\n\t\theader, err := tarReader.Next()\n\n\t\tif errors.Is(err, io.EOF) {\n\t\t\tbreak\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch header.Typeflag {\n\t\tcase tar.TypeDir:\n\t\t\t// skip, dir will be created with a file\n\t\tcase tar.TypeReg:\n\t\t\tp := filesystem.JoinPaths(outputDirPath, header.Name)\n\t\t\tif err := os.MkdirAll(filepath.Dir(p), 0o744); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed to extract dir %s\", filepath.Dir(p))\n\t\t\t}\n\t\t\toutFile, err := os.Create(p)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed to create file %s\", header.Name)\n\t\t\t}\n\t\t\tif _, err := io.Copy(outFile, tarReader); err != nil {\n\t\t\t\treturn fmt.Errorf(\"Failed to extract file %s\", header.Name)\n\t\t\t}\n\t\t\tlogs.CloseAndLogErr(outFile)\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"tar: unknown type: %v in %s\",\n\t\t\t\theader.Typeflag,\n\t\t\t\theader.Name)\n\t\t}\n\t}\n\n\treturn nil\n}","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/archive/targz.go#L96-L132","documentation":"Error \"Failed to extract dir %s\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/archive/targz.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}