{"record":{"id":"06c7da09c73554da","repo":"apache/pulsar","slug":"e-getmessage-06c7da","errorCode":null,"errorMessage":"{e.getMessage()}","messagePattern":"\\{e\\.getMessage\\(\\)\\}","errorType":"http","errorClass":"RestException","httpStatus":500,"severity":"error","filePath":"pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java","lineNumber":136,"sourceCode":"                }\n            }\n        } catch (PulsarAdminException.NotAuthorizedException e) {\n            log.error().attr(\"tenant\", tenant).attr(\"namespace\", namespace).attr(\"componentName\", sourceName)\n\n                    .attr(\"componentType\", ComponentTypeUtils.toString(componentType))\n\n                    .log(\"/ / Client is not authorized to operate on tenant\");\n            throw new RestException(Response.Status.UNAUTHORIZED, \"Client is not authorized to perform operation\");\n        } catch (PulsarAdminException.NotFoundException e) {\n            log.error().attr(\"tenant\", tenant).attr(\"namespace\", namespace).attr(\"componentName\", sourceName)\n\n                    .attr(\"tenant3\", tenant).log(\"/ / Tenant does not exist\");\n            throw new RestException(Response.Status.BAD_REQUEST, \"Tenant does not exist\");\n        } catch (PulsarAdminException e) {\n            log.error().attr(\"tenant\", tenant).attr(\"namespace\", namespace).attr(\"componentName\", sourceName)\n\n                    .exception(e).log(\"/ / Issues getting tenant data\");\n            throw new RestException(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage());\n        }\n\n        FunctionMetaDataManager functionMetaDataManager = worker().getFunctionMetaDataManager();\n\n        if (functionMetaDataManager.containsFunction(tenant, namespace, sourceName)) {\n            log.error().attr(\"componentType\", ComponentTypeUtils.toString(componentType)).attr(\"tenant\", tenant)\n\n                    .attr(\"namespace\", namespace).attr(\"componentName\", sourceName).log(\"/ / already exists\");\n            throw new RestException(Response.Status.BAD_REQUEST,\n                    String.format(\"%s %s already exists\", ComponentTypeUtils.toString(componentType), sourceName));\n        }\n\n        FunctionDetails functionDetails = null;\n        boolean isPkgUrlProvided = isNotBlank(sourcePkgUrl);\n        File componentPackageFile = null;\n        try {\n\n            // validate parameters","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java#L118-L154","documentation":"A catch-all handler: any other PulsarAdminException (not NotAuthorized/NotFound) while getting tenant data is logged and rethrown as HTTP 500 INTERNAL_SERVER_ERROR with the underlying admin exception's message. It signals a server-side or connectivity problem between the Functions Worker and the broker/admin API.","triggerScenarios":"registerSource calls where tenant data lookup fails due to broker unavailability, metadata store errors, timeouts, TLS/SSL handshake issues, or other unexpected PulsarAdminException subtypes.","commonSituations":"Broker down or restarting during deployment; worker's brokerWebServiceUrl misconfigured; TLS certificate mismatch; ZooKeeper/metadata store outage; network partition between worker and broker.","solutions":["Read the embedded e.getMessage() in the 500 response to identify the underlying admin failure","Check broker and worker connectivity (brokerWebServiceUrl, TLS certs) and that brokers are up","Inspect broker/worker logs for the matching 'Issues getting tenant data' error with the full exception","Retry the registration after the transient issue resolves"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// probe admin availability before registering\ntry (PulsarAdmin admin = PulsarAdminClient.builder().serviceHttpUrl(adminUrl).build()) {\n    admin.clusters().getClusters(); // throws quickly if broker/admin unreachable\n}","typeGuard":null,"tryCatchPattern":"CompletableFuture.supplyAsync(() -> {\n    try {\n        return sources.createSource(sourceConfig, pkgUrl, inputStream);\n    } catch (PulsarAdminException e) {\n        throw new CompletionException(e);\n    }\n}).orTimeout(60, TimeUnit.SECONDS)\n .exceptionally(e -> {\n     log.error(\"Registration failed (server-side): {}\", e.getMessage());\n     return null; // inspect 500 body message for root cause\n });","preventionTips":["Monitor broker/worker health before bulk source deployments","Verify brokerWebServiceUrl and TLS settings in worker.conf match the broker","Set sensible client timeouts and backoff for admin operations","Watch metadata store (ZooKeeper) health; 500s often trace back to it"],"tags":["internal-server-error","connectivity","pulsar-admin","rest-api"],"backgroundTag":"pulsar-admin-request-failed","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"}