{"record":{"id":"d297182fa2785e13","repo":"puppetlabs/puppet","slug":"generators-must-be-fully-qualified","errorCode":null,"errorMessage":"Generators must be fully qualified","messagePattern":"Generators must be fully qualified","errorType":"exception","errorClass":"Puppet::ParseError","httpStatus":null,"severity":"error","filePath":"lib/puppet/parser/functions/generate.rb","lineNumber":17,"sourceCode":"# frozen_string_literal: true\n\n# Runs an external command and returns the results\nPuppet::Parser::Functions.newfunction(:generate, :arity => -2, :type => :rvalue,\n                                                 :doc => \"Calls an external command on the Puppet master and returns\n    the results of the command. Any arguments are passed to the external command as\n    arguments. If the generator does not exit with return code of 0,\n    the generator is considered to have failed and a parse error is\n    thrown. Generators can only have file separators, alphanumerics, dashes,\n    and periods in them. This function will attempt to protect you from\n    malicious generator calls (e.g., those with '..' in them), but it can\n    never be entirely safe. No subshell is used to execute\n    generators, so all shell metacharacters are passed directly to\n    the generator, and all metacharacters are returned by the function.\n    Consider cleaning white space from any string generated.\") do |args|\n  # TRANSLATORS \"fully qualified\" refers to a fully qualified file system path\n  raise Puppet::ParseError, _(\"Generators must be fully qualified\") unless Puppet::Util.absolute_path?(args[0])\n\n  if Puppet::Util::Platform.windows?\n    valid = args[0] =~ %r{^[a-z]:(?:[/\\\\][-.~\\w]+)+$}i\n  else\n    valid = args[0] =~ %r{^[-/\\w.+]+$}\n  end\n\n  unless valid\n    raise Puppet::ParseError, _(\"Generators can only contain alphanumerics, file separators, and dashes\")\n  end\n\n  if args[0] =~ /\\.\\./\n    raise Puppet::ParseError, _(\"Can not use generators with '..' in them.\")\n  end\n\n  begin\n    dir = File.dirname(args[0])\n    Puppet::Util::Execution.execute(args, failonfail: true, combine: true, cwd: dir).to_str","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/generate.rb#L1-L35","documentation":"Error \"Generators must be fully qualified\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/parser/functions/generate.rb:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}