{"record":{"id":"a6ba6f2eb15e0ac9","repo":"theforeman/foreman","slug":"id-plugin-requires-foreman-matcher-but-curre","errorCode":null,"errorMessage":"%{id} plugin requires Foreman %{matcher} but current is %{current}","messagePattern":"%(.+?) plugin requires Foreman %(.+?) but current is %(.+?)","errorType":"exception","errorClass":"PluginRequirementError","httpStatus":null,"severity":"error","filePath":"app/registries/foreman/plugin.rb","lineNumber":224,"sourceCode":"    def logger(name, configuration = {})\n      @logging.add_logger(name, configuration)\n    end\n\n    def <=>(plugin)\n      id.to_s <=> plugin.id.to_s\n    end\n\n    def to_s\n      \"Foreman plugin: #{id}, #{version}, #{author}, #{description}\"\n    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","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/theforeman/foreman/blob/6b05625475cfe6aac31a88f8c8ee6e62e4efe620/app/registries/foreman/plugin.rb#L206-L242","documentation":"Error \"%{id} plugin requires Foreman %{matcher} but current is %{current}\" thrown in theforeman/foreman.","triggerScenarios":"Thrown at app/registries/foreman/plugin.rb:224 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"}