{"record":{"id":"2f58c2dfba6559ae","repo":"siyuan-note/siyuan","slug":"conf-language-26","errorCode":null,"errorMessage":"Conf.Language(26)","messagePattern":"Conf\\.Language\\(26\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/repository.go","lineNumber":1677,"sourceCode":"\t\treturn\n\t}\n\n\tindex, err := repo.GetIndex(id)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tif err = repo.AddTag(index.ID, name); err != nil {\n\t\tmsg := fmt.Sprintf(\"Add tag to data snapshot [%s] failed: %s\", index.ID, err)\n\t\tutil.PushStatusBar(msg)\n\t\treturn\n\t}\n\treturn\n}\n\nfunc IndexRepo(memo string) (id string, err error) {\n\tif 1 > len(Conf.Repo.Key) {\n\t\terr = errors.New(Conf.Language(26))\n\t\treturn\n\t}\n\n\tmemo = gulu.Str.RemoveInvisible(memo)\n\tmemo = strings.TrimSpace(memo)\n\tif \"\" == memo {\n\t\terr = errors.New(Conf.Language(142))\n\t\treturn\n\t}\n\n\trepo, err := newRepository()\n\tif err != nil {\n\t\treturn\n\t}\n\n\tutil.PushEndlessProgress(Conf.Language(143))\n\n\tstart := time.Now()","sourceCodeStart":1659,"sourceCodeEnd":1695,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/repository.go#L1659-L1695","documentation":"The IndexRepo function creates a new local data snapshot by indexing all notebook content. It requires a data repo encryption key because the snapshot is encrypted with Conf.Repo.Key before storage. The guard at function entry returns the 'Please initialize the data repo key' error before any memo validation or indexing begins.","triggerScenarios":"Calling IndexRepo(memo) to create a snapshot when Conf.Repo.Key is empty. The function checks key length first, then memo validity, then instantiates the repository and calls repo.Index with a full content scan.","commonSituations":"A user triggers a manual snapshot or the first automatic sync fires before the repo key has been set up. Common on fresh installations where sync was configured but the key initialization step was skipped. The function also increments error counters when called from sync paths.","solutions":["Initialize the data repo key in Settings - Account & Sync - Local Data Repo - Data repo key before creating snapshots","If this error appears during automatic sync, initialize the key and the next sync cycle will succeed (planSyncAfter schedules a retry)","Import an existing key if you want the new snapshot to be compatible with data from another device"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check repo key before calling IndexRepo\nif 1 > len(model.Conf.Repo.Key) {\n    util.PushErrMsg(model.Conf.Language(26), 5000)\n    return\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prompt the user to initialize the repo key before allowing them to create snapshots","Disable the 'create snapshot' button in the UI until the key is set","For automatic indexing triggers, check key availability silently and skip rather than erroring"],"tags":["repo-key","index","snapshot","configuration"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}