{"record":{"id":"7bf9f9e81117998e","repo":"puppetlabs/puppet","slug":"could-not-set-password-on-resource-class-name","errorCode":null,"errorMessage":"Could not set password on #{@resource.class.name}[#{@resource.name}]: #{detail}","messagePattern":"Could not set password on #(.+?)\\[#(.+?)\\]: #(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/user/aix.rb","lineNumber":237,"sourceCode":"      # Options '-e', '-c', use encrypted password and clear flags\n      # Must receive \"user:enc_password\" as input\n      # command, arguments = {:failonfail => true, :combine => true}\n      # Fix for bugs #11200 and #10915\n      cmd = [self.class.command(:chpasswd), *ia_module_args, '-e', '-c']\n      execute_options = {\n        :failonfail => false,\n        :combine => true,\n        :stdinfile => tempfile.path\n      }\n      output = execute(cmd, execute_options)\n\n      # chpasswd can return 1, even on success (at least on AIX 6.1); empty output\n      # indicates success\n      if output != \"\"\n        raise Puppet::ExecutionFailure, \"chpasswd said #{output}\"\n      end\n    rescue Puppet::ExecutionFailure => detail\n      raise Puppet::Error, \"Could not set password on #{@resource.class.name}[#{@resource.name}]: #{detail}\", detail.backtrace\n    ensure\n      if tempfile\n        # Extra close will noop. This is in case the write to our tempfile\n        # fails.\n        tempfile.close()\n        tempfile.delete()\n      end\n    end\n  end\n\n  def create\n    super\n\n    # We specify the 'groups' AIX attribute in AixObject's create method\n    # when creating our user. However, this does not always guarantee that\n    # our 'groups' property is set to the right value. For example, the\n    # primary group will always be included in the 'groups' property. This is\n    # bad if we're explicitly managing the 'groups' property under inclusive","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/user/aix.rb#L219-L255","documentation":"Wrapper error from Puppet's AIX user provider: the password setter rescues the Puppet::ExecutionFailure raised when chpasswd emits output (including the 'chpasswd said ...' case) and re-raises it as Puppet::Error prefixed with the resource type and title, attaching the original backtrace. It is the user-facing form of any AIX password-set failure.","triggerScenarios":"Any `password =>` sync on an AIX user where the underlying chpasswd invocation fails or prints diagnostics: policy rejection, unsupported hash format, user stanza issues, or genuine execution errors (command missing, permissions).","commonSituations":"Same contexts as the chpasswd failure — mismatched hash algorithms vs policy.cfg, strict pwdcheck policies, AIX 6.1 quirks — plus missing /usr/bin/chpasswd in a minimized AIX image.","solutions":["Unwrap the message: the 'Detail'/inner text contains the chpasswd output — fix that root cause first.","Confirm /usr/sbin/chpasswd (LAM path) exists and the agent runs with sufficient privileges (root).","Align hash format with /etc/security/policy.cfg or adjust the policy, then re-run.","Test the exact operation on the node: `echo 'user:crypthash' | chpasswd -e -c`."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"File.exist?('/usr/bin/chpasswd') or raise 'chpasswd missing'\nProcess.uid.zero? or raise 'password management requires root'","typeGuard":null,"tryCatchPattern":"begin\n  provider.password = crypted\nrescue Puppet::Error => e\n  if e.message =~ /Could not set password on/\n    # inner 'Detail:' holds chpasswd output; branch on policy vs execution failure\n    inner = e.message[/Detail: (.*)/, 1]\n    report_password_failure(inner)\n  end\n  raise\nend","preventionTips":["Run the agent as root for user/password management.","Fix the underlying chpasswd complaint (policy/format) rather than catching-and-ignoring.","Verify chpasswd exists in minimized AIX images used with Puppet."],"tags":["aix","user-management","password","puppet"],"backgroundTag":"user-password-set-failed","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}