gotify/server · error
instance not found
Error message
instance not found
What it means
Manager.SetPluginEnabled in plugin/manager.go discards the underlying error from m.Instance(pluginID) and returns a generic 'instance not found' error when no loaded plugin instance matches the given pluginID. It fires when the caller supplies a plugin id that was never loaded or has been unloaded, masking whether the lookup failed for another reason.
Source
Thrown at plugin/manager.go:110
return nil, err
}
for _, user := range users {
if err := manager.initializeForUser(*user); err != nil {
return nil, err
}
}
return manager, nil
}
// ErrAlreadyEnabledOrDisabled is returned on SetPluginEnabled call when a plugin is already enabled or disabled.
var ErrAlreadyEnabledOrDisabled = errors.New("config is already enabled/disabled")
// SetPluginEnabled sets the plugins enabled state.
func (m *Manager) SetPluginEnabled(pluginID uint, enabled bool) error {
instance, err := m.Instance(pluginID)
if err != nil {
return errors.New("instance not found")
}
conf, err := m.db.GetPluginConfByID(pluginID)
if err != nil {
return err
}
if conf.Enabled == enabled {
return ErrAlreadyEnabledOrDisabled
}
m.mutex.Lock()
defer m.mutex.Unlock()
if enabled {
err = instance.Enable()
} else {
err = instance.Disable()
}View on GitHub (pinned to 14bfc25627)
Solutions
- Verify the pluginID passed to SetPluginEnabled exists in the manager's loaded instances
- Propagate or wrap the original error from m.Instance instead of replacing it, to distinguish lookup failures
- Refresh the caller's plugin list; the plugin may have been removed or failed to load at startup
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at plugin/manager.go:110 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gotify/server@14bfc25627 (2026-09-05).
Data as JSON: /api/errors/bb0876e0f01c1f8a.
Report an issue: GitHub.