puppetlabs/puppet · error · Puppet::Error

No input to process given on command line or stdin

Error message

No input to process given on command line or stdin

What it means

Raised by the `render` action of `puppet epp` when there is no template to render: no `-e` inline source, no file arguments, and STDIN is an interactive TTY (piped stdin would be rendered instead via `render_inline(STDIN.read, ...)`). Like the other epp actions, the face is all-or-nothing and aborts rather than blocking on the terminal.

Source

Thrown at lib/puppet/face/epp.rb:347

    when_invoked do |*args|
      options = args.pop
      options[:header] = options[:header].nil? ? true : options[:header]

      compiler = create_compiler(options)
      compiler.with_context_overrides('For rendering epp') do
        # Print to a buffer since the face needs to return the resulting string
        # and the face API is "all or nothing"
        #
        buffer = StringIO.new
        status = true
        if options[:e]
          buffer.print render_inline(options[:e], compiler, options)
        elsif args.empty?
          if !STDIN.tty?
            buffer.print render_inline(STDIN.read, compiler, options)
          else
            raise Puppet::Error, _("No input to process given on command line or stdin")
          end
        else
          show_filename = args.count > 1
          file_nbr = 0
          args.each do |file|
            buffer.print render_file(file, compiler, options, show_filename, file_nbr += 1)
          rescue Puppet::ParseError => detail
            Puppet.err(detail.message)
            status = false
          end
        end
        raise Puppet::Error, _("error while rendering epp") unless status

        buffer.string
      end
    end
  end

View on GitHub (pinned to e227c27540)

Solutions

  1. Inline: `puppet epp render -e 'Hello <%= $name %>' --values '{"name":"World"}'`
  2. File: `puppet epp render template.epp` (plus --values for parameters)
  3. Pipe: `cat t.epp | puppet epp render`

Example fix

# before
puppet epp render
# after
puppet epp render -e 'v=<%= $v %>' --values '{"v":1}'
Defensive patterns

Strategy: validation

Validate before calling

abort 'no input: pass -e, template files, or pipe stdin' if ARGV.empty? && $stdin.tty? && !options[:e]

Prevention

When it happens

Trigger: Plain `puppet epp render` in an interactive shell; automation invoking render without wiring stdin or passing file arguments.

Common situations: Interactive experimentation; scripts where an empty/undefined variable collapses the argument list to nothing; cron or CI jobs missing their input redirection.

Related errors


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