{"record":{"id":"ca4eaea56c588f4b","repo":"puppetlabs/puppet","slug":"failed-to-set-owner-to-should-detail","errorCode":null,"errorMessage":"Failed to set owner to '%{should}': %{detail}","messagePattern":"Failed to set owner to '%(.+?)': %(.+?)","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/file/posix.rb","lineNumber":110,"sourceCode":"      warning _(\"Apparently using negative UID (%{currentvalue}) on a platform that does not consistently handle them\") % { currentvalue: currentvalue }\n      currentvalue = :silly\n    end\n\n    currentvalue\n  end\n\n  def owner=(should)\n    # Set our method appropriately, depending on links.\n    if resource[:links] == :manage\n      method = :lchown\n    else\n      method = :chown\n    end\n\n    begin\n      File.send(method, should, nil, resource[:path])\n    rescue => detail\n      raise Puppet::Error, _(\"Failed to set owner to '%{should}': %{detail}\") % { should: should, detail: detail }, detail.backtrace\n    end\n  end\n\n  def group\n    stat = resource.stat\n    return :absent unless stat\n\n    currentvalue = stat.gid\n\n    # On OS X, files that are owned by -2 get returned as really\n    # large GIDs instead of negative ones.  This isn't a Ruby bug,\n    # it's an OS X bug, since it shows up in perl, too.\n    if currentvalue > Puppet[:maximum_uid].to_i\n      warning _(\"Apparently using negative GID (%{currentvalue}) on a platform that does not consistently handle them\") % { currentvalue: currentvalue }\n      currentvalue = :silly\n    end\n\n    currentvalue","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/file/posix.rb#L92-L128","documentation":"Posix file provider: File.chown/lchown raised while applying the owner property; the rescue wraps the OS error with the desired owner for reporting.","triggerScenarios":"Thrown at lib/puppet/provider/file/posix.rb:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped detail: the owner name may not exist or UID may be invalid","Ensure Puppet runs with sufficient privileges to chown the file","Verify the file path still exists and is not on an unsupported filesystem"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","contentChangedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}