AlistGo/alist · error

same-name dirs cannot be decompressed to

Error message

same-name dirs cannot be decompressed to

What it means

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.

Source

Thrown at drivers/alias/driver.go:312

		}
	}
	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. Choose a single-backend destination (unique key or raw mount path)
  2. Disable ProtectSameName to accept first-match writes
  3. Make merged mounts read-only and provide dedicated extraction targets

Example fix

# before
extract_out: /disk_a/extracted
extract_out: /disk_b/extracted

# after
extracted_a: /disk_a/extracted
Defensive patterns

Strategy: validation

Validate before calling

// Single-destination check for the extraction output dir
if len(d.pathMap[rootOf(dst)]) > 1 && d.ProtectSameName {
    return errors.New("extraction output mirrored; pick one backend")
}

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) {
    // re-run extraction targeting a concrete output directory
} else if err != nil { return err }

Prevention

When it happens

Trigger: ProtectSameName=true; destination key maps to several backends; output folder present in more than one of them; decompress targets the alias path.

Common situations: Extracting archives into a merged output mount mirrored across storages; batch-extract jobs writing into aggregated folders.

Related errors


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