AlistGo/alist · error · WrongArchivePassword

wrong archive password

Error message

wrong archive password

What it means

WrongArchivePassword indicates that decryption of an encrypted archive failed because the supplied password does not match. It is a sentinel in internal/errs/errors.go returned by archive extraction drivers when the decompressor rejects the credentials for an encrypted archive entry.

Source

Thrown at internal/errs/errors.go:24

	pkgerr "github.com/pkg/errors"
)

var (
	NotImplement = errors.New("not implement")
	NotSupport   = errors.New("not support")
	RelativePath = errors.New("access using relative path is not allowed")

	MoveBetweenTwoStorages = errors.New("can't move files between two storages, try to copy")
	UploadNotSupported     = errors.New("upload not supported")

	MetaNotFound     = errors.New("meta not found")
	StorageNotFound  = errors.New("storage not found")
	StreamIncomplete = errors.New("upload/download stream incomplete, possible network issue")
	StreamPeekFail   = errors.New("StreamPeekFail")

	UnknownArchiveFormat      = errors.New("unknown archive format")
	WrongArchivePassword      = errors.New("wrong archive password")
	DriverExtractNotSupported = errors.New("driver extraction not supported")
)

// NewErr wrap constant error with an extra message
// use errors.Is(err1, StorageNotFound) to check if err belongs to any internal error
func NewErr(err error, format string, a ...any) error {
	return fmt.Errorf("%w; %s", err, fmt.Sprintf(format, a...))
}

func IsNotFoundError(err error) bool {
	return errors.Is(pkgerr.Cause(err), ObjectNotFound) || errors.Is(pkgerr.Cause(err), StorageNotFound)
}

func IsNotSupportError(err error) bool {
	return errors.Is(pkgerr.Cause(err), NotSupport)
}
func IsNotImplement(err error) bool {
	return errors.Is(pkgerr.Cause(err), NotImplement)

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Re-enter the exact password, checking for leading/trailing whitespace
  2. Confirm the password field is actually transmitted (inspect the request payload key names for the archive API)
  3. Test the password locally with 7z/unzip to prove it is correct
  4. If the archive uses non-ASCII passwords created on another OS, check encoding expectations of the decompressor
Defensive patterns

Strategy: validation

Validate before calling

// verify password non-empty before the archive request
if strings.TrimSpace(password) == "" {
    return errs.WrongArchivePassword
}
req.Body.Password = password

Type guard

func isWrongArchivePassword(err error) bool {
    return err != nil && errors.Is(errors.Cause(err), errs.WrongArchivePassword)
}

Try / catch

err := extractWithPassword(ctx, src, dst, pw)
if isWrongArchivePassword(err) {
    // re-prompt for password; never retry with the same one
}

Prevention

When it happens

Trigger: Extracting (or listing contents of) a password-protected archive via the archive API while passing an empty or incorrect password in the decompress request; password-protected RAR/7z/ZIP entries checked during streaming extraction.

Common situations: Typing the wrong password; archive encrypted with a different password than expected; clipboard whitespace appended to the password; client sending the password field under the wrong JSON key so it arrives empty.

Related errors


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