apache/pulsar · error · RestException
e.getMessage()
Error message
e.getMessage()
What it means
registerSink catches the generic PulsarAdminException (any non-auth, non-not-found admin failure while fetching tenant data) and rethrows it as a 500 INTERNAL_SERVER_ERROR RestException carrying e.getMessage(). This signals the worker could not complete its tenant-existence validation because of an infrastructure-level problem talking to the broker/admin API.
Source
Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/SinksImpl.java:137
}
}
} catch (PulsarAdminException.NotAuthorizedException e) {
log.error().attr("tenant", tenant).attr("namespace", namespace).attr("componentName", sinkName)
.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", sinkName)
.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", sinkName)
.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, sinkName)) {
log.error().attr("componentType", ComponentTypeUtils.toString(componentType)).attr("tenant", tenant)
.attr("namespace", namespace).attr("componentName", sinkName).log("/ / already exists");
throw new RestException(Response.Status.BAD_REQUEST,
String.format("%s %s already exists", ComponentTypeUtils.toString(componentType), sinkName));
}
FunctionDetails functionDetails;
File componentPackageFile = null;
try {
// validate parameters
try {View on GitHub (pinned to 820761864e)
Solutions
- Check broker health and connectivity from the worker host (service URL, port, TLS).
- Read the underlying cause: the worker log includes the full exception; the REST message is just e.getMessage().
- Retry the request once brokers recover - this is typically transient.
- Verify the worker's PulsarAdmin configuration (auth, TLS truststore, serviceUrl) matches the broker's.
Example fix
// before: ignoring connection settings on the worker # worker.conf: webServiceUrl=http://broker:8080 (broker TLS-only) // after # worker.conf: webServiceUrl=https://broker:8443, tlsTrustCertsFilePath=/etc/pulsar/ca.crt
Defensive patterns
Strategy: retry
Validate before calling
// preflight connectivity check admin.brokers().getActiveBrokers(cluster); // fails fast if the broker/admin endpoint is unreachable
Try / catch
try {
sinks.registerSink(tenant, ns, name, cfg, null, null, null, authParams);
} catch (RestException e) {
if (e.getResponse().getStatus() == 500) {
// transient broker/admin failure: back off and retry with a retry policy
} else { throw e; }
} Prevention
- Monitor broker health and worker-to-broker connectivity; alert on admin API failures
- Match the worker's PulsarAdmin TLS/auth settings exactly to the broker's
- Wrap administrative deployments in bounded retry with exponential backoff
When it happens
Trigger: registerSink when the admin lookup for tenant data fails for reasons other than authorization/not-found: broker connection dropped, TLS handshake failure, timeouts, broker overload, or PulsarAdmin client misconfiguration on the worker.
Common situations: Broker down or restarting; network partition between functions worker and broker; certificate/truststore misconfiguration producing generic admin exceptions; broker returning 5xx under load.
Related errors
- Failed to update clusters because failed to create admin cli
- e
- Tenant is not provided
- Namespace is not provided
- Sink name is not provided
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/2325bdf577ea026b.
Report an issue: GitHub.