siyuan-note/siyuan · warning

attribute view spec is too new

Error message

attribute view spec is too new

What it means

Sentinel ErrSpecTooNew (AV overload). Returned by CheckSpec (av/av_fix.go:48) when an AV JSON carries a Spec field greater than CurrentSpec (7), and by parseAttributeViewSearchInfo which calls CheckSpec on the parsed spec. It means the AV was written by a newer SiYuan than the running kernel can read.

Source

Thrown at kernel/av/av.go:1301

		}
	}
	return
}

func GetAttributeViewI18n(key string) string {
	return util.AttrViewLangs[util.Lang][key].(string)
}

var (
	ErrAttributeViewNotFound  = errors.New("attribute view not found")
	ErrInvalidAttributeViewID = errors.New("invalid attribute view id")
	ErrInvalidBoxID           = errors.New("invalid box id")
	ErrViewNotFound           = errors.New("view not found")
	ErrKeyNotFound            = errors.New("key not found")
	ErrItemNotFound           = errors.New("item not found")
	ErrWrongLayoutType        = errors.New("wrong layout type")
	ErrInvalidColumnAlign     = errors.New("invalid column align")
	ErrSpecTooNew             = errors.New("attribute view spec is too new")
	ErrFilterTooDeep          = errors.New("filter nesting depth exceeds the maximum allowed")
)

const (
	NodeAttrNameAvs        = "custom-avs"                 // 用于标记块所属的属性视图,逗号分隔 av id
	NodeAttrView           = "custom-sy-av-view"          // 用于标记块所属的属性视图视图 view id Database block support specified view https://github.com/siyuan-note/siyuan/issues/10443
	NodeAttrVisibleViewIDs = "custom-sy-av-visible-views" // 用于标记数据库块显示的视图 ID,逗号分隔
	NodeAttrViewStaticText = "custom-sy-av-s-text"        // 用于标记块所属的属性视图静态文本 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049

	NodeAttrViewNames = "av-names" // 用于临时标记块所属的属性视图名称,空格分隔
)

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Upgrade the running SiYuan kernel to a version whose CurrentSpec is >= the AV's spec, then re-open.
  2. If upgrading is impossible, re-create the database in the older version (data written by the older version will have a compatible spec).
  3. Do not manually lower the spec field — that can leave the AV in an inconsistent state.
  4. Check the API surface: api/av.go:1324 maps this to a user-facing message for the frontend.

Example fix

// before
// workspace saved by SiYuan spec-8, opened in spec-7 kernel -> spec too new

// after: upgrade the kernel
//   install a SiYuan build whose av.CurrentSpec >= AV.Spec, then reopen the workspace
// (no code change; this is a version-compatibility issue)
Defensive patterns

Strategy: fallback

Validate before calling

// Detect incompatibility before opening
if avSpec > av.CurrentSpec {
    return fmt.Errorf("AV spec %d > kernel %d; upgrade required", avSpec, av.CurrentSpec)
}

Try / catch

if _, err := av.ParseAttributeView(avID); errors.Is(err, av.ErrSpecTooNew) {
    // tell the user to upgrade; do not attempt to edit the AV
    return upgradeRequiredError()
}

Prevention

When it happens

Trigger: Opening/syncing a workspace created or last saved by a newer SiYuan version into an older kernel. The AV JSON's spec field (e.g. 8) exceeds this kernel's CurrentSpec (7), so the kernel refuses to interpret it to avoid corruption.

Common situations: User downgraded SiYuan; opened a synced workspace from a newer desktop build on an older mobile build; CI testing against an older kernel with data produced by a newer one.

Related errors


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/9a75b54dac4983a4. Report an issue: GitHub.