siyuan-note/siyuan · error
Conf.Language(314)
Error message
Conf.Language(314)
What it means
After locating the repo file, readRepoFileWithAssets checks whether the file belongs to an encrypted notebook (encryptedBoxIDFromRepoPath) and, if that box is not currently unlocked, returns the localized message Conf.Language(314) ('encrypted notebook is locked' family). Encrypted notebooks keep their content ciphertext on disk; reading repo snapshots of their files is blocked until the user supplies the passphrase.
Source
Thrown at kernel/model/asset_download.go:385
}
// readRepoFileWithAssets 将仓库实例的创建和历史分块补齐纳入来源读锁。
func readRepoFileWithAssets(fileID string) ([]byte, *entity.File, error) {
assetDownloadSourceMu.RLock()
defer assetDownloadSourceMu.RUnlock()
if Conf.Repo == nil || len(Conf.Repo.Key) == 0 {
return nil, nil, errors.New(Conf.Language(26))
}
repo, err := newRepositoryWithAssetSourceLocked()
if err != nil {
return nil, nil, err
}
file, err := repo.GetFile(fileID)
if err != nil {
return nil, nil, err
}
if boxID := encryptedBoxIDFromRepoPath(file.Path); boxID != "" && !IsBoxUnlocked(boxID) {
return nil, nil, errors.New(Conf.Language(314))
}
data, err := openRepoFileWithAssets(repo, file)
return data, file, err
}
func ensureRepoSnapshotComplete(repo *dejavu.Repo, indexID string) error {
index, err := repo.GetIndex(indexID)
if err != nil {
return err
}
return repo.GetFilesIter(index, func(file *entity.File) error {
if !repoFileNeedsDownload(file) {
return nil
}
if err := checkAssetDownloadAccess(); err != nil {
return err
}
handleCloudError := cloudRepoErrorHandler()View on GitHub (pinned to 8641553a1f)
Solutions
- Unlock the encrypted notebook in the UI (enter its passphrase) and retry the operation
- Call the box unlock API (e.g. UnlockBox with the password) programmatically before the read
- Check IsBoxUnlocked(boxID) first and surface a 'please unlock the notebook' message instead of calling the API
- If the passphrase is forgotten, restore content from a device where the box is unlocked or from backups
Example fix
// before
data, err := model.GetRepoFile(fileID) // notebook locked
// after
if boxLocked {
if err := model.UnlockBox(boxID, password); err != nil { return err }
}
data, err := model.GetRepoFile(fileID) Defensive patterns
Strategy: validation
Validate before calling
if model.IsEncryptedBox(boxID) && !model.IsBoxUnlocked(boxID) {
return errors.New("unlock the encrypted notebook before reading repo files")
} Try / catch
data, err := model.GetRepoFile(fileID)
if err != nil && strings.Contains(err.Error(), conf.Conf.Language(314)) {
util.PushMsg("please unlock the encrypted notebook", 5000)
return err
} Prevention
- Check IsBoxUnlocked before any repo-file API on encrypted boxes
- Avoid scripts touching encrypted boxes at startup before unlock
- Set an auto-lock interval compatible with your workflow
- Surface the localized 314 message to users instead of raw errors
When it happens
Trigger: GetRepoFile / RollbackRepoSnapshotFile / OpenRepoSnapshotFile / ExportRepoFile targeting a file whose path maps to an encrypted box, executed while the box is in locked state (after app start, after auto-lock, or before entering the password).
Common situations: User opens snapshot history for a doc inside an encrypted notebook that auto-locked after inactivity; a script or plugin reads repo files at startup before any box unlock; exporting a repo snapshot file from a locked encrypted notebook.
Related errors
- encrypted notebook is not accessible
- %s
- Conf.Language(314)
- no DEK cached for box
- encrypted notebook is locked, please unlock it first
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/d9f62832d28146cc.
Report an issue: GitHub.