{"record":{"id":"ab4a340f5c28c2fa","repo":"hashicorp/nomad","slug":"failed-to-create-plugin-loader-v","errorCode":null,"errorMessage":"failed to create plugin loader: %v","messagePattern":"failed to create plugin loader: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/plugins.go","lineNumber":40,"sourceCode":"\t// Build the plugin loader\n\tconfig := &loader.PluginLoaderConfig{\n\t\tLogger:            a.logger,\n\t\tPluginDir:         a.config.PluginDir,\n\t\tConfigs:           a.config.Plugins,\n\t\tInternalPlugins:   internal,\n\t\tSupportedVersions: loader.AgentSupportedApiVersions,\n\t}\n\n\t// IMPORTANT: This function will mutate the passed in config to update the\n\t// plugin configs with any default values from the plugin's config schema.\n\t//  They need to be propagated so we need to pass a pointer to the\n\t// agent's config here.\n\ta.configLock.Lock()\n\tdefer a.configLock.Unlock()\n\n\tl, err := loader.NewPluginLoader(config)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create plugin loader: %v\", err)\n\t}\n\ta.pluginLoader = l\n\n\t// Wrap the loader to get our singleton loader\n\ta.pluginSingletonLoader = singleton.NewSingletonLoader(a.logger, l)\n\n\tfor k, plugins := range a.pluginLoader.Catalog() {\n\t\tfor _, p := range plugins {\n\t\t\ta.logger.Info(\"detected plugin\", \"name\", p.Name, \"type\", k, \"plugin_version\", p.PluginVersion)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (a *Agent) internalPluginConfigs() (map[loader.PluginID]*loader.InternalPluginConfig, error) {\n\t// Get the registered plugins\n\tcatalog := catalog.Catalog()","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/plugins.go#L22-L58","documentation":"Agent startup error from setupPlugins when loader.NewPluginLoader fails to initialize the plugin loader - typically bad plugin_dir contents, invalid plugin binary/config, or a plugin whose API version is unsupported; it aborts client setup.","triggerScenarios":"Thrown at command/agent/plugins.go:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check plugin_dir contains valid Nomad plugin binaries built for the server's API version","Validate plugin config blocks in the agent configuration","Remove or fix broken plugin files and check plugin logs for the underlying loader error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}