{"record":{"id":"9b5e209ddec8fcfe","repo":"apple/pkl","slug":"externalreaderdoesnotsupportscheme-9b5e20","errorCode":"externalReaderDoesNotSupportScheme","errorMessage":"ErrorMessages.create(\"externalReaderDoesNotSupportScheme\", \"resource\", scheme)","messagePattern":"ErrorMessages\\.create\\(\"externalReaderDoesNotSupportScheme\", \"resource\", scheme\\)","errorType":"error_code","errorClass":"ExternalReaderProcessException","httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/resource/ResourceReaders.java","lineNumber":679,"sourceCode":"    private final ExternalReaderProcess process;\n    private final long evaluatorId;\n    private @Nullable ExternalResolver underlying;\n\n    public ExternalProcess(String scheme, ExternalReaderProcess process, long evaluatorId) {\n      this.scheme = scheme;\n      this.process = process;\n      this.evaluatorId = evaluatorId;\n    }\n\n    private ExternalResolver getUnderlyingReader()\n        throws ExternalReaderProcessException, IOException {\n      if (underlying != null) {\n        return underlying;\n      }\n\n      var spec = process.getResourceReaderSpec(scheme);\n      if (spec == null) {\n        throw new ExternalReaderProcessException(\n            ErrorMessages.create(\"externalReaderDoesNotSupportScheme\", \"resource\", scheme));\n      }\n      underlying = new ExternalResolver(spec, process.getResourceResolver(evaluatorId));\n      return underlying;\n    }\n\n    @Override\n    public String getUriScheme() {\n      return scheme;\n    }\n\n    @Override\n    public boolean hasHierarchicalUris() throws ExternalReaderProcessException, IOException {\n      return getUnderlyingReader().hasHierarchicalUris();\n    }\n\n    @Override\n    public boolean isGlobbable() throws ExternalReaderProcessException, IOException {","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/resource/ResourceReaders.java#L661-L697","documentation":"This ExternalReaderProcessException is thrown when an external reader process is asked to handle a URI scheme it does not declare support for. ResourceReaders looks up getResourceReaderSpec(scheme) on the external reader process; if the process has no spec for that scheme, no ExternalResolver can be built and the lookup fails. The message names the kind (\"resource\") and the offending scheme.","triggerScenarios":"Configuring external readers (readerProcess declarations) whose supported scheme list does not include the scheme of a resource being read; the built-in `underlying` resolver is null so the external spec lookup runs and returns null.","commonSituations":"Reader process registered for e.g. `myproto` but code reads a `file` or `https` resource; typo in the scheme attribute of the readerProcess block; resource scheme changed after adding the external reader.","solutions":["Add the missing scheme to the external reader process's supported `scheme` attribute in its declaration.","Correct the scheme typo in either the readerProcess config or the resource URI.","Register a built-in/Java ResourceReader for that scheme instead of relying on the external process."],"exampleFix":"// before (pkl script)\nreaderProcess { scheme = \"myproto\" }\nread(\"https://example.com/x\")\n// after\nreaderProcess { scheme = \"myproto\" }\nread(\"myproto://example.com/x\")","handlingStrategy":"validation","validationCode":"// check declared schemes of readerProcess blocks against URIs used\nval declared = setOf(\"myproto\");\nval used = uri.substringBefore(\":\");\nrequire(used in declared || used in builtinSchemes) { \"external reader does not support scheme '$used'\" }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the readerProcess `scheme` attribute in sync with the URIs read","One readerProcess per scheme; list all schemes it serves","Catch ExternalReaderProcessException in tooling to print config guidance"],"tags":["pkl","external-reader","scheme","configuration"],"backgroundTag":"unsupported-operation","analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}