AlistGo/alist · error

same-name files cannot be decompressed

Error message

same-name files cannot be decompressed

What it means

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.

Source

Thrown at drivers/alias/driver.go:305

					link.Concurrency = d.DownloadConcurrency
				}
				if d.DownloadPartSize > 0 {
					link.PartSize = d.DownloadPartSize * utils.KB
				}
			}
			return link, nil
		}
	}
	return nil, errs.NotImplement
}

func (d *Alias) ArchiveDecompress(ctx context.Context, srcObj, dstDir model.Obj, args model.ArchiveDecompressArgs) error {
	if !d.Writable {
		return errs.PermissionDenied
	}
	srcPath, err := d.getReqPath(ctx, srcObj, false)
	if errs.IsNotImplement(err) {
		return errors.New("same-name files cannot be decompressed")
	}
	if err != nil {
		return err
	}
	dstPath, err := d.getReqPath(ctx, dstDir, true)
	if errs.IsNotImplement(err) {
		return errors.New("same-name dirs cannot be decompressed to")
	}
	if err != nil {
		return err
	}
	_, err = fs.ArchiveDecompress(ctx, *srcPath, *dstPath, args)
	return err
}

var _ driver.Driver = (*Alias)(nil)

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Extract via the underlying storage mount or a unique alias key
  2. Disable ProtectSameName (first match wins)
  3. Deduplicate mirrored archives before extracting through the alias

Example fix

// before
fs.ArchiveDecompress(ctx, "/alias/data/bundle.zip", "/alias/out", args)

// after
fs.ArchiveDecompress(ctx, "/netdisk_a/docs/bundle.zip", "/netdisk_a/out", args)
Defensive patterns

Strategy: validation

Validate before calling

// Ensure the archive resolves to exactly one backend before decompress
if len(d.pathMap[rootOf(src)]) > 1 && d.ProtectSameName {
    return errors.New("archive mirrored; extract via a concrete mount")
}

Type guard

// Go
func isSameNameErr(err error) bool {
    return err != nil && strings.Contains(err.Error(), "same-name")
}

Try / catch

if err := d.ArchiveDecompress(ctx, src, dst, args); isSameNameErr(err) {
    // extract directly from /netdisk_a/... path
} else if err != nil { return err }

Prevention

When it happens

Trigger: ProtectSameName=true; same-key multi-destination mapping; the archive file resolves in two or more backends; decompress requested through the alias.

Common situations: Mirrored archives (e.g. backups replicated to several storages) browsed via one merged alias; user right-click-extracts a zip through the alias UI.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/7c6600858e6daad6. Report an issue: GitHub.