apache/pulsar · error · RestException
{e.getMessage()}
Error message
{e.getMessage()} What it means
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.
Source
Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SourcesImpl.java:136
}
}
} catch (PulsarAdminException.NotAuthorizedException e) {
log.error().attr("tenant", tenant).attr("namespace", namespace).attr("componentName", sourceName)
.attr("componentType", ComponentTypeUtils.toString(componentType))
.log("/ / Client is not authorized to operate on tenant");
throw new RestException(Response.Status.UNAUTHORIZED, "Client is not authorized to perform operation");
} catch (PulsarAdminException.NotFoundException e) {
log.error().attr("tenant", tenant).attr("namespace", namespace).attr("componentName", sourceName)
.attr("tenant3", tenant).log("/ / Tenant does not exist");
throw new RestException(Response.Status.BAD_REQUEST, "Tenant does not exist");
} catch (PulsarAdminException e) {
log.error().attr("tenant", tenant).attr("namespace", namespace).attr("componentName", sourceName)
.exception(e).log("/ / Issues getting tenant data");
throw new RestException(Response.Status.INTERNAL_SERVER_ERROR, e.getMessage());
}
FunctionMetaDataManager functionMetaDataManager = worker().getFunctionMetaDataManager();
if (functionMetaDataManager.containsFunction(tenant, namespace, sourceName)) {
log.error().attr("componentType", ComponentTypeUtils.toString(componentType)).attr("tenant", tenant)
.attr("namespace", namespace).attr("componentName", sourceName).log("/ / already exists");
throw new RestException(Response.Status.BAD_REQUEST,
String.format("%s %s already exists", ComponentTypeUtils.toString(componentType), sourceName));
}
FunctionDetails functionDetails = null;
boolean isPkgUrlProvided = isNotBlank(sourcePkgUrl);
File componentPackageFile = null;
try {
// validate parametersView on GitHub (pinned to 820761864e)
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
Defensive patterns
Strategy: retry
Validate before calling
// probe admin availability before registering
try (PulsarAdmin admin = PulsarAdminClient.builder().serviceHttpUrl(adminUrl).build()) {
admin.clusters().getClusters(); // throws quickly if broker/admin unreachable
} Try / catch
CompletableFuture.supplyAsync(() -> {
try {
return sources.createSource(sourceConfig, pkgUrl, inputStream);
} catch (PulsarAdminException e) {
throw new CompletionException(e);
}
}).orTimeout(60, TimeUnit.SECONDS)
.exceptionally(e -> {
log.error("Registration failed (server-side): {}", e.getMessage());
return null; // inspect 500 body message for root cause
}); Prevention
- 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
When it happens
Trigger: registerSource calls where tenant data lookup fails due to broker unavailability, metadata store errors, timeouts, TLS/SSL handshake issues, or other unexpected PulsarAdminException subtypes.
Common situations: Broker down or restarting during deployment; worker's brokerWebServiceUrl misconfigured; TLS certificate mismatch; ZooKeeper/metadata store outage; network partition between worker and broker.
Related errors
- Failed to update clusters because failed to create admin cli
- e
- Partitioned Topic Name should not contain '-partition-'
- Partitioned Topic Name should not contain '-partition-'
- e.getMessage()
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/06c7da09c73554da.
Report an issue: GitHub.