siyuan-note/siyuan · error
notebook configuration is missing
Error message
notebook configuration is missing
What it means
This sentinel validation error fires in prepareBoxConfForSave when the box configuration pointer passed in is nil. SaveConf calls it while persisting a notebook's settings, so a nil conf means the caller attempted to save a notebook without a configuration object — a programming/initialization defect rather than bad user input, since a loaded notebook always has a BoxConf. The save is aborted so an empty or partially initialized struct is never written to disk, which would wipe fields such as BoxCrypt. Callers handle it via try-catch/propagation: the returned error surfaces through the SaveConf API call.
Source
Thrown at kernel/model/box_conf_crypto.go:90
}
func revealBoxMetadataIfUnlocked(boxID string, boxConf *conf.BoxConf) error {
clearBoxMetadata(boxConf)
dek, ok := cachedDEKCopy(boxID)
if !ok {
return nil
}
defer zeroAndClear(dek)
if err := decryptBoxMetadata(boxID, boxConf, dek); err != nil {
setEncryptedBoxState(boxID, EncryptedBoxStateError)
return err
}
return nil
}
func prepareBoxConfForSave(boxID string, boxConf *conf.BoxConf) (*conf.BoxConf, error) {
if boxConf == nil {
return nil, errors.New("notebook configuration is missing")
}
persisted := *boxConf
persisted.BoxCrypt = DeepCopyBoxEncryption(boxConf.BoxCrypt)
if persisted.Encrypted {
forgetRuntimeNormalBox(boxID)
}
if !persisted.Encrypted {
if IsEncryptedBox(boxID) {
return nil, errors.New("encrypted notebook cannot be saved as a normal notebook")
}
return &persisted, nil
}
if persisted.BoxCrypt == nil {
clearBoxMetadata(&persisted)
return &persisted, nil
}
if GetEncryptedBoxState(boxID) == EncryptedBoxStateError {
return nil, errors.New("encrypted notebook is in an error state")View on GitHub (pinned to 8641553a1f)
Solutions
- Check the caller that resolves the BoxConf for the notebook ID
- Ensure the notebook exists before attempting to save its configuration
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at kernel/model/box_conf_crypto.go:90 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11).
Data as JSON: /api/errors/20b95e6159167ae1.
Report an issue: GitHub.