{"record":{"id":"43ad3aa9fc03beb1","repo":"navidrome/navidrome","slug":"plugins-folder-not-configured","errorCode":null,"errorMessage":"plugins folder not configured","messagePattern":"plugins folder not configured","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugins/manager.go","lineNumber":463,"sourceCode":"// UpdatePluginLibraries updates the libraries permission settings for a plugin.\n// If the plugin is enabled, it will be reloaded with the new settings.\n// If the plugin requires library permission and no libraries are configured (and allLibraries is false),\n// the plugin will be automatically disabled.\nfunc (m *Manager) UpdatePluginLibraries(ctx context.Context, id, librariesJSON string, allLibraries, allowWriteAccess bool) error {\n\treturn m.updatePluginSettings(ctx, id, func(p *model.Plugin) {\n\t\tp.Libraries = librariesJSON\n\t\tp.AllLibraries = allLibraries\n\t\tp.AllowWriteAccess = allowWriteAccess\n\t})\n}\n\n// RescanPlugins triggers a manual rescan of the plugins folder.\n// This synchronizes the database with the filesystem, discovering new plugins,\n// updating changed ones, and removing deleted ones.\nfunc (m *Manager) RescanPlugins(ctx context.Context) error {\n\tfolder := conf.Server.Plugins.Folder.String()\n\tif folder == \"\" {\n\t\treturn fmt.Errorf(\"plugins folder not configured\")\n\t}\n\tlog.Info(ctx, \"Manual plugin rescan requested\", \"folder\", folder)\n\treturn m.syncPlugins(ctx, folder)\n}\n\n// updatePluginSettings is a common implementation for updating plugin settings.\n// The updateFn is called to apply the specific field updates to the plugin.\n// If the plugin is enabled, it will be reloaded. If users permission is required\n// but no longer satisfied, the plugin will be disabled.\nfunc (m *Manager) updatePluginSettings(ctx context.Context, id string, updateFn func(*model.Plugin)) error {\n\tif m.ds == nil {\n\t\treturn fmt.Errorf(\"datastore not configured\")\n\t}\n\n\tadminCtx := adminContext(ctx)\n\trepo := m.ds.Plugin(adminCtx)\n\n\tplugin, err := repo.Get(id)","sourceCodeStart":445,"sourceCodeEnd":481,"githubUrl":"https://github.com/navidrome/navidrome/blob/4ed7494a3293a9e9e647897ebfb9be327efd981b/plugins/manager.go#L445-L481","documentation":"RescanPlugins returns this when the server configuration key Server.Plugins.Folder is empty. The rescan needs a filesystem folder to walk; without one there is nothing to synchronize. It is a configuration error thrown before any I/O.","triggerScenarios":"Calling RescanPlugins(ctx) on a server where the plugins folder config option was never set (or set to \"\").","commonSituations":"Fresh installs where plugin support was never configured; deployments overriding config files with partial env/flags that omit the plugins folder; tests running with default config.","solutions":["Set the plugins folder in the server config (e.g. Plugins.Folder in the config file or corresponding env var) and restart.","Verify the effective config value is non-empty at runtime before calling RescanPlugins.","If plugins are not used, do not call RescanPlugins."],"exampleFix":"// before: rescan with unconfigured folder\nerr := manager.RescanPlugins(ctx)\n// after: pre-check\nfolder := conf.Server.Plugins.Folder.String()\nif folder == \"\" {\n    return fmt.Errorf(\"cannot rescan: plugins folder not configured\")\n}\nerr := manager.RescanPlugins(ctx)","handlingStrategy":"validation","validationCode":"if conf.Server.Plugins.Folder.String() == \"\" {\n    return fmt.Errorf(\"cannot rescan: plugins folder is not configured\")\n}","typeGuard":null,"tryCatchPattern":"err := manager.RescanPlugins(ctx)\nif err != nil && err.Error() == \"plugins folder not configured\" {\n    log.Warn(\"plugin rescan skipped: no folder configured\")\n    return nil\n}","preventionTips":["Set the plugins folder in the config file or via its env variable on every deployment.","Add a startup health check that fails fast when plugin features are used without a configured folder.","Gate rescan API calls behind a config-availability check."],"tags":["go","configuration","plugin","missing-config"],"backgroundTag":"missing-env-var","analyzedSha":"4ed7494a3293a9e9e647897ebfb9be327efd981b","analyzedAt":"2026-09-01T05:03:05.018Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}