{"record":{"id":"0d8e10f4728b120f","repo":"AlistGo/alist","slug":"wrong-archive-password","errorCode":null,"errorMessage":"wrong archive password","messagePattern":"wrong archive password","errorType":"exception","errorClass":"WrongArchivePassword","httpStatus":null,"severity":"error","filePath":"internal/errs/errors.go","lineNumber":24,"sourceCode":"\n\tpkgerr \"github.com/pkg/errors\"\n)\n\nvar (\n\tNotImplement = errors.New(\"not implement\")\n\tNotSupport   = errors.New(\"not support\")\n\tRelativePath = errors.New(\"access using relative path is not allowed\")\n\n\tMoveBetweenTwoStorages = errors.New(\"can't move files between two storages, try to copy\")\n\tUploadNotSupported     = errors.New(\"upload not supported\")\n\n\tMetaNotFound     = errors.New(\"meta not found\")\n\tStorageNotFound  = errors.New(\"storage not found\")\n\tStreamIncomplete = errors.New(\"upload/download stream incomplete, possible network issue\")\n\tStreamPeekFail   = errors.New(\"StreamPeekFail\")\n\n\tUnknownArchiveFormat      = errors.New(\"unknown archive format\")\n\tWrongArchivePassword      = errors.New(\"wrong archive password\")\n\tDriverExtractNotSupported = errors.New(\"driver extraction not supported\")\n)\n\n// NewErr wrap constant error with an extra message\n// use errors.Is(err1, StorageNotFound) to check if err belongs to any internal error\nfunc NewErr(err error, format string, a ...any) error {\n\treturn fmt.Errorf(\"%w; %s\", err, fmt.Sprintf(format, a...))\n}\n\nfunc IsNotFoundError(err error) bool {\n\treturn errors.Is(pkgerr.Cause(err), ObjectNotFound) || errors.Is(pkgerr.Cause(err), StorageNotFound)\n}\n\nfunc IsNotSupportError(err error) bool {\n\treturn errors.Is(pkgerr.Cause(err), NotSupport)\n}\nfunc IsNotImplement(err error) bool {\n\treturn errors.Is(pkgerr.Cause(err), NotImplement)","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/internal/errs/errors.go#L6-L42","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-enter the exact password, checking for leading/trailing whitespace","Confirm the password field is actually transmitted (inspect the request payload key names for the archive API)","Test the password locally with 7z/unzip to prove it is correct","If the archive uses non-ASCII passwords created on another OS, check encoding expectations of the decompressor"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify password non-empty before the archive request\nif strings.TrimSpace(password) == \"\" {\n    return errs.WrongArchivePassword\n}\nreq.Body.Password = password","typeGuard":"func isWrongArchivePassword(err error) bool {\n    return err != nil && errors.Is(errors.Cause(err), errs.WrongArchivePassword)\n}","tryCatchPattern":"err := extractWithPassword(ctx, src, dst, pw)\nif isWrongArchivePassword(err) {\n    // re-prompt for password; never retry with the same one\n}","preventionTips":["Prompt for the password rather than defaulting to empty","Trim whitespace from user input","Cache correct passwords per archive path","Test the password against the archive before batch extraction"],"tags":["archive","password","decompression"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}