{"record":{"id":"8991485dd4343b48","repo":"puppetlabs/puppet","slug":"invalid-value-groups-groups-must-be-comma-sepa","errorCode":null,"errorMessage":"Invalid value %{groups}: Groups must be comma separated!","messagePattern":"Invalid value %(.+?): Groups must be comma separated!","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/user/aix.rb","lineNumber":87,"sourceCode":"      unless (match_obj = /\\A(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)(\\d\\d)\\z/.match(expires))\n        # TRANSLATORS 'AIX' is the name of an operating system and should not be translated\n        Puppet.warning(_(\"Could not convert AIX expires date '%{expires}' on %{class_name}[%{resource_name}]\") % { expires: expires, class_name: provider.resource.class.name, resource_name: provider.resource.name })\n        return :absent\n      end\n\n      month = match_obj[1]\n      day = match_obj[2]\n      year = match_obj[-1]\n      \"20#{year}-#{month}-#{day}\"\n    end\n\n    # We do some validation before-hand to ensure the value's an Array,\n    # a String, etc. in the property. This routine does a final check to\n    # ensure our value doesn't have whitespace before we convert it to\n    # an attribute.\n    def groups_property_to_attribute(groups)\n      if groups =~ /\\s/\n        raise ArgumentError, _(\"Invalid value %{groups}: Groups must be comma separated!\") % { groups: groups }\n      end\n\n      groups\n    end\n\n    # We do not directly use the groups attribute value because that will\n    # always include the primary group, even if our user is not one of its\n    # members. Instead, we retrieve our property value by parsing the etc/group file,\n    # which matches what we do on our other POSIX platforms like Linux and Solaris.\n    #\n    # See https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.files/group_security.htm\n    def groups_attribute_to_property(provider, _groups)\n      Puppet::Util::POSIX.groups_of(provider.resource[:name]).join(',')\n    end\n  end\n\n  mapping puppet_property: :comment,\n          aix_attribute: :gecos","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/user/aix.rb#L69-L105","documentation":"Raised by Puppet's AIX user provider when the `groups` property value contains whitespace. Before handing the value to AIX commands, groups_property_to_attribute enforces the AIX chuser expectation of a comma-separated list with no spaces; any `\\s` character in the string raises ArgumentError ('must be comma separated!').","triggerScenarios":"Setting `groups => 'staff, wheel'` (space after comma), `groups => 'staff wheel'` (space-separated), or any group name containing whitespace on a user managed by the AIX provider. Arrays are joined earlier, so `['staff', 'wheel']` is fine but a hand-written string with spaces is not.","commonSituations":"Manifests copied from Linux examples using space or ', ' separators; group data from Hiera templated with spaces; a trailing newline or space introduced by an interpolation or external data source.","solutions":["Use comma separation with no whitespace: `groups => 'staff,wheel'`.","Prefer an array: `groups => ['staff', 'wheel']` — Puppet joins it correctly.","Sanitize data at the source (Hiera/EPP templates): strip/`.split(/[,\\s]+/).join(',')`.","Check for stray whitespace with a lint-style grep over group values if the value comes from external data."],"exampleFix":"# before\nuser { 'deploy': ensure => present, groups => 'staff, wheel' }\n# after\nuser { 'deploy': ensure => present, groups => ['staff', 'wheel'] }","handlingStrategy":"type-guard","validationCode":"groups = 'staff, wheel'\nfail 'whitespace in groups' if groups.to_s =~ /\\s/","typeGuard":"def aix_groups_valid?(groups)\n  str = groups.is_a?(Array) ? groups.join(',') : groups.to_s\n  str !~ /\\s/ && str.split(',').all? { |g| g =~ /\\A\\S+\\z/ && !g.empty? }\nend","tryCatchPattern":null,"preventionTips":["Pass groups as arrays, letting Puppet join them.","Normalize external data: `value.split(/[,\\s]+/).reject(&:empty?).join(',')`.","Lint group strings from Hiera for embedded spaces/newlines."],"tags":["aix","user-management","groups","puppet","validation"],"backgroundTag":"invalid-groups-format","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}