{"record":{"id":"9b50acae095f9792","repo":"puppetlabs/puppet","slug":"no-input-to-parse-given-on-command-line-or-stdin","errorCode":null,"errorMessage":"No input to parse given on command line or stdin","messagePattern":"No input to parse given on command line or stdin","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/face/epp.rb","lineNumber":180,"sourceCode":"      # pass a dummy node, as facts are not needed for dump\n      options[:node] = Puppet::Node.new(\"testnode\", :facts => Puppet::Node::Facts.new(\"facts\", {}))\n      options[:header] = options[:header].nil? ? true : options[:header]\n      options[:validate] = options[:validate].nil? ? true : options[:validate]\n\n      compiler = create_compiler(options)\n\n      # Print to a buffer since the face needs to return the resulting string\n      # and the face API is \"all or nothing\"\n      #\n      buffer = StringIO.new\n\n      if options[:e]\n        buffer.print dump_parse(options[:e], 'command-line-string', options, false)\n      elsif args.empty?\n        if !STDIN.tty?\n          buffer.print dump_parse(STDIN.read, 'stdin', options, false)\n        else\n          raise Puppet::Error, _(\"No input to parse given on command line or stdin\")\n        end\n      else\n        templates, missing_files = args.each_with_object([[], []]) do |file, memo|\n          template_file = effective_template(file, compiler.environment)\n          if template_file.nil?\n            memo[1] << file\n          else\n            memo[0] << template_file\n          end\n        end\n\n        show_filename = templates.count > 1\n        templates.each do |file|\n          buffer.print dump_parse(Puppet::FileSystem.read(file, :encoding => 'utf-8'), file, options, show_filename)\n        end\n\n        unless missing_files.empty?\n          raise Puppet::Error, _(\"One or more file(s) specified did not exist:\\n%{missing_files_list}\") %","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/face/epp.rb#L162-L198","documentation":"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.","triggerScenarios":"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.","commonSituations":"Interactive exploration expecting a prompt; scripts where an unquoted empty variable collapses to zero arguments; CI jobs configured without wiring stdin.","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)"],"exampleFix":"# before\npuppet epp dump                 # interactive, no stdin\n# after\npuppet epp dump -e '<%= $facts[\"hostname\"] %>'\n# or\ncat template.epp | puppet epp dump","handlingStrategy":"validation","validationCode":"abort 'no input: pass -e, template files, or pipe stdin' if ARGV.empty? && $stdin.tty? && !options[:e]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["epp","cli","missing-input","stdin"],"backgroundTag":"missing-input","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}