puppetlabs/puppet · error · Puppet::Error
No input to parse given on command line or stdin
Error message
No input to parse given on command line or stdin
What it means
Raised by the `dump` action of `puppet epp` when there is no input to parse: no `-e` inline source, no template file arguments, and STDIN is an interactive TTY (the `!STDIN.tty?` check exists because a piped stdin would be read instead). The face API is all-or-nothing, so it refuses to block on an interactive stdin and aborts.
Source
Thrown at lib/puppet/face/epp.rb:180
# pass a dummy node, as facts are not needed for dump
options[:node] = Puppet::Node.new("testnode", :facts => Puppet::Node::Facts.new("facts", {}))
options[:header] = options[:header].nil? ? true : options[:header]
options[:validate] = options[:validate].nil? ? true : options[:validate]
compiler = create_compiler(options)
# Print to a buffer since the face needs to return the resulting string
# and the face API is "all or nothing"
#
buffer = StringIO.new
if options[:e]
buffer.print dump_parse(options[:e], 'command-line-string', options, false)
elsif args.empty?
if !STDIN.tty?
buffer.print dump_parse(STDIN.read, 'stdin', options, false)
else
raise Puppet::Error, _("No input to parse given on command line or stdin")
end
else
templates, missing_files = args.each_with_object([[], []]) do |file, memo|
template_file = effective_template(file, compiler.environment)
if template_file.nil?
memo[1] << file
else
memo[0] << template_file
end
end
show_filename = templates.count > 1
templates.each do |file|
buffer.print dump_parse(Puppet::FileSystem.read(file, :encoding => 'utf-8'), file, options, show_filename)
end
unless missing_files.empty?
raise Puppet::Error, _("One or more file(s) specified did not exist:\n%{missing_files_list}") %View on GitHub (pinned to e227c27540)
Solutions
- Pass an inline source: `puppet epp dump -e '<%= $x %>'`
- Pass template file(s): `puppet epp dump template.epp`
- Pipe input: `cat t.epp | puppet epp dump` (non-TTY stdin is read automatically)
Example fix
# before puppet epp dump # interactive, no stdin # after puppet epp dump -e '<%= $facts["hostname"] %>' # or cat template.epp | puppet epp dump
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
- In scripts, always pass -e or explicit file paths rather than relying on stdin
- Detect interactive stdin with $stdin.tty? and substitute a clear usage message
- Quote variables so empty inputs fail loudly in the wrapper instead of inside puppet
When it happens
Trigger: Plain `puppet epp dump` in an interactive shell; wrappers that sometimes pipe input but invoke the command unconditionally; containers/CI where the caller assumed a file argument would be present.
Common situations: Interactive exploration expecting a prompt; scripts where an unquoted empty variable collapses to zero arguments; CI jobs configured without wiring stdin.
Related errors
- No input to process given on command line or stdin
- No input to parse given on command line or stdin
- Only .yaml or .pp can be used as a --values_file
- --values option must evaluate to a Hash or undef, got: '%{va
- Error parsing arguments
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/9b50acae095f9792.
Report an issue: GitHub.