{"record":{"id":"3900f4314f3344e7","repo":"theforeman/foreman","slug":"id-plugin-requires-the-plugin-name-plugin-n","errorCode":null,"errorMessage":"%{id} plugin requires the %{plugin_name} plugin, not found","messagePattern":"%(.+?) plugin requires the %(.+?) plugin, not found","errorType":"exception","errorClass":"PluginNotFound","httpStatus":null,"severity":"error","filePath":"app/registries/foreman/plugin.rb","lineNumber":234,"sourceCode":"    end\n\n    # Sets a requirement on Foreman version\n    # Raises a PluginRequirementError exception if the requirement is not met\n    # matcher format is gem dependency format\n    def requires_foreman(matcher)\n      current = SETTINGS[:version].notag\n      unless Gem::Dependency.new('', matcher).match?('', current)\n        raise PluginRequirementError.new(N_(\"%{id} plugin requires Foreman %{matcher} but current is %{current}\" % {:id => id, :matcher => matcher, :current => current}))\n      end\n      true\n    end\n\n    # Sets a requirement on a Foreman plugin version\n    # Raises a PluginRequirementError exception if the requirement is not met\n    # matcher format is gem dependency format\n    def requires_foreman_plugin(plugin_name, matcher, allow_prerelease: true)\n      plugin = Plugin.find(plugin_name)\n      raise PluginNotFound.new(N_(\"%{id} plugin requires the %{plugin_name} plugin, not found\") % {:id => id, :plugin_name => plugin_name}) unless plugin\n      dep_checker = Gem::Dependency.new('', matcher)\n      dep_checker.prerelease = true if allow_prerelease\n      unless dep_checker.match?('', plugin.version)\n        raise PluginRequirementError.new(N_(\"%{id} plugin requires the %{plugin_name} plugin %{matcher} but current is %{plugin_version}\" % {:id => id, :plugin_name => plugin_name, :matcher => matcher, :plugin_version => plugin.version}))\n      end\n      true\n    end\n\n    # Adds an item to the given menu\n    # The id parameter is automatically added to the url.\n    #   menu :menu_name, :plugin_example, 'menu text', { :controller => :example, :action => :index }\n    #\n    # name parameter can be: :top_menu or :admin_menu\n    #\n    def menu(menu, name, options = {})\n      options[:parent] = @parent if @parent\n      Menu::Manager.map(menu).item(name, options)\n    end","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/registries/foreman/plugin.rb#L216-L252","documentation":"Error \"%{id} plugin requires the %{plugin_name} plugin, not found\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/registries/foreman/plugin.rb:234 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6b05625475cfe6aac31a88f8c8ee6e62e4efe620","analyzedAt":"2026-08-23T17:46:34.094Z","schemaVersion":2},"datasetVersion":"2026-08-23T21:17:23.414Z"}