siyuan-note/siyuan · error
plugin [ ] not found
Error message
plugin [%s] not found
What it means
SetPetalEnabled toggles a plugin's enabled state. Before touching the petal config it calls bazaar.ParseInstalledPlugin(name, ""), which looks the plugin up among installed plugins. If no installed plugin matches the given name, the function returns this error and logs it, so the caller knows the plugin is not present in the workspace's plugin directory.
Solutions
- List installed plugins (bazaar/installed plugins API) and use the exact returned name.
- Reinstall the plugin from the marketplace, then retry.
- Check the plugin directory exists under the workspace conf/appearance/plugins path.
- Handle the error in the caller and surface 'plugin not installed' to the user.
Example fix
// before
petal, err := model.SetPetalEnabled("my-plugin", true)
// after
installed := bazaar.InstalledPlugins("", 0) // verify name first
if !containsPlugin(installed, "my-plugin") {
return errors.New("plugin my-plugin is not installed")
}
petal, err := model.SetPetalEnabled("my-plugin", true) Defensive patterns
Strategy: try-catch
Validate before calling
found, _, _, _, _, _, _ := bazaar.ParseInstalledPlugin(name, "")
if !found { return fmt.Errorf("plugin %q is not installed", name) } Try / catch
petal, err := model.SetPetalEnabled(name, true)
if err != nil && strings.Contains(err.Error(), "not found") {
// refresh installed-plugin list; prompt reinstall
} Prevention
- Resolve plugin names from the installed-plugins listing, not user input
- Handle uninstall/unenable races between windows
- Verify install success after marketplace operations
- Log plugin names at call sites to spot stale references
When it happens
Trigger: Calling SetPetalEnabled with a plugin name that is not installed: typo in the name, plugin uninstalled between listing and enabling, plugin installed under a different directory name than the one used in the call.
Common situations: Plugin removed by the user or another window before the enable call; marketplace install failed leaving metadata without the plugin directory; script uses the marketplace package name instead of the installed plugin name.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- plugin publish data has not been generated
- require upgrade SiYuan to use this plugin
- 0
- AI editor action not found
- attribute view group
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/8286c70304f88c2e.
Report an issue: GitHub.
Appendix: source
Thrown at kernel/model/plugin.go:68
}
type KernelPetal struct {
JS string `json:"js"` // Kernel JS code
Existed bool `json:"existed"` // Whether kernel.js is exist
Incompatible bool `json:"incompatible"` // Whether incompatible
}
var (
OnKernelPluginStart func(petal *Petal) // Called when a plugin is enabled (after loading and starting the plugin)
OnKernelPluginStop func(petal *Petal) // Called when a plugin is disabled (before stopping and unloading the plugin)
OnKernelPluginsStart func() // Called to start all valid plugins
OnKernelPluginsStop func() // Called to stopping all valid plugins
)
func SetPetalEnabled(name string, enabled bool) (ret *Petal, err error) {
found, version, displayName, incompatible, disabledInPublish, disallowInstall, kernelIncompatible := bazaar.ParseInstalledPlugin(name, "")
if !found {
err = fmt.Errorf("plugin [%s] not found", name)
logging.LogErrorf("%s", err)
return
}
ret, err = updatePetal(name, func(petal *Petal) error {
petal.Version = version
petal.DisplayName = displayName
petal.Enabled = enabled
petal.Incompatible = incompatible
petal.DisabledInPublish = disabledInPublish
petal.DisallowInstall = disallowInstall
petal.Kernel = KernelPetal{
Incompatible: kernelIncompatible,
}
if enabled && disallowInstall {
return fmt.Errorf("require upgrade SiYuan to use this plugin [%s]", name)
}View on GitHub (pinned to 9f775e8a12)