siyuan-note/siyuan · warning
Conf.Language(26)
Error message
Conf.Language(26)
What it means
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.
Source
Thrown at kernel/model/repository.go:1677
return
}
index, err := repo.GetIndex(id)
if err != nil {
return
}
if err = repo.AddTag(index.ID, name); err != nil {
msg := fmt.Sprintf("Add tag to data snapshot [%s] failed: %s", index.ID, err)
util.PushStatusBar(msg)
return
}
return
}
func IndexRepo(memo string) (id string, err error) {
if 1 > len(Conf.Repo.Key) {
err = errors.New(Conf.Language(26))
return
}
memo = gulu.Str.RemoveInvisible(memo)
memo = strings.TrimSpace(memo)
if "" == memo {
err = errors.New(Conf.Language(142))
return
}
repo, err := newRepository()
if err != nil {
return
}
util.PushEndlessProgress(Conf.Language(143))
start := time.Now()View on GitHub (pinned to 251596fc0d)
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
Defensive patterns
Strategy: validation
Validate before calling
// Check repo key before calling IndexRepo
if 1 > len(model.Conf.Repo.Key) {
util.PushErrMsg(model.Conf.Language(26), 5000)
return
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- 26
- full-manual mode requires 'push' or 'pull' subcommand
- tool handler is not configured
- [%s] is not sub path of workspace
- Query notebook failed
AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12).
Data as JSON: /api/errors/2f58c2dfba6559ae.
Report an issue: GitHub.