{"record":{"id":"4bd7d52b2c7bab86","repo":"apache/pulsar","slug":"didn-t-find-s-in-built-in-connectors-or-functions","errorCode":null,"errorMessage":"Didn't find %s in built-in connectors or functions","messagePattern":"Didn't find (.+?) in built-in connectors or functions","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java","lineNumber":1516,"sourceCode":"    private Path getBuiltinArchivePath(String pkgPath, FunctionDetails.ComponentType componentType) {\n        String type = pkgPath.replaceFirst(\"^builtin://\", \"\");\n        if (!FunctionDetails.ComponentType.FUNCTION.equals(componentType)) {\n            Connector connector = worker().getConnectorsManager().getConnector(type);\n            if (connector != null) {\n                return connector.getArchivePath();\n            }\n            if (componentType != null) {\n                throw new IllegalStateException(\"Didn't find \" + type + \" in built-in connectors\");\n            }\n        }\n        FunctionArchive function = worker().getFunctionsManager().getFunction(type);\n        if (function != null) {\n            return function.getArchivePath();\n        }\n        if (componentType != null) {\n            throw new IllegalStateException(\"Didn't find \" + type + \" in built-in functions\");\n        }\n        throw new IllegalStateException(\"Didn't find \" + type + \" in built-in connectors or functions\");\n    }\n\n    @Override\n    public StreamingOutput downloadFunction(final String path, final AuthenticationParameters authParams) {\n\n        if (!isWorkerServiceAvailable()) {\n            throwUnavailableException();\n        }\n\n        if (worker().getWorkerConfig().isAuthorizationEnabled()) {\n            // to maintain backwards compatibility but still have authorization\n            String[] tokens = path.split(\"/\");\n            if (tokens.length == 4) {\n                String tenant = tokens[0];\n                String namespace = tokens[1];\n                String componentName = tokens[2];\n\n                throwRestExceptionIfUnauthorizedForNamespace(tenant, namespace, componentName, \"download package for\",","sourceCodeStart":1498,"sourceCodeEnd":1534,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java#L1498-L1534","documentation":"Thrown by ComponentImpl.getBuiltinArchivePath when a 'builtin://' package path cannot be resolved to any installed archive. The workers' connectors manager and functions manager are both consulted, and if the componentType is null (so neither the connector-specific nor the function-specific message applied), this generic variant is thrown as an IllegalStateException.","triggerScenarios":"Calling getFunction/getSink/getSource download or submission APIs with a package path like 'builtin://my-connector' where the connector name does not exist in the worker's connectors list AND the name does not match any registered built-in function archive, with componentType null (unknown component type).","commonSituations":"Typo in the builtin:// name; using a connector that was never placed in the worker's connectors directory; worker config missing the connector/function NAR at startup; upgrading Pulsar where a previously built-in connector was removed; client sending builtin:// URL without specifying the component type.","solutions":["Check the exact builtin name against the worker's available connectors/functions (GET /admin/v2/functions/connectors or list the workers' connectors/ functions directories)","Place the connector/function NAR file in the worker's configured connectorsDirectory/functionsDirectory and restart the function worker","If the archive is not built-in, upload it via package management service or a full URL (http://, file://) instead of builtin://","Verify the client is sending the correct componentType so the right registry (connectors vs functions) is consulted"],"exampleFix":"// before\nString pkgUrl = \"builtin://kafka-io\"; // connector not installed on worker\n// after\n// install kafka-connect-nar in $PULSAR_HOME/connectors first, or use the uploaded package URL\nString pkgUrl = \"builtin://kafka\"; // name matching an installed connector archive","handlingStrategy":"try-catch","validationCode":"String type = pkgPath.replaceFirst(\"^builtin://\", \"\");\nboolean known = admin.functions().getConnectors().stream()\n        .anyMatch(c -> c.getName().equals(type) || c.getArchive().contains(type));\nif (!known) {\n    throw new IllegalArgumentException(\"builtin archive not installed: \" + type);\n}","typeGuard":"static boolean isBuiltinPackage(String pkgPath) {\n    return pkgPath != null && pkgPath.startsWith(\"builtin://\") && pkgPath.length() > \"builtin://\".length();\n}","tryCatchPattern":"try {\n    streamingOutput.downloadFunction(path, authParams);\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"in built-in connectors or functions\")) {\n        // fall back to uploading the archive or fixing the builtin name\n    } else {\n        throw e;\n    }\n}","preventionTips":["List available connectors (GET /admin/v2/functions/connectors) before referencing builtin:// names","Keep worker connectorsDirectory/functionsDirectory in sync across the cluster","Pin exact builtin archive names in deployment configs","Prefer package management service URLs for non-builtin archives"],"tags":["pulsar-functions","builtin-connector","missing-archive","configuration"],"backgroundTag":"builtin-connector-not-found","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"}