{"record":{"id":"a5c6c34e4918e8fc","repo":"puppetlabs/puppet","slug":"profile-names-must-be-provided-as-an-array-not-a","errorCode":null,"errorMessage":"Profile names must be provided as an array, not a comma-separated list","messagePattern":"Profile names must be provided as an array, not a comma-separated list","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/type/user.rb","lineNumber":594,"sourceCode":"\n      newvalues(:inclusive, :minimum)\n\n      defaultto :minimum\n    end\n\n    newproperty(:profiles, :parent => Puppet::Property::OrderedList, :required_features => :manages_solaris_rbac) do\n      desc \"The profiles the user has.  Multiple profiles should be\n        specified as an array.\"\n\n      def membership\n        :profile_membership\n      end\n\n      validate do |value|\n        if value =~ /^\\d+$/\n          raise ArgumentError, _(\"Profile names must be provided, not numbers\")\n        end\n        raise ArgumentError, _(\"Profile names must be provided as an array, not a comma-separated list\") if value.include?(\",\")\n      end\n    end\n\n    newparam(:profile_membership) do\n      desc \"Whether specified roles should be treated as the **complete list**\n        (`inclusive`) or the **minimum list** (`minimum`) of roles\n        of which the user is a member.\"\n\n      newvalues(:inclusive, :minimum)\n\n      defaultto :minimum\n    end\n\n    newproperty(:keys, :parent => Puppet::Property::KeyValue, :required_features => :manages_solaris_rbac) do\n      desc \"Specify user attributes in an array of key = value pairs.\"\n\n      def membership\n        :key_membership","sourceCodeStart":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/type/user.rb#L576-L612","documentation":"Raised by the validate block of the `profiles` property on the `user` type when a member string contains a comma. The property is an OrderedList and must receive an array of Solaris profile names; order is significant, and a comma-joined scalar would be misinterpreted as a single profile, so it is rejected at validation time.","triggerScenarios":"`user { 'alice': profiles => 'System Administrator,Basic Solaris User' }` on Solaris; joined strings from Hiera/ENC; converting `usermod -P prof1,prof2` invocations.","commonSituations":"Solaris hardening scripts converted to Puppet; scalar YAML data authored for convenience; template interpolation of arrays.","solutions":["Pass an ordered array: `profiles => ['System Administrator', 'Basic Solaris User']`","Store a YAML list in Hiera (order is preserved by lookup)","Split incoming scalars: `profiles => $raw.split(',')`"],"exampleFix":"# before\nuser { 'alice':\n  ensure    => present,\n  profiles  => 'System Administrator,Basic Solaris User',\n}\n\n# after\nuser { 'alice':\n  ensure    => present,\n  profiles  => ['System Administrator', 'Basic Solaris User'],\n}","handlingStrategy":"validation","validationCode":"profiles = raw.is_a?(String) ? raw.split(',').map(&:strip).reject(&:empty?) : Array(raw)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Author ordered profile lists as arrays in Hiera","Split comma scalars before the user resource","Preserve order when merging data — profile order is semantically meaningful"],"tags":["puppet","user-resource","solaris-rbac","profiles","list-validation"],"backgroundTag":"string-list-instead-of-array","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}