{"record":{"id":"c0d0244cc9f99a2a","repo":"AlistGo/alist","slug":"library-password-not-configured","errorCode":null,"errorMessage":"library password not configured","messagePattern":"library password not configured","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/seafile/util.go","lineNumber":142,"sourceCode":"\t\t\tname = fmt.Sprintf(\"%s (%d)\", name, index)\n\t\t}\n\t\tif _, exist := libraryMap[name]; exist {\n\t\t\tputLibraryMap(library, index+1)\n\t\t} else {\n\t\t\tlibraryInfo := LibraryInfo{}\n\t\t\tdata, _ := utils.Json.Marshal(library)\n\t\t\t_ = utils.Json.Unmarshal(data, &libraryInfo)\n\t\t\tlibraryMap[name] = &libraryInfo\n\t\t}\n\t}\n\tfor _, library := range resp {\n\t\tputLibraryMap(library, 0)\n\t}\n\td.libraryMap = libraryMap\n\treturn resp, nil\n}\n\nvar repoPwdNotConfigured = errors.New(\"library password not configured\")\nvar repoPwdIncorrect = errors.New(\"library password is incorrect\")\n\nfunc (d *Seafile) decryptLibrary(repo *LibraryInfo) (err error) {\n\tif !repo.Encrypted {\n\t\treturn nil\n\t}\n\tif d.RepoPwd == \"\" {\n\t\treturn repoPwdNotConfigured\n\t}\n\tnow := time.Now()\n\tdecryptedTime := repo.decryptedTime\n\tif repo.decryptedSuccess {\n\t\tif now.Sub(decryptedTime).Minutes() <= 30 {\n\t\t\treturn nil\n\t\t}\n\t} else {\n\t\tif now.Sub(decryptedTime).Seconds() <= 10 {\n\t\t\treturn repoPwdIncorrect","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/seafile/util.go#L124-L160","documentation":"Returned by the Seafile driver when it needs to read an encrypted library but the storage configuration has no library password set (d.RepoPwd == \"\"). Seafile encrypts encrypted libraries client-side, so the driver must submit a per-library password before the API will return readable content; without it, decryption of any encrypted library fails fast.","triggerScenarios":"Mounting a Seafile storage whose account contains at least one library with Encrypted=true, while the driver addition field 'library password' (RepoPwd) is empty. First List/Get on that library calls decryptLibrary and hits the guard.","commonSituations":"Freshly added Seafile storage where only username/password were filled in; password field lost after re-saving the storage config; multi-library accounts where one library was later encrypted on the server.","solutions":["Open the storage settings and set the Seafile library password (RepoPwd) matching the encrypted library","If multiple encrypted libraries with different passwords exist, note the driver supports only one password — encrypt them with the same password or remove the extra encrypted libraries","Verify the password by decrypting the library in the Seafile web UI with the same credential"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before mounting, check for encrypted libraries without a password\nlibs, _ := seafileDriver.ListLibraries()\nfor _, l := range libs {\n    if l.Encrypted && strings.TrimSpace(driverAddition.RepoPwd) == \"\" {\n        return fmt.Errorf(\"library %s is encrypted: set the library password in storage settings\", l.Name)\n    }\n}","typeGuard":"func needsPassword(l LibraryInfo) bool { return l.Encrypted }","tryCatchPattern":"err := d.List(ctx, dir, args)\nif err != nil && strings.Contains(err.Error(), \"library password not configured\") {\n    return fmt.Errorf(\"seafile library %q is encrypted — configure its password in the storage addition\", dir.GetPath())\n}","preventionTips":["Set the library password at storage creation time if any library is encrypted","Use one shared password across encrypted libraries so the single-field config works","Surface encrypted-library inventory in a pre-mount validation step"],"tags":["seafile","encryption","config","credentials"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}