{"record":{"id":"7c6600858e6daad6","repo":"AlistGo/alist","slug":"same-name-files-cannot-be-decompressed","errorCode":null,"errorMessage":"same-name files cannot be decompressed","messagePattern":"same-name files cannot be decompressed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/alias/driver.go","lineNumber":305,"sourceCode":"\t\t\t\t\tlink.Concurrency = d.DownloadConcurrency\n\t\t\t\t}\n\t\t\t\tif d.DownloadPartSize > 0 {\n\t\t\t\t\tlink.PartSize = d.DownloadPartSize * utils.KB\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn link, nil\n\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":287,"sourceCodeEnd":322,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/alias/driver.go#L287-L322","documentation":"Returned by Alias.ArchiveDecompress when the SOURCE archive file cannot be uniquely resolved: getReqPath(srcObj) fails with errs.NotImplement because ProtectSameName is on and the archive exists in multiple destinations under the same alias key.","triggerScenarios":"ProtectSameName=true; same-key multi-destination mapping; the archive file resolves in two or more backends; decompress requested through the alias.","commonSituations":"Mirrored archives (e.g. backups replicated to several storages) browsed via one merged alias; user right-click-extracts a zip through the alias UI.","solutions":["Extract via the underlying storage mount or a unique alias key","Disable ProtectSameName (first match wins)","Deduplicate mirrored archives before extracting through the alias"],"exampleFix":"// before\nfs.ArchiveDecompress(ctx, \"/alias/data/bundle.zip\", \"/alias/out\", args)\n\n// after\nfs.ArchiveDecompress(ctx, \"/netdisk_a/docs/bundle.zip\", \"/netdisk_a/out\", args)","handlingStrategy":"validation","validationCode":"// Ensure the archive resolves to exactly one backend before decompress\nif len(d.pathMap[rootOf(src)]) > 1 && d.ProtectSameName {\n    return errors.New(\"archive mirrored; extract via a concrete mount\")\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    // extract directly from /netdisk_a/... path\n} else if err != nil { return err }","preventionTips":["Extract archives through the mount that actually stores them","Keep mirrored archives under unique keys","Confirm the destination is also unambiguous before starting extraction"],"tags":["alias","protect-same-name","archive","extract"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}