{"record":{"id":"8ca05dca1fe0bdc6","repo":"siyuan-note/siyuan","slug":"errspectoonew","errorCode":"ErrSpecTooNew","errorMessage":"attribute view spec is too new","messagePattern":"attribute view spec is too new","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/av/av.go","lineNumber":1347,"sourceCode":"\t\t}\n\t}\n\treturn\n}\n\nfunc GetAttributeViewI18n(key string) string {\n\treturn util.AttrViewLangs[util.Lang][key].(string)\n}\n\nvar (\n\tErrAttributeViewNotFound  = errors.New(\"attribute view not found\")\n\tErrInvalidAttributeViewID = errors.New(\"invalid attribute view id\")\n\tErrInvalidBoxID           = errors.New(\"invalid box id\")\n\tErrViewNotFound           = errors.New(\"view not found\")\n\tErrKeyNotFound            = errors.New(\"key not found\")\n\tErrItemNotFound           = errors.New(\"item not found\")\n\tErrWrongLayoutType        = errors.New(\"wrong layout type\")\n\tErrInvalidColumnAlign     = errors.New(\"invalid column align\")\n\tErrSpecTooNew             = errors.New(\"attribute view spec is too new\")\n\tErrRichTextSpecMismatch   = errors.New(\"attribute view rich text requires storage spec 9\")\n\tErrFilterTooDeep          = errors.New(\"filter nesting depth exceeds the maximum allowed\")\n)\n\nconst (\n\tNodeAttrNameAvs        = \"custom-avs\"                  // 用于标记块所属的属性视图，逗号分隔 av id\n\tNodeAttrView           = \"custom-sy-av-view\"           // 用于标记块所属的属性视图视图 view id Database block support specified view https://github.com/siyuan-note/siyuan/issues/10443\n\tNodeAttrVisibleViewIDs = \"custom-sy-av-visible-views\"  // 用于标记数据库块显示的视图 ID，逗号分隔\n\tNodeAttrContextFilter  = \"custom-sy-av-context-filter\" // 用于保存数据库块独有的上下文筛选配置\n\tNodeAttrViewStaticText = \"custom-sy-av-s-text\"         // 用于标记块所属的属性视图静态文本 Database-bound block primary key supports setting static anchor text https://github.com/siyuan-note/siyuan/issues/10049\n\n\tNodeAttrViewNames = \"av-names\" // 用于临时标记块所属的属性视图名称，空格分隔\n)\n","sourceCodeStart":1329,"sourceCodeEnd":1361,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/av/av.go#L1329-L1361","documentation":"ErrSpecTooNew signals that an attribute view (.av JSON) was written by a newer SiYuan version whose storage Spec is higher than this kernel can parse. The kernel refuses to load or upgrade the database block to avoid silently dropping or corrupting fields it does not understand. It is a sentinel error returned by CheckSpec and surfaced during tree parsing / fix operations.","triggerScenarios":"Loading or saving an attribute view whose JSON `spec` field is greater than the highest spec supported by the running kernel; av.CheckSpec / parseJSON2Tree / fixTreeJSONData on a .av file produced by a newer version; API handlers (kernel/api/av.go:1418, kernel/api/block.go:1235) that render documents containing such a database block.","commonSituations":"Opening a workspace synced from a newer SiYuan client (e.g. after a downgrade, or mobile/older desktop client sharing the same sync target); restoring an old backup binary against data written by a new version; running an outdated kernel build with up-to-date user data.","solutions":["Upgrade SiYuan (kernel + frontend) to a version whose av Spec supports the data; the Spec check only fails when the data is newer.","If a downgrade is intentional, do not open the affected database blocks with the old version; re-sync or revert those .av files to a Spec the old version supports (from a backup made with that version).","In API callers, surface Conf.Language(215) (i18n 'database is too new' style message) to the user as done at kernel/api/av.go:1418 instead of a raw error.","Never hand-edit the .av JSON `spec` field downwards; rich-text and other features gate on specific specs and data would be rejected or lost."],"exampleFix":"// before (old kernel opening new data)\nerr := av.CheckSpec(attrView) // -> av.ErrSpecTooNew\n\n// after\n// upgrade the SiYuan installation so the kernel's max supported spec\n// is >= the spec stored in the .av file, then retry:\nif err := av.CheckSpec(attrView); errors.Is(err, av.ErrSpecTooNew) {\n\treturn fmt.Errorf(\"database requires a newer SiYuan version; please upgrade\")\n}","handlingStrategy":"validation","validationCode":"func avSpecSupported(spec int, maxSupported int) bool { return spec <= maxSupported }","typeGuard":null,"tryCatchPattern":"if err := av.CheckSpec(v); errors.Is(err, av.ErrSpecTooNew) {\n\t// surface upgrade prompt: model.Conf.Language(215)\n}","preventionTips":["Keep all clients (desktop/mobile) on compatible SiYuan versions before enabling sync","Check spec versions before downgrading a workspace or restoring old backups against new data","Wrap .av loading with errors.Is(err, av.ErrSpecTooNew) to give an upgrade message instead of a raw failure"],"tags":["attribute-view","version-compatibility","spec-version","siyuan-kernel","database-block"],"backgroundTag":"unsupported-config-value","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}