{"record":{"id":"4ba7d6552bdeb00d","repo":"puppetlabs/puppet","slug":"cannot-disable-unrecognized-warning-types-inval","errorCode":null,"errorMessage":"Cannot disable unrecognized warning types '%{invalid}'. Valid values are '%{values}'.","messagePattern":"Cannot disable unrecognized warning types '%(.+?)'\\. Valid values are '%(.+?)'\\.","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/defaults.rb","lineNumber":157,"sourceCode":"      :type    => :array,\n      :desc    => \"A comma-separated list of warning types to suppress. If large numbers\n        of warnings are making Puppet's logs too large or difficult to use, you\n        can temporarily silence them with this setting.\n\n        If you are preparing to upgrade Puppet to a new major version, you\n        should re-enable all warnings for a while.\n\n        Valid values for this setting are:\n\n        * `deprecations` --- disables deprecation warnings.\n        * `undefined_variables` --- disables warnings about non existing variables.\n        * `undefined_resources` --- disables warnings about non existing resources.\",\n      :hook      => proc do |value|\n        values = munge(value)\n        valid   = %w[deprecations undefined_variables undefined_resources]\n        invalid = values - (values & valid)\n        unless invalid.empty?\n          raise ArgumentError, _(\"Cannot disable unrecognized warning types '%{invalid}'.\") % { invalid: invalid.join(',') } +\n              ' ' + _(\"Valid values are '%{values}'.\") % { values: valid.join(', ') }\n        end\n      end\n    },\n    :skip_logging_catalog_request_destination => {\n      :default => false,\n      :type    => :boolean,\n      :desc => \"Specifies whether to suppress the notice of which compiler\n        supplied the catalog. A value of `true` suppresses the notice.\",\n    },\n    :merge_dependency_warnings => {\n      :default => false,\n      :type    => :boolean,\n      :desc    => \"Whether to merge class-level dependency failure warnings.\n\n        When a class has a failed dependency, every resource in the class\n        generates a notice level message about the dependency failure,\n        and a warning level message about skipping the resource.","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/defaults.rb#L139-L175","documentation":"Validation raised by the `:hook` proc for the `disable_warnings` setting in `Puppet::Defaults`. On assignment the munged value list is intersected with the allowlist %w[deprecations undefined_variables undefined_resources]; any leftover token produces this ArgumentError (the message concatenates 'Cannot disable unrecognized warning types' with 'Valid values are'). It fires at configuration parse time, from puppet.conf or from `Puppet[:disable_warnings] = ...` in code, before the run starts.","triggerScenarios":"Setting `disable_warnings = deprecation` (singular), `disable_warnings = legacy_stuff`, or any unknown token in puppet.conf or via the settings API; values are matched exactly, so `Deprecations` or `Deprecation` also fail. Note `undefined_resources` only exists in newer Puppet releases.","commonSituations":"Copy-pasting settings from blog posts or modules targeting a different Puppet version; singular-form typos; configuration management (ini_setting modules, PE console settings) pushing arbitrary strings into this key.","solutions":["Use only: deprecations, undefined_variables, undefined_resources — lowercase, exact, comma-separated","Remove the misspelled token from `disable_warnings` in puppet.conf / PE classifier / hiera-managed config","If a module manages this setting, correct the data source (hiera/profile) that feeds it"],"exampleFix":"# before\n[main]\ndisable_warnings = deprecation, legacy_warn\n# after\n[main]\ndisable_warnings = deprecations, undefined_variables","handlingStrategy":"validation","validationCode":"VALID_WARNINGS = %w[deprecations undefined_variables undefined_resources].freeze\nvalues = raw_setting.split(',').map(&:strip).reject(&:empty?)\ninvalid = values - VALID_WARNINGS\nraise ArgumentError, \"unrecognized warning types: #{invalid.join(',')}\" unless invalid.empty?\nPuppet[:disable_warnings] = values.join(',')","typeGuard":"def valid_disable_warnings?(raw)\n  (raw.to_s.split(',').map(&:strip).reject(&:empty?) - %w[deprecations undefined_variables undefined_resources]).empty?\nend","tryCatchPattern":null,"preventionTips":["Validate the value in the module/profile before it writes puppet.conf","Remember the exact, lowercase, comma-separated token forms","Check `puppet config print disable_warnings` after config changes to catch typos early"],"tags":["puppet-conf","settings","validation","argumenterror"],"backgroundTag":"invalid-config-value","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}