{"record":{"id":"bb61ce2ace5238e9","repo":"apache/pulsar","slug":"s-archive-s-does-not-exist","errorCode":null,"errorMessage":"%s archive (%s) does not exist","messagePattern":"(.+?) archive \\((.+?)\\) does not exist","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java","lineNumber":513,"sourceCode":"                classLoaderCreated = true;\n            } else if (userCodeFile != null) {\n                File file = new File(userCodeFile);\n                if (!file.exists()) {\n                    String errorMsg;\n                    switch (componentType) {\n                        case FUNCTION:\n                            errorMsg = \"User jar\";\n                            break;\n                        case SOURCE:\n                            errorMsg = \"Source archive\";\n                            break;\n                        case SINK:\n                            errorMsg = \"Sink archive\";\n                            break;\n                        default:\n                            throw new IllegalStateException(\"Unexpected value: \" + componentType);\n                    }\n                    throw new RuntimeException(errorMsg + \" (\" + userCodeFile + \") does not exist\");\n                }\n                classLoader = FunctionRuntimeCommon.getClassLoaderFromPackage(\n                        componentType, className, file, narExtractionDirectory);\n                classLoaderCreated = true;\n            } else {\n                if (!(runtimeEnv == null || runtimeEnv == RuntimeEnv.THREAD)) {\n                    String errorMsg;\n                    switch (componentType) {\n                        case FUNCTION:\n                            errorMsg = \"The jar property must be specified in FunctionConfig.\";\n                            break;\n                        case SOURCE:\n                            errorMsg = \"The archive property must be specified in SourceConfig.\";\n                            break;\n                        case SINK:\n                            errorMsg = \"The archive property must be specified in SinkConfig.\";\n                            break;\n                        default:","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java#L495-L531","documentation":"In extractClassLoader, LocalRunner resolves the user-code archive file from the function/source/sink config's archive location and checks Files.exists on it. When the archive path points to nothing on disk it throws RuntimeException '<Type> archive (<path>) does not exist'. The component type (Function/Source/Sink) is prefixed in the message.","triggerScenarios":"FunctionConfig/SourceConfig/SinkConfig archive set to a non-existent path, a relative path resolved against a different working directory, or a jar deleted between config time and start time.","commonSituations":"Typos in archive path; building in one module while the target jar lives elsewhere; running localrun from a different working directory than expected; CI artifacts not built before the run.","solutions":["Correct the archive path in the config to point to the built jar/NAR","Use an absolute path for the archive","Build the target jar/NAR (mvn/gradle package) before starting the runner","Verify with Files.exists(...) or ls before invoking start"],"exampleFix":"// before\nsourceConfig.setArchive(\"target/my-source.nar\");\n// after\nsourceConfig.setArchive(Paths.get(System.getProperty(\"user.dir\"),\n        \"target/my-source.nar\").toAbsolutePath().toString());","handlingStrategy":"validation","validationCode":"String archive = sourceConfig.getArchive(); // or function/sink\nif (archive == null || !java.nio.file.Files.exists(java.nio.file.Path.of(archive))) {\n    throw new IllegalStateException(\"Archive does not exist: \" + archive);\n}","typeGuard":null,"tryCatchPattern":"try {\n    runner.start(true);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"does not exist\")) {\n        // build artifact or fix archive path, then retry with a new runner\n    }\n}","preventionTips":["Use absolute archive paths","Build jars/NARs before starting localrun","Check Files.exists on the archive in test setup"],"tags":["filesystem","configuration","missing-file"],"backgroundTag":"archive-not-found","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}