{"record":{"id":"93be427b699d18e3","repo":"puppetlabs/puppet","slug":"invalid-value-value-93be42","errorCode":null,"errorMessage":"Invalid value %{value}","messagePattern":"Invalid value %(.+?)","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/type/resources.rb","lineNumber":60,"sourceCode":"\n  newparam(:unless_system_user) do\n    desc \"This keeps system users from being purged.  By default, it\n      does not purge users whose UIDs are less than the minimum UID for the system (typically 500 or 1000), but you can specify\n      a different UID as the inclusive limit.\"\n\n    newvalues(:true, :false, /^\\d+$/)\n\n    munge do |value|\n      case value\n      when /^\\d+/\n        Integer(value)\n      when :true, true\n        @resource.class.system_users_max_uid\n      when :false, false\n        false\n      when Integer; value\n      else\n        raise ArgumentError, _(\"Invalid value %{value}\") % { value: value.inspect }\n      end\n    end\n\n    defaultto {\n      if @resource[:name] == \"user\"\n        @resource.class.system_users_max_uid\n      else\n        nil\n      end\n    }\n  end\n\n  newparam(:unless_uid) do\n    desc 'This keeps specific uids or ranges of uids from being purged when purge is true.\n      Accepts integers, integer strings, and arrays of integers or integer strings.\n      To specify a range of uids, consider using the range() function from stdlib.'\n\n    munge do |value|","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/type/resources.rb#L42-L78","documentation":"`unless_system_user` on the resources metatype protects users from purging. It accepts true/false (booleans), or an integer/integer-string UID used as the inclusive limit below which users are kept; `true` resolves to Puppet's system_users_max_uid. The munge (lib/puppet/type/resources.rb:60) raises ArgumentError for anything else.","triggerScenarios":"`resources { 'user': purge => true, unless_system_user => 'system' }`; floats like 500.5; symbols; ranges or arrays; words like 'none'/'all'.","commonSituations":"Copy-paste confusion with unless_uid/unless_system_group wording; users trying to pass a UID range or list; assuming named policies are accepted.","solutions":["Pass a plain boolean or a single integer/integer-string UID ceiling (e.g. 1000)","For excluding multiple specific UIDs, use the separate `unless_uid` parameter","Leave it unset to get the default (system_users_max_uid) when purging users"],"exampleFix":"# before\nresources { 'user':\n  purge             => true,\n  unless_system_user => 'system',\n}\n\n# after\nresources { 'user':\n  purge             => true,\n  unless_system_user => 1000,\n}","handlingStrategy":"validation","validationCode":"if $unless_system_user != undef and $unless_system_user !~ /^\\d+$/ and $unless_system_user !~ /^(true|false)$/ {\n  fail('unless_system_user must be true, false, or a UID integer')\n}","typeGuard":"def valid_unless_system_user?(v)\n  v == true || v == false || v.is_a?(Integer) || v.to_s =~ /^\\d+$/\nend","tryCatchPattern":"begin\n  Puppet::Type.type(:resources).new(\n    name: 'user', purge: true, unless_system_user: 'system'\n  )\nrescue ArgumentError => e\n  raise unless e.message.include?('Invalid value')\n  # coerce to boolean or integer and retry\nend","preventionTips":["Use booleans or a single integer for UID thresholds","Use unless_uid (arrays allowed) for exclusions of specific UIDs","Dry-run purge profiles in a noop compile before production"],"tags":["puppet","purge","user","invalid-value"],"backgroundTag":"invalid-parameter-value","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}