siyuan-note/siyuan · error
plugin [%s] not found
Error message
plugin [%s] not found
What it means
Thrown by SetPetalEnabled() when bazaar.ParseInstalledPlugin(name, "") reports the plugin is not found (found=false). ParseInstalledPlugin inspects the installed plugin directory and plugin.json manifest; if the named plugin does not exist on disk or its manifest cannot be parsed, the function returns found=false and this error is thrown.
Source
Thrown at kernel/model/plugin.go:69
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) {
petals := getPetals()
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 = getPetalByName(name, petals)
if nil == ret {
ret = &Petal{
Name: name,
}
petals = append(petals, ret)
}
ret.Version = version
ret.DisplayName = displayName
ret.Enabled = enabled
ret.Incompatible = incompatible
ret.DisabledInPublish = disabledInPublish
ret.DisallowInstall = disallowInstall
ret.Kernel = KernelPetal{View on GitHub (pinned to 251596fc0d)
Solutions
- Reinstall the plugin from the SiYuan Bazaar marketplace.
- Verify the plugin name matches the directory name under data/plugins/.
- Check that the plugin's plugin.json manifest exists and is valid JSON.
- In the calling code, verify the plugin is installed via bazaar.ParseInstalledPlugin before calling SetPetalEnabled.
Example fix
// before
petal, err := model.SetPetalEnabled("my-plugin", true)
// after
found, _, _, _, _, _, _ := bazaar.ParseInstalledPlugin("my-plugin", "")
if !found {
return errors.New("plugin not installed, please install from Bazaar first")
}
petal, err := model.SetPetalEnabled("my-plugin", true) Defensive patterns
Strategy: validation
Validate before calling
found, _, _, _, _, _, _ := bazaar.ParseInstalledPlugin(name, "")
if !found {
return nil, fmt.Errorf("plugin [%s] is not installed; install it from Bazaar first", name)
}
petal, err := model.SetPetalEnabled(name, enabled) Type guard
func isPluginInstalled(name string) bool {
found, _, _, _, _, _, _ := bazaar.ParseInstalledPlugin(name, "")
return found
} Prevention
- Verify plugin installation before calling SetPetalEnabled.
- In the UI, disable the enable/disable toggle for uninstalled plugins.
- Refresh the plugin list after install/uninstall operations.
When it happens
Trigger: Calling SetPetalEnabled(name, enabled) where name does not match any installed plugin in the data/plugins/ directory. The plugin was never installed, was uninstalled, or its directory/manifest.json was corrupted or manually deleted.
Common situations: A plugin was removed from disk but the frontend still shows it in the UI. The plugin name has a typo or case mismatch. The plugin directory was cleaned/reset. A plugin was installed to a different workspace. The plugin's plugin.json manifest was renamed or corrupted.
Related errors
- Agent capability name and description are required
- invalid marketplace package type
- marketplace package manifest not found or invalid
- multiple marketplace package manifests found
- marketplace package manifest not found
AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12).
Data as JSON: /api/errors/8286c70304f88c2e.
Report an issue: GitHub.