siyuan-note/siyuan · error

encrypted attribute view in global storage

Error message

encrypted attribute view in global storage: %s

What it means

Global attribute-view definitions under data/storage/av must be plaintext JSON. If filelock.ReadFile returns data detected as ciphertext (encrypted content), the relink scan aborts because it cannot parse or safely rewrite references inside an encrypted view definition.

Solutions

  1. Restore the plaintext .json definition from backup or history
  2. Re-sync the workspace from a source that has the plaintext definition
  3. Recreate the attribute view and re-enter/relink its data if no backup exists

Example fix

// before
// data/storage/av/20240101120000-abc123.json contains ciphertext
// after
// restore plaintext from history dir
cp("history/.../20240101120000-abc123.json", "data/storage/av/20240101120000-abc123.json")
Defensive patterns

Strategy: validation

Validate before calling

// check AV definitions are plaintext JSON before relinking
data, _ := os.ReadFile(filepath.Join(dataDir, "storage", "av", id+".json"))
if util.IsCiphertext(data) || !json.Valid(data) {
	// restore from backup before proceeding
}

Prevention

When it happens

Trigger: scanViews reads storage/av/<id>.json and util.IsCiphertext(data) is true — i.e. the AV definition file was stored (or corrupted into) encrypted form in the global storage directory.

Common situations: Files copied from an encrypted notebook store into global storage by mistake; a custom sync tool encrypted storage/av contents; corruption that coincidentally looks like ciphertext.

Understand the failure class

Background: "Invalid JSON response" and "Failed to parse response" errors: when an API answers 200 but the body isn't the JSON your library expected — this error's family across 28 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/cee8dbacd689c281. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/asset_relink.go:312

			continue
		}
		abs := filepath.Join(dir, entry.Name())
		if err = p.observe(abs); err != nil {
			return err
		}
		p.reportProgress(abs)
		if entry.Type()&os.ModeSymlink != 0 {
			return fmt.Errorf("symbolic attribute view is not supported: %s", id)
		}
		if err = validateRelinkStoragePath(abs); err != nil {
			return err
		}
		data, err := filelock.ReadFile(abs)
		if err != nil {
			return err
		}
		if util.IsCiphertext(data) {
			return fmt.Errorf("encrypted attribute view in global storage: %s", id)
		}
		if !json.Valid(data) {
			return fmt.Errorf("invalid attribute view JSON: %s", id)
		}
		if !p.mayContainReferences(data) {
			continue
		}
		p.parsedViews++
		cache.RemoveAVData(id)
		view, err := av.ParseAttributeViewByPath(abs)
		if err != nil || view == nil || view.ID != id {
			return fmt.Errorf("cannot parse attribute view %s: %v", id, err)
		}
		before := len(p.result.References)
		if err = p.attributeView(view, apicontract.AssetReference{AvID: id, Path: "storage/av/" + entry.Name()}); err != nil {
			return err
		}
		if len(p.result.References) > before {

View on GitHub (pinned to 9f775e8a12)