{"record":{"id":"89a3679fdd34a7e2","repo":"puppetlabs/puppet","slug":"generators-can-only-contain-alphanumerics-file-se","errorCode":null,"errorMessage":"Generators can only contain alphanumerics, file separators, and dashes","messagePattern":"Generators can only contain alphanumerics, file separators, and dashes","errorType":"exception","errorClass":"Puppet::ParseError","httpStatus":null,"severity":"error","filePath":"lib/puppet/parser/functions/generate.rb","lineNumber":26,"sourceCode":"    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\n  rescue Puppet::ExecutionFailure => detail\n    raise Puppet::ParseError, _(\"Failed to execute generator %{generator}: %{detail}\") % { generator: args[0], detail: detail }, detail.backtrace\n  end\nend\n","sourceCodeStart":8,"sourceCodeEnd":40,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/parser/functions/generate.rb#L8-L40","documentation":"Error \"Generators can only contain alphanumerics, file separators, and dashes\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/parser/functions/generate.rb:26 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"}