{"record":{"id":"3848d4192f9adc40","repo":"AlistGo/alist","slug":"same-name-dirs-cannot-be-decompressed-to","errorCode":null,"errorMessage":"same-name dirs cannot be decompressed to","messagePattern":"same-name dirs cannot be decompressed to","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/alias/driver.go","lineNumber":312,"sourceCode":"\t\t}\n\t}\n\treturn nil, errs.NotImplement\n}\n\nfunc (d *Alias) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) error {\n\tif !d.Writable {\n\t\treturn errs.PermissionDenied\n\t}\n\tsrcPath, err := d.getReqPath(ctx, srcObj, false)\n\tif errs.IsNotImplement(err) {\n\t\treturn errors.New(\"same-name files cannot be decompressed\")\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tdstPath, err := d.getReqPath(ctx, dstDir, true)\n\tif errs.IsNotImplement(err) {\n\t\treturn errors.New(\"same-name dirs cannot be decompressed to\")\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = fs.ArchiveDecompress(ctx, *srcPath, *dstPath, args)\n\treturn err\n}\n\nvar _ driver.Driver = (*Alias)(nil)\n","sourceCodeStart":294,"sourceCodeEnd":322,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/alias/driver.go#L294-L322","documentation":"Returned by Alias.ArchiveDecompress when the decompression DESTINATION directory is ambiguous: getReqPath(dstDir) fails with errs.NotImplement because ProtectSameName is on and the output folder exists in multiple destinations mapped under the same alias key.","triggerScenarios":"ProtectSameName=true; destination key maps to several backends; output folder present in more than one of them; decompress targets the alias path.","commonSituations":"Extracting archives into a merged output mount mirrored across storages; batch-extract jobs writing into aggregated folders.","solutions":["Choose a single-backend destination (unique key or raw mount path)","Disable ProtectSameName to accept first-match writes","Make merged mounts read-only and provide dedicated extraction targets"],"exampleFix":"# before\nextract_out: /disk_a/extracted\nextract_out: /disk_b/extracted\n\n# after\nextracted_a: /disk_a/extracted","handlingStrategy":"validation","validationCode":"// Single-destination check for the extraction output dir\nif len(d.pathMap[rootOf(dst)]) > 1 && d.ProtectSameName {\n    return errors.New(\"extraction output mirrored; pick one backend\")\n}","typeGuard":"// Go\nfunc isSameNameErr(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"same-name\")\n}","tryCatchPattern":"if err := d.ArchiveDecompress(ctx, src, dst, args); isSameNameErr(err) {\n    // re-run extraction targeting a concrete output directory\n} else if err != nil { return err }","preventionTips":["Make extraction output folders single-backend by construction","Estimate output size first; ambiguous targets also waste space on mirrors","Reserve merged mounts strictly for reading"],"tags":["alias","protect-same-name","archive","destination"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}