{"record":{"id":"adb8613651ff58c7","repo":"siyuan-note/siyuan","slug":"require-upgrade-siyuan-to-use-this-plugin-s","errorCode":null,"errorMessage":"require upgrade SiYuan to use this plugin [%s]","messagePattern":"require upgrade SiYuan to use this plugin \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kernel/model/plugin.go","lineNumber":92,"sourceCode":"\tret = getPetalByName(name, petals)\n\tif nil == ret {\n\t\tret = &Petal{\n\t\t\tName: name,\n\t\t}\n\t\tpetals = append(petals, ret)\n\t}\n\tret.Version = version\n\tret.DisplayName = displayName\n\tret.Enabled = enabled\n\tret.Incompatible = incompatible\n\tret.DisabledInPublish = disabledInPublish\n\tret.DisallowInstall = disallowInstall\n\tret.Kernel = KernelPetal{\n\t\tIncompatible: kernelIncompatible,\n\t}\n\n\tif enabled && disallowInstall {\n\t\terr = fmt.Errorf(\"require upgrade SiYuan to use this plugin [%s]\", name)\n\t\tlogging.LogInfof(\"%s\", err)\n\t\treturn\n\t}\n\n\tsavePetals(petals)\n\n\tloadCode(ret)\n\n\t// Hook kernel plugin lifecycle (callbacks avoid circular import with plugin package)\n\tif enabled {\n\t\tif OnKernelPluginStart != nil {\n\t\t\tOnKernelPluginStart(ret)\n\t\t}\n\t} else {\n\t\tif OnKernelPluginStop != nil {\n\t\t\tOnKernelPluginStop(ret)\n\t\t}\n\t}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/plugin.go#L74-L110","documentation":"Thrown by SetPetalEnabled() when the user tries to enable a plugin whose manifest declares a minimum SiYuan kernel version that is higher than the running kernel version. bazaar.ParseInstalledPlugin sets disallowInstall=true when the plugin's backend.kernel requirement is not met. The error is logged at Info level (not Error) because it is a version-compatibility notice, not a crash.","triggerScenarios":"Calling SetPetalEnabled(name, true) where enabled=true and the parsed disallowInstall flag is true. This flag is set when the installed plugin manifest specifies a minimum kernel version (backend.min or similar) greater than the running kernel version.","commonSituations":"The user installed a plugin built for a newer SiYuan version but is running an older kernel. A plugin was auto-updated by the Bazaar to a version that dropped support for the user's SiYuan version. The user downgraded SiYuan but kept plugins that now require the newer version.","solutions":["Upgrade SiYuan to the kernel version required by the plugin (check the plugin's manifest for the minimum version).","Downgrade/uninstall the plugin and install an older version compatible with the running kernel.","Check the plugin's changelog or Bazaar page for version compatibility information.","In the calling code, check the disallowInstall flag before attempting to enable and surface a user-friendly upgrade prompt."],"exampleFix":"// before\npetal, err := model.SetPetalEnabled(pluginName, true)\nif err != nil {\n    showError(err) // raw error shown to user\n}\n\n// after\n// Show actionable message to the user\npetal, err := model.SetPetalEnabled(pluginName, true)\nif err != nil && strings.Contains(err.Error(), \"require upgrade SiYuan\") {\n    showDialog(\"This plugin requires a newer SiYuan version. Please upgrade SiYuan to use it.\")\n    return\n}","handlingStrategy":"validation","validationCode":"found, _, _, _, _, disallowInstall, _ := bazaar.ParseInstalledPlugin(name, \"\")\nif found && disallowInstall && enabled {\n    return nil, fmt.Errorf(\"plugin [%s] requires a newer SiYuan version; please upgrade\", name)\n}","typeGuard":"func isPluginCompatible(name string) bool {\n    _, _, _, _, _, disallowInstall, _ := bazaar.ParseInstalledPlugin(name, \"\")\n    return !disallowInstall\n}","tryCatchPattern":null,"preventionTips":["Check the disallowInstall flag before attempting to enable.","Show a user-friendly 'upgrade SiYuan' prompt when the flag is set.","Keep SiYuan kernel updated to the latest version for plugin compatibility."],"tags":["plugin","version-compatibility","bazaar","upgrade"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}