{"record":{"id":"c54163611167b141","repo":"siyuan-note/siyuan","slug":"incorrect-master-password","errorCode":null,"errorMessage":"Incorrect master password","messagePattern":"Incorrect master password","errorType":"http","errorClass":null,"httpStatus":200,"severity":"error","filePath":"kernel/model/crypto.go","lineNumber":1007,"sourceCode":"\n\thasEncrypted, listErr := hasEncryptedNotebook()\n\tif listErr != nil {\n\t\treturn fmt.Errorf(\"list encrypted notebooks failed: %w\", listErr)\n\t}\n\thasHistory, historyErr := scanEncryptedNotebookHistory()\n\tif historyErr != nil {\n\t\treturn fmt.Errorf(\"check encrypted notebook history failed: %w\", historyErr)\n\t}\n\thasBackup := filelock.IsExist(dataCryptoBackupPath())\n\tif hasEncrypted || hasHistory || hasBackup {\n\t\t// 现存笔记本、已删除笔记本历史或全局备份均表示已有密钥域，必须恢复并认证，不能生成新 MasterSalt。\n\t\tkek, restoreErr := tryRestoreNotebookCryptoFromBackupLocked(password)\n\t\tif kek != nil {\n\t\t\tzeroAndClear(kek)\n\t\t}\n\t\tif restoreErr != nil {\n\t\t\tif strings.Contains(restoreErr.Error(), Conf.Language(311)) {\n\t\t\t\treturn errors.New(Conf.Language(311))\n\t\t\t}\n\t\t\treturn errors.New(Conf.Language(315))\n\t\t}\n\t\tlogging.LogInfof(\"encrypted notebook re-enabled with authenticated recovery key material\")\n\t\treturn nil\n\t}\n\n\t// 不存在任何密钥依赖或备份时生成新的 MasterSalt。\n\tsalt, err := util.GenerateSalt()\n\tif err != nil {\n\t\treturn err\n\t}\n\tConf.m.RLock()\n\tkdfParams := Conf.NotebookCrypto.KDFParams\n\tConf.m.RUnlock()\n\tparams, validErr := util.ValidateArgon2Params(kdfParams)\n\tif validErr != nil {\n\t\treturn validErr","sourceCodeStart":989,"sourceCodeEnd":1025,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/afa823b6b4e4f183511e0bc0a3be93caa94c7c97/kernel/model/crypto.go#L989-L1025","documentation":"Error \"Incorrect master password\" thrown in siyuan-note/siyuan.","triggerScenarios":"Thrown at kernel/model/crypto.go:1007 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enter the original master password that was used when the encrypted notebook feature was first enabled.","If you forgot it, restore the data from a device or backup that still has the correct key material; the password cannot be recovered."],"exampleFix":"Re-enter the master password carefully; the KEK verifier check failed, which means the password is wrong or the backup was replaced. Restore the original backup if the password is believed correct.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afa823b6b4e4f183511e0bc0a3be93caa94c7c97","analyzedAt":"2026-08-18T17:04:10.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}