{"record":{"id":"3da51fd30eda7c6c","repo":"apple/pkl","slug":"ioerrorloadingmodule-3da51f","errorCode":"ioErrorLoadingModule","errorMessage":"ioErrorLoadingModule","messagePattern":"ioErrorLoadingModule","errorType":"error_code","errorClass":"VmException","httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/runtime/VmImportAnalyzer.java","lineNumber":95,"sourceCode":"      analyzeSingle(imprt.moduleUri, imprt.resolvedModuleKey, context, imports, resolvedImports);\n    }\n  }\n\n  private static Set<ImportEntry> collectImports(\n      ResolvedModuleKey resolvedModuleKey,\n      ModuleResolver moduleResolver,\n      SecurityManager securityManager) {\n    List<Entry> importsAndReads;\n    var moduleKey = resolvedModuleKey.getOriginal();\n    try {\n      importsAndReads = ImportsAndReadsParser.parse(moduleKey, resolvedModuleKey);\n    } catch (VmException err) {\n      throw new VmExceptionBuilder()\n          .evalError(\"cannotAnalyzeBecauseSyntaxError\", moduleKey.getUri())\n          .wrapping(err)\n          .build();\n    } catch (IOException err) {\n      throw new VmExceptionBuilder().evalError(\"ioErrorLoadingModule\", moduleKey.getUri()).build();\n    }\n    var result = new HashSet<ImportEntry>();\n    for (var entry : importsAndReads) {\n      if (!entry.isModule()) {\n        continue;\n      }\n      try {\n        if (entry.isGlob()) {\n          var theModuleKey =\n              moduleResolver.resolve(moduleKey.resolveUri(IoUtils.toUri(entry.stringValue())));\n          var elements =\n              GlobResolver.resolveGlob(\n                  securityManager,\n                  theModuleKey,\n                  moduleKey,\n                  moduleKey.getUri(),\n                  entry.stringValue());\n          for (var globElement : elements.values()) {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/runtime/VmImportAnalyzer.java#L77-L113","documentation":"During import analysis, reading the module for parsing threw an IOException; Pkl rethrows ioErrorLoadingModule with the module URI. It means the module could not be loaded at all (I/O failure), not that it failed to parse.","triggerScenarios":"IOException in ImportsAndReadsParser.parse() during collectImports: unreadable file, broken reader/external process, network path problem for the given module URI.","commonSituations":"File deleted or permissions changed between resolution and read; network filesystem down; bad environment mapping causing an unreadable path.","solutions":["Verify the module file exists and is readable at the reported URI","Check file permissions and network/file-system availability","Fix the environment/path mapping for the URI scheme used"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"if (!fs.existsSync(moduleUriToPath(uri))) throw new Error('module unreadable: ' + uri)","typeGuard":null,"tryCatchPattern":"try { analyzeImports(uri) } catch (e) { if (e.code === 'ioErrorLoadingModule') { retryWithBackoff(() => analyzeImports(uri)) } else throw e }","preventionTips":["Ensure files are readable by the evaluating process","Avoid editing/deleting modules during evaluation","Check network/file-system health for remote sources"],"tags":["pkl","io","import","filesystem"],"backgroundTag":"file-read-failed","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"}