apache/pulsar · error · IllegalArgumentException
Sink package is not provided
Error message
Sink package is not provided
What it means
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.
Source
Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:790
}
}
boolean shouldCloseFunctionPackage = false;
ValidatableFunctionPackage transformFunctionPackage = null;
boolean shouldCloseTransformFunctionPackage = false;
try {
// if sink is not builtin, attempt to extract classloader from package file if it exists
WorkerConfig workerConfig = worker().getWorkerConfig();
if (connectorFunctionPackage == null && sinkPackageFile != null) {
connectorFunctionPackage =
new FunctionFilePackage(sinkPackageFile, workerConfig.getNarExtractionDirectory(),
workerConfig.getEnableClassloadingOfExternalFiles(), ConnectorDefinition.class);
shouldCloseFunctionPackage = true;
}
if (connectorFunctionPackage == null) {
throw new IllegalArgumentException("Sink package is not provided");
}
if (isNotBlank(sinkConfig.getTransformFunction())) {
transformFunctionPackage =
getBuiltinFunctionPackage(sinkConfig.getTransformFunction());
if (transformFunctionPackage == null) {
File functionPackageFile = getPackageFile(FunctionDetails.ComponentType.FUNCTION,
sinkConfig.getTransformFunction());
transformFunctionPackage =
new FunctionFilePackage(functionPackageFile, workerConfig.getNarExtractionDirectory(),
workerConfig.getEnableClassloadingOfExternalFiles(), ConnectorDefinition.class);
shouldCloseTransformFunctionPackage = true;
}
if (transformFunctionPackage == null) {
throw new IllegalArgumentException("Transform Function package not found");
}
}
View on GitHub (pinned to 820761864e)
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.
Example fix
// before: neither archive nor file given pulsar-admin sinks create --tenant t --namespace n --name s --inputs in // missing archive/package // after pulsar-admin sinks create --tenant t --namespace n --name s --inputs in \ --archive builtin://pulsar-io-kafka-3.2.0.nar --sink-config sinkConfig.yaml
Defensive patterns
Strategy: validation
Validate before calling
if ((archive == null || archive.isBlank()) && sinkPackageFile == null) {
throw new IllegalStateException("Provide either an archive URL or a sink package file");
} Type guard
boolean hasSinkArtifact(String archive, File pkg) { return (archive != null && !archive.isBlank()) || (pkg != null && pkg.length() > 0); } Try / catch
try { admin.sources().createSource(...); } catch (PulsarAdminException e) { if (e.getStatusCode() == 400 && e.getMessage().contains("not provided")) { /* supply archive or file and retry */ } throw e; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- %s Package is not provided
- <validation message from IllegalArgumentException>
- Tenant is not provided
- Namespace is not provided
- Function name is not provided
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/bfbb4910feef9736.
Report an issue: GitHub.