puppetlabs/puppet · error · Puppet::Error

Cannot write the %{path} user's crontab: The user does not e

Error message

Cannot write the %{path} user's crontab: The user does not exist

What it means

Error "Cannot write the %{path} user's crontab: The user does not exist" thrown in puppetlabs/puppet.

Source

Thrown at lib/puppet/util/filetype.rb:233

    # Remove a specific @path's cron tab.
    def remove
      cmd = "#{cmdbase} -r"
      if %w[Darwin FreeBSD DragonFly].include?(Puppet.runtime[:facter].value('os.name'))
        cmd = "/bin/echo yes | #{cmd}"
      end

      Puppet::Util::Execution.execute(cmd, failonfail: true, combine: true)
    end

    # Overwrite a specific @path's cron tab; must be passed the @path name
    # and the text with which to create the cron tab.
    #
    # TODO: We should refactor this at some point to make it identical to the
    # :aixtab and :suntab's write methods so that, at the very least, the pipe
    # is not created and the crontab command's errors are not swallowed.
    def write(text)
      unless Puppet::Util.uid(@path)
        raise Puppet::Error, _("Cannot write the %{path} user's crontab: The user does not exist") % { path: @path }
      end

      # this file is managed by the OS and should be using system encoding
      IO.popen("#{cmdbase()} -", "w", :encoding => Encoding.default_external) { |p|
        p.print text
      }
    end

    private

    # Only add the -u flag when the @path is different.  Fedora apparently
    # does not think I should be allowed to set the @path to my own user name
    def cmdbase
      if @uid == Puppet::Util::SUIDManager.uid || Puppet.runtime[:facter].value('os.name') == "HP-UX"
        "crontab"
      else
        "crontab -u #{@path}"
      end

View on GitHub (pinned to e227c27540)

When it happens

Trigger: Thrown at lib/puppet/util/filetype.rb:233 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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