{"record":{"id":"4c61809962a17282","repo":"apache/pulsar","slug":"the-archive-property-must-be-specified-in-sourceco","errorCode":null,"errorMessage":"The archive property must be specified in SourceConfig./SinkConfig.","messagePattern":"The archive property must be specified in SourceConfig\\./SinkConfig\\.","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java","lineNumber":534,"sourceCode":"                        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:\n                            throw new IllegalStateException(\"Unexpected ComponentType: \" + componentType);\n                    }\n                    throw new IllegalStateException(errorMsg);\n                }\n            }\n        }\n        return new UserCodeClassLoader(classLoader, classLoaderCreated);\n    }\n\n    private void startProcessMode(FunctionDetails functionDetails,\n                                           int parallelism, int instanceIdOffset, String serviceUrl,\n                                           String stateStorageServiceUrl, AuthenticationConfig authConfig,\n                                           String userCodeFile, String transformFunctionFile) throws Exception {\n        SecretsProviderConfigurator secretsProviderConfigurator = getSecretsProviderConfigurator();\n        runtimeFactory = new ProcessRuntimeFactory(\n                serviceUrl,\n                webServiceUrl,\n                stateStorageServiceUrl,\n                authConfig,\n                null, /* java instance jar file */\n                null, /* python instance file */","sourceCodeStart":516,"sourceCodeEnd":552,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/localrun/src/main/java/org/apache/pulsar/functions/LocalRunner.java#L516-L552","documentation":"For Source or Sink components, LocalRunner requires the archive property to be set (sources/sinks are always loaded from an archive/NAR). extractClassLoader throws IllegalStateException '<archive property must be specified in SourceConfig./SinkConfig.>' when it is missing.","triggerScenarios":"Building a SourceConfig or SinkConfig without calling setArchive(...) and then starting LocalRunner; archive null-ed by later code paths.","commonSituations":"Copied function examples (functions don't need an archive) adapted to sources/sinks without setting archive; programmatically constructed source/sink configs missing the field.","solutions":["Call setArchive(\"/absolute/path/to/built-nar-or-jar\") on the SourceConfig/SinkConfig","Verify the config instance passed to LocalRunner is the one carrying the archive","For builtin connectors use the builtin: prefix if your setup supports it, otherwise always supply an archive"],"exampleFix":"// before\nSinkConfig sinkConfig = new SinkConfig();\nsinkConfig.setClassName(\"org.example.MySink\");\n// after\nSinkConfig sinkConfig = new SinkConfig();\nsinkConfig.setClassName(\"org.example.MySink\");\nsinkConfig.setArchive(\"/path/to/pulsar-io-my-sink.nar\");","handlingStrategy":"validation","validationCode":"if ((config instanceof SourceConfig && ((SourceConfig) config).getArchive() == null)\n        || (config instanceof SinkConfig && ((SinkConfig) config).getArchive() == null)) {\n    throw new IllegalStateException(\"archive is required for source/sink configs\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    runner.start(true);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"archive property must be specified\")) {\n        // set archive and restart with a fresh runner\n    }\n}","preventionTips":["Always call setArchive on SourceConfig/SinkConfig","Verify built NAR path exists before start","Don't reuse function-only examples for connectors"],"tags":["configuration","validation","illegal-state"],"backgroundTag":"missing-required-config","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"}