{"record":{"id":"e8fbcc7c86922ece","repo":"puppetlabs/puppet","slug":"uri-protocol-protocol-is-not-currently-suppor","errorCode":null,"errorMessage":"URI protocol '%{protocol}' is not currently supported for file serving","messagePattern":"URI protocol '%(.+?)' is not currently supported for file serving","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/file_serving/terminus_selector.rb","lineNumber":30,"sourceCode":"    case request.protocol\n    when \"file\"\n      :file\n    when \"puppet\"\n      if request.server\n        :rest\n      else\n        Puppet[:default_file_terminus]\n      end\n    when \"http\", \"https\"\n      :http\n    when nil\n      if Puppet::Util.absolute_path?(request.key)\n        :file\n      else\n        :file_server\n      end\n    else\n      raise ArgumentError, _(\"URI protocol '%{protocol}' is not currently supported for file serving\") % { protocol: request.protocol }\n    end\n  end\nend\n","sourceCodeStart":12,"sourceCodeEnd":34,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/file_serving/terminus_selector.rb#L12-L34","documentation":"Puppet::FileServing::TerminusSelector#select maps the source URI scheme to an indirection terminus: file→:file, puppet→:rest (or default_file_terminus), http/https→:http, and no scheme→:file or :file_server depending on whether the key is an absolute path. Any other protocol reaches the else branch and raises ArgumentError because no terminus can serve it.","triggerScenarios":"A file resource with `source => 'ftp://server/file'`, `rsync://...`, `s3://...`, or any scheme outside {file, puppet, http, https, nil}; also malformed sources that a URI parser still splits but with an unexpected scheme token.","commonSituations":"Assuming Puppet can fetch from arbitrary URL schemes; migrating manifests that used curl-style URLs; typos like `httpss://` or `puppets://`; copy-pasting artifact URLs from CI systems.","solutions":["Use a supported source form: `puppet:///modules/...` (file server), an absolute local path, or an http/https URL","For other protocols, fetch out-of-band (an exec resource with curl/wget, or a package/archive module) and then reference the local file","Mirror the content into a module or an HTTP endpoint Puppet can read"],"exampleFix":"# before (manifest)\nfile { '/opt/app.jar':\n  source => 'ftp://srv.example.com/app.jar',\n}\n\n# after\nfile { '/opt/app.jar':\n  source => 'https://srv.example.com/app.jar',\n}","handlingStrategy":"validation","validationCode":"SUPPORTED = %w[file puppet http https].freeze\n\ndef servable_source?(uri)\n  scheme = URI.parse(uri).scheme\n  scheme.nil? ? Puppet::Util.absolute_path?(uri) : SUPPORTED.include?(scheme.downcase)\nend","typeGuard":"# Narrow arbitrary source strings before handing them to file resources\ndef puppet_source?(s)\n  s.is_a?(String) && (s.start_with?('puppet:///', 'file://') ||\n    s.match?(%r{\\Ahttps?://}) || Puppet::Util.absolute_path?(s))\nend","tryCatchPattern":"begin\n  Puppet::FileServing::TerminusSelector.select_terminus(request)\nrescue ArgumentError => e\n  raise unless e.message.include?('not currently supported for file serving')\n  fail \"download #{request.uri} out-of-band, then source the local copy\"\nend","preventionTips":["Allow-list source schemes in your own tooling around manifests","Lint manifests for source => strings with unsupported schemes","Keep artifact fetching (ftp/s3/rsync) in CI or an exec/archive module, not in source URIs"],"tags":["puppet","file-serving","uri","unsupported-scheme","argumenterror"],"backgroundTag":"unsupported-url-scheme","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}