apache/pulsar · error · IllegalArgumentException
Source package is not provided
Error message
Source package is not provided
What it means
validateUpdateRequestParams throws this IllegalArgumentException when, after processing the sourcePackageFile upload and any builtin:// archive, no connector function package could be established. The update/register request effectively carried no usable source package.
Source
Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java:740
throw new IllegalArgumentException("Built-in source is not available");
}
connectorFunctionPackage = connector.getConnectorFunctionPackage();
}
}
boolean shouldCloseFunctionPackage = false;
try {
// if source is not builtin, attempt to extract classloader from package file if it exists
WorkerConfig workerConfig = worker().getWorkerConfig();
if (connectorFunctionPackage == null && sourcePackageFile != null) {
connectorFunctionPackage =
new FunctionFilePackage(sourcePackageFile, workerConfig.getNarExtractionDirectory(),
workerConfig.getEnableClassloadingOfExternalFiles(), ConnectorDefinition.class);
shouldCloseFunctionPackage = true;
}
if (connectorFunctionPackage == null) {
throw new IllegalArgumentException("Source package is not provided");
}
SourceConfigUtils.ExtractedSourceDetails sourceDetails =
SourceConfigUtils.validateAndExtractDetails(
sourceConfig, connectorFunctionPackage,
workerConfig.getValidateConnectorConfig());
return SourceConfigUtils.convert(sourceConfig, sourceDetails);
} finally {
if (shouldCloseFunctionPackage && connectorFunctionPackage instanceof AutoCloseable) {
try {
((AutoCloseable) connectorFunctionPackage).close();
} catch (Exception e) {
log.error().exception(e).log("Failed to connector function file");
}
}
}
}
}View on GitHub (pinned to 820761864e)
Solutions
- Always supply the source package (multipart file) when registering/updating a source that uses a custom package
- Use a valid builtin:// archive name so the connector package resolves
- Check the client code/SDK call so the package parameter is not null or empty
- Inspect earlier log lines - a builtin resolution failure will have been logged before this error
Example fix
// before
admin.sources().updateSource(tn, ns, name, config, null); // no package
// after
admin.sources().updateSource(tn, ns, name, config,
new UploadData(Files.readAllBytes(Paths.get("source.jar")))); // provide package Defensive patterns
Strategy: validation
Validate before calling
boolean hasPackage = (sourcePackageFile != null && sourcePackageFile.getSize() > 0)
|| (sourceConfig.getPackageLocation() != null && !sourceConfig.getPackageLocation().isBlank());
if (!hasPackage) throw new IllegalArgumentException("Source package is required"); Type guard
boolean hasUsablePackage(java.io.InputStream data, SourceConfig cfg) {
return (data != null) || (cfg != null && cfg.getPackageLocation() != null && !cfg.getPackageLocation().isBlank());
} Try / catch
try {
admin.sources().registerSource(tn, ns, name, cfg, packageData);
} catch (PulsarAdminException e) {
if (e.getMessage() != null && e.getMessage().contains("Source package is not provided")) {
throw new IllegalStateException("Upload a source package file or use a builtin:// archive", e);
}
throw e;
} Prevention
- Always pass the multipart file when registering custom sources
- Verify the upload stream is non-empty client-side before the call
- Use builtin:// archives only when the connector is confirmed deployed
- Review SDK method signatures - package params are separate from the config
When it happens
Trigger: Calling registerSource/updateSource without providing a source package file (multipart data) and without a resolvable builtin:// archive, so connectorFunctionPackage remains null.
Common situations: Omitting the multipart file field in the REST upload; sending an empty package file; a builtin:// archive that silently failed to resolve earlier in the flow; client SDK misuse of updateSource with null data and null packageLocation.
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
- Either a Java jar or a Python file or a Go executable binary
- Either a Java jar or a Python file or a Go executable binary
- Function Name not provided
- State key needs to be specified
- Either a trigger value or a trigger filepath needs to be spe
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/f4e41a0ef683fcc5.
Report an issue: GitHub.