{"record":{"id":"bfbb4910feef9736","repo":"apache/pulsar","slug":"sink-package-is-not-provided","errorCode":null,"errorMessage":"Sink package is not provided","messagePattern":"Sink package is not provided","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java","lineNumber":790,"sourceCode":"            }\n        }\n\n        boolean shouldCloseFunctionPackage = false;\n        ValidatableFunctionPackage transformFunctionPackage = null;\n        boolean shouldCloseTransformFunctionPackage = false;\n        try {\n\n            // if sink is not builtin, attempt to extract classloader from package file if it exists\n            WorkerConfig workerConfig = worker().getWorkerConfig();\n            if (connectorFunctionPackage == null && sinkPackageFile != null) {\n                connectorFunctionPackage =\n                        new FunctionFilePackage(sinkPackageFile, workerConfig.getNarExtractionDirectory(),\n                                workerConfig.getEnableClassloadingOfExternalFiles(), ConnectorDefinition.class);\n                shouldCloseFunctionPackage = true;\n            }\n\n            if (connectorFunctionPackage == null) {\n                throw new IllegalArgumentException(\"Sink package is not provided\");\n            }\n\n            if (isNotBlank(sinkConfig.getTransformFunction())) {\n                transformFunctionPackage =\n                        getBuiltinFunctionPackage(sinkConfig.getTransformFunction());\n                if (transformFunctionPackage == null) {\n                    File functionPackageFile = getPackageFile(FunctionDetails.ComponentType.FUNCTION,\n                            sinkConfig.getTransformFunction());\n                    transformFunctionPackage =\n                            new FunctionFilePackage(functionPackageFile, workerConfig.getNarExtractionDirectory(),\n                                    workerConfig.getEnableClassloadingOfExternalFiles(), ConnectorDefinition.class);\n                    shouldCloseTransformFunctionPackage = true;\n                }\n                if (transformFunctionPackage == null) {\n                    throw new IllegalArgumentException(\"Transform Function package not found\");\n                }\n            }\n","sourceCodeStart":772,"sourceCodeEnd":808,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java#L772-L808","documentation":"validateUpdateRequestParams requires either a builtin:// connector archive or an uploaded sink package file. If neither produced a connectorFunctionPackage, it throws IllegalArgumentException('Sink package is not provided'), meaning the request did not carry any usable sink implementation.","triggerScenarios":"registerSink/updateSink where archive is neither builtin:// nor a valid package location AND no sinkPackageFile (NAR/JAR upload) was supplied in the multipart request; or the provided package file failed to open as a FunctionFilePackage leaving connectorFunctionPackage null.","commonSituations":"CLI/REST calls that omit --archive and --sink-file together; empty or corrupt uploaded NAR; using an unrecognized archive URL scheme the worker cannot resolve; form field name mismatch in the multipart upload.","solutions":["Provide a valid archive: set sinkConfig archive to a builtin:// name or a resolvable package URL.","Or upload the sink NAR/JAR as the sinkPackageFile part of the multipart request.","Verify the uploaded file is a readable NAR/JAR and not zero bytes; re-download/rebuild it."],"exampleFix":"// before: neither archive nor file given\npulsar-admin sinks create --tenant t --namespace n --name s --inputs in   // missing archive/package\n// after\npulsar-admin sinks create --tenant t --namespace n --name s --inputs in \\\n  --archive builtin://pulsar-io-kafka-3.2.0.nar --sink-config sinkConfig.yaml","handlingStrategy":"validation","validationCode":"if ((archive == null || archive.isBlank()) && sinkPackageFile == null) {\n    throw new IllegalStateException(\"Provide either an archive URL or a sink package file\");\n}","typeGuard":"boolean hasSinkArtifact(String archive, File pkg) { return (archive != null && !archive.isBlank()) || (pkg != null && pkg.length() > 0); }","tryCatchPattern":"try { admin.sources().createSource(...); } catch (PulsarAdminException e) { if (e.getStatusCode() == 400 && e.getMessage().contains(\"not provided\")) { /* supply archive or file and retry */ } throw e; }","preventionTips":["Always pass --archive or the package file with sink/source create","Validate uploaded NARs are non-empty and openable before upload","Use templated deploy scripts with required-argument checks","Prefer builtin:// or function:// URLs over ad-hoc file uploads"],"tags":["validation","missing-package","rest-api","pulsar-functions"],"backgroundTag":"missing-required-parameter","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"}