{"record":{"id":"f83a1eef378a1920","repo":"puppetlabs/puppet","slug":"invalid-value-value-property-must-be-an-int","errorCode":null,"errorMessage":"Invalid value %{value}: %{property} must be an Integer!","messagePattern":"Invalid value %(.+?): %(.+?) must be an Integer!","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/aix_object.rb","lineNumber":126,"sourceCode":"      mappings[:puppet_property][info[:aix_attribute]] = MappedObject.new(\n        info[:puppet_property],\n        :convert_attribute_value,\n        info[:attribute_to_property]\n      )\n    end\n\n    # Creates a mapping from a purely numeric Puppet property to\n    # an attribute\n    def numeric_mapping(info = {})\n      property = info[:puppet_property]\n\n      # We have this validation here b/c not all numeric properties\n      # handle this at the property level (e.g. like the UID). Given\n      # that, we might as well go ahead and do this validation for all\n      # of our numeric properties. Doesn't hurt.\n      info[:property_to_attribute] = lambda do |value|\n        unless value.is_a?(Integer)\n          raise ArgumentError, _(\"Invalid value %{value}: %{property} must be an Integer!\") % { value: value, property: property }\n        end\n\n        value.to_s\n      end\n\n      # AIX will do the right validation to ensure numeric attributes\n      # can't be set to non-numeric values, so no need for the extra clutter.\n      info[:attribute_to_property] = lambda do |value| # rubocop:disable Style/SymbolProc\n        value.to_i\n      end\n\n      mapping(info)\n    end\n\n    #-------------\n    # Useful Class Methods\n    # ------------\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/aix_object.rb#L108-L144","documentation":"The AIX user/group providers build per-property mappings; numeric properties (uid, gid, pgrp and similar) get a property-to-attribute lambda that accepts only real Integers, raising ArgumentError 'Invalid value X: <property> must be an Integer!' otherwise. AIX itself rejects non-numeric attributes, so Puppet validates early with a clearer message; the property name and the offending value are both included.","triggerScenarios":"user { 'build': uid => '1001' } (quoted string) on AIX; Hiera YAML storing uid/gid as quoted strings; passing a Float or nil for a numeric AIX attribute.","commonSituations":"Manifests or Hiera authored on Linux where other providers tolerate strings; templating that quotes every value; module parameters left untyped so strings flow through.","solutions":["Pass an unquoted integer: uid => 1001.","Type the parameter so compilation catches bad shapes: Integer $uid or Optional[Integer].","Convert defensively at the boundary: uid => Integer($uid_string)."],"exampleFix":"# before (Puppet DSL)\nuser { 'build': uid => '1001' }   # ArgumentError on AIX\n\n# after\nuser { 'build': uid => 1001 }     # and in the class signature: Optional[Integer] $uid = undef","handlingStrategy":"validation","validationCode":"# Ruby\nfail 'uid must be an Integer' unless uid.is_a?(Integer)\n\n# Puppet DSL: constrain the parameter\nOptional[Integer] $uid = undef","typeGuard":"def aix_numeric?(v)\n  v.is_a?(Integer)\nend","tryCatchPattern":null,"preventionTips":["Never quote numeric Hiera values that feed AIX properties (uid, gid).","Declare Integer types on class/profile parameters that feed numeric resource attributes.","Cast with Integer($x) at module boundaries when data sources are untrusted."],"tags":["puppet","aix","user-management","type-validation","puppet-dsl"],"backgroundTag":"string-vs-integer-value","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}