puppetlabs/puppet · error · ArgumentError

Profile names must be provided as an array, not a comma-sepa

Error message

Profile names must be provided as an array, not a comma-separated list

What it means

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.

Source

Thrown at lib/puppet/type/user.rb:594

      newvalues(:inclusive, :minimum)

      defaultto :minimum
    end

    newproperty(:profiles, :parent => Puppet::Property::OrderedList, :required_features => :manages_solaris_rbac) do
      desc "The profiles the user has.  Multiple profiles should be
        specified as an array."

      def membership
        :profile_membership
      end

      validate do |value|
        if value =~ /^\d+$/
          raise ArgumentError, _("Profile names must be provided, not numbers")
        end
        raise ArgumentError, _("Profile names must be provided as an array, not a comma-separated list") if value.include?(",")
      end
    end

    newparam(:profile_membership) do
      desc "Whether specified roles should be treated as the **complete list**
        (`inclusive`) or the **minimum list** (`minimum`) of roles
        of which the user is a member."

      newvalues(:inclusive, :minimum)

      defaultto :minimum
    end

    newproperty(:keys, :parent => Puppet::Property::KeyValue, :required_features => :manages_solaris_rbac) do
      desc "Specify user attributes in an array of key = value pairs."

      def membership
        :key_membership

View on GitHub (pinned to e227c27540)

Solutions

  1. Pass an ordered array: `profiles => ['System Administrator', 'Basic Solaris User']`
  2. Store a YAML list in Hiera (order is preserved by lookup)
  3. Split incoming scalars: `profiles => $raw.split(',')`

Example fix

# before
user { 'alice':
  ensure    => present,
  profiles  => 'System Administrator,Basic Solaris User',
}

# after
user { 'alice':
  ensure    => present,
  profiles  => ['System Administrator', 'Basic Solaris User'],
}
Defensive patterns

Strategy: validation

Validate before calling

profiles = raw.is_a?(String) ? raw.split(',').map(&:strip).reject(&:empty?) : Array(raw)

Prevention

When it happens

Trigger: `user { 'alice': profiles => 'System Administrator,Basic Solaris User' }` on Solaris; joined strings from Hiera/ENC; converting `usermod -P prof1,prof2` invocations.

Common situations: Solaris hardening scripts converted to Puppet; scalar YAML data authored for convenience; template interpolation of arrays.

Related errors


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/a5c6c34e4918e8fc. Report an issue: GitHub.