{"record":{"id":"005e4e33e5cede58","repo":"apache/pulsar","slug":"transform-function-package-not-found","errorCode":null,"errorMessage":"Transform Function package not found","messagePattern":"Transform Function package not found","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":805,"sourceCode":"            }\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\n            SinkConfigUtils.ExtractedSinkDetails sinkDetails =\n                    SinkConfigUtils.validateAndExtractDetails(sinkConfig, connectorFunctionPackage,\n                            transformFunctionPackage, workerConfig.getValidateConnectorConfig());\n\n            return SinkConfigUtils.convert(sinkConfig, sinkDetails);\n        } finally {\n            if (shouldCloseFunctionPackage && connectorFunctionPackage instanceof AutoCloseable) {\n                try {\n                    ((AutoCloseable) connectorFunctionPackage).close();\n                } catch (Exception e) {\n                    log.error().exception(e).log(\"Failed to connector function file\");\n                }\n            }\n            if (shouldCloseTransformFunctionPackage && transformFunctionPackage instanceof AutoCloseable) {\n                try {","sourceCodeStart":787,"sourceCodeEnd":823,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java#L787-L823","documentation":"If sinkConfig references a transformFunction (builtin or uploaded), the worker resolves its package. When all resolution paths fail and transformFunctionPackage is still null, validateUpdateRequestParams throws IllegalArgumentException('Transform Function package not found').","triggerScenarios":"registerSink/updateSink with sinkConfig.setTransformFunction(\"<name>\") where the name is neither resolvable as a built-in/registered function package (getBuiltinFunctionPackage returns null) nor accompanied by a valid functionPackageFile upload.","commonSituations":"Transform function name typo; transform function not uploaded to the package management service; referencing a transform by class name instead of package name; package uploaded to a different tenant/namespace than referenced in config.","solutions":["Verify the transform function package exists via the Functions package management API (function://tenant/ns/name@version).","Upload the transform function first (pulsar-admin packages upload function://...) and reference that exact URL.","Or upload the transform function package file directly in the sink create/update request.","Remove the transformFunction from the sink config if it is not actually needed."],"exampleFix":"// before\nsinkConfig.setTransformFunction(\"my-transform\"); // not resolvable\n// after: reference an uploaded package\npulsar-admin packages upload function://public/default/my-transform@1.0 --path transform.jar\nsinkConfig.setTransformFunction(\"function://public/default/my-transform@1.0\");","handlingStrategy":"validation","validationCode":"String tf = sinkConfig.getTransformFunction();\nif (tf != null && !tf.startsWith(\"function://\")) {\n    boolean exists = admin.packages().listPackages(\"function://\" + tenant + \"/\" + ns).stream().anyMatch(tf::endsWith);\n    if (!exists) throw new IllegalStateException(\"transform package missing: \" + tf);\n}","typeGuard":"boolean isPackageUrl(String s) { return s != null && s.matches(\"function://[^/]+/[^/]+/[^@]+@.+\"); }","tryCatchPattern":"try { admin.sinks().updateSink(...); } catch (PulsarAdminException e) { if (e.getMessage() != null && e.getMessage().contains(\"Transform Function package not found\")) { /* upload transform package */ } throw e; }","preventionTips":["Upload transform functions to the package service before referencing them","Reference transforms by full function://tenant/ns/name@version URL","Verify package existence with packages().getMetadata","Keep transform and sink deployments in the same pipeline"],"tags":["validation","transform-function","package-management","pulsar-functions"],"backgroundTag":"package-not-found","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}