{"record":{"id":"00d4144af32afb9f","repo":"puppetlabs/puppet","slug":"user-provider-name-can-not-manage-home-director","errorCode":null,"errorMessage":"User provider %{name} can not manage home directories","messagePattern":"User provider %(.+?) can not manage home directories","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/type/user.rb","lineNumber":443,"sourceCode":"    newparam(:managehome, :boolean => true, :parent => Puppet::Parameter::Boolean) do\n      desc \"Whether to manage the home directory when Puppet creates or removes the user.\n        This creates the home directory if Puppet also creates the user account, and deletes the\n        home directory if Puppet also removes the user account.\n\n        This parameter has no effect unless Puppet is also creating or removing the user in the\n        resource at the same time. For instance, Puppet creates a home directory for a managed\n        user if `ensure => present` and the user does not exist at the time of the Puppet run.\n        If the home directory is then deleted manually, Puppet will not recreate it on the next\n        run.\n\n        Note that on Windows, this manages creation/deletion of the user profile instead of the\n        home directory. The user profile is stored in the `C:\\\\Users\\\\<username>` directory.\"\n\n      defaultto false\n\n      validate do |val|\n        if munge(val)\n          raise ArgumentError, _(\"User provider %{name} can not manage home directories\") % { name: provider.class.name } if provider and !provider.class.manages_homedir?\n        end\n      end\n    end\n\n    newproperty(:expiry, :required_features => :manages_expiry) do\n      desc \"The expiry date for this user. Provide as either the special\n           value `absent` to ensure that the account never expires, or as\n           a zero-padded YYYY-MM-DD format -- for example, 2010-02-19.\"\n\n      newvalues :absent\n      newvalues(/^\\d{4}-\\d{2}-\\d{2}$/)\n\n      validate do |value|\n        if value.intern != :absent and value !~ /^\\d{4}-\\d{2}-\\d{2}$/\n          # TRANSLATORS YYYY-MM-DD represents a date with a four-digit year, a two-digit month, and a two-digit day,\n          # TRANSLATORS separated by dashes.\n          raise ArgumentError, _(\"Expiry dates must be YYYY-MM-DD or the string \\\"absent\\\"\")\n        end","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/type/user.rb#L425-L461","documentation":"Raised by the validate block of the `managehome` property on the `user` type when managehome is truthy (after munge) and the selected provider exists but does not declare the `manages_homedir` feature (provider.class.manages_homedir? is false). Providers with the feature include useradd, pw, aix, openbsd, hpux, windows_adsi, and user_role_add; the LDAP provider and macOS directoryservice provider do not declare it, so they cannot create/remove home directories (on Windows the 'home' is the user profile).","triggerScenarios":"`user { 'alice': ensure => present, managehome => true }` on a node where the provider resolves to directoryservice (macOS) or ldap; forcing managehome on a node whose provider selection changed after an OS upgrade.","commonSituations":"Shared profile classes that set managehome => true applied to macOS laptops or LDAP-managed hosts; migrating from useradd-managed Linux nodes to a directory service; Puppet runs failing at resource compilation, not at sync time.","solutions":["Set `managehome => false` (the default) on nodes whose provider lacks the feature","Manage the home directory explicitly with a `file { '/home/alice': ensure => directory, ... }` resource plus appropriate ownership","If LDAP is only incidental, choose a local provider that has the feature (e.g. useradd) for those nodes","Gate the attribute per platform in the profile: only set managehome when the provider supports it"],"exampleFix":"# before\nuser { 'alice':\n  ensure      => present,\n  managehome => true,   # fails under directoryservice/ldap providers\n}\n\n# after\nuser { 'alice':\n  ensure => present,\n}\nfile { '/home/alice':\n  ensure => directory,\n  owner  => 'alice',\n  group  => 'alice',\n  mode   => '0700',\n}","handlingStrategy":"validation","validationCode":"# Ruby API: check the feature before enabling managehome\nres = Puppet::Type.type(:user).new(name: 'alice', ensure: :present)\nprovider = Puppet::Type.type(:user).provider(res[:provider]) rescue nil\nmanagehome_ok = provider && provider.manages_homes?\n\n# Puppet DSL: gate on platform in the profile\nif $facts['os']['name'] != 'Darwin' {\n  User { managehome => true }\n}","typeGuard":null,"tryCatchPattern":"begin\n  Puppet::Type.type(:user).new(name: 'alice', ensure: :present, managehome: true)\nrescue Puppet::Error => e\n  # provider feature check failure surfaces during resource creation\n  fallback = Puppet::Type.type(:user).new(name: 'alice', ensure: :present, managehome: false)\nend","preventionTips":["Remember managehome defaults to false — only opt in where the provider supports it (useradd, pw, aix, openbsd, hpux, windows_adsi, user_role_add)","On macOS (directoryservice) and LDAP-managed nodes, manage home directories with file resources","Gate managehome => true behind platform facts in shared profiles"],"tags":["puppet","user-resource","managehome","provider-features"],"backgroundTag":"provider-missing-feature","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}