apache/pulsar · error · RuntimeException
java.lang.RuntimeException (wrapping PulsarAdminException fr
Error message
java.lang.RuntimeException (wrapping PulsarAdminException from getStatus)
What it means
ComponentImpl.getComponentStatus() gathers status from the workers holding assignments; when it must fetch status remotely via PulsarAdmin and the admin call throws a PulsarAdminException, it wraps it in a plain RuntimeException (which becomes an HTTP 500). The real cause (connection failure, auth error, missing function, etc.) is inside the nested PulsarAdminException.
Source
Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:256
if (workerInfo == null) {
return emptyStatus(functionMetaData.getFunctionDetails().getParallelism());
}
if (uri == null) {
throw new WebApplicationException(
Response.serverError().status(Status.INTERNAL_SERVER_ERROR).build());
} else {
URI redirect =
UriBuilder.fromUri(uri).host(workerInfo.getWorkerHostname()).port(workerInfo.getPort())
.build();
throw new WebApplicationException(Response.temporaryRedirect(redirect).build());
}
}
} else {
try {
return getStatus(tenant, namespace, name, assignments, uri);
} catch (PulsarAdminException e) {
throw new RuntimeException(e);
}
}
}
}
@Override
public PulsarWorkerService worker() {
try {
return Objects.requireNonNull(workerServiceSupplier.get());
} catch (Throwable t) {
log.info().exception(t).log("Failed to get worker service");
throw t;
}
}
boolean isWorkerServiceAvailable() {
WorkerService workerService = workerServiceSupplier.get();
if (workerService == null) {View on GitHub (pinned to 820761864e)
Solutions
- Read the wrapped PulsarAdminException cause to identify the underlying problem.
- Check that all workers listed in the assignments are up and reachable at their configured admin URLs.
- Fix inter-worker connectivity/TLS/auth configuration and re-run status.
- Remove stale assignments (e.g. via rebalance or restarting the scheduler) if a dead worker's assignments linger.
Example fix
// before
try {
return getStatus(tenant, namespace, name, assignments, uri);
} catch (PulsarAdminException e) {
throw new RuntimeException(e); // opaque 500
}
// after
try {
return getStatus(tenant, namespace, name, assignments, uri);
} catch (PulsarAdminException e) {
log.error("Status fetch failed for {}", name, e);
throw new RestException(Status.INTERNAL_SERVER_ERROR,
"Failed to get status: " + e.getHttpError() != null ? e.getHttpError() : e.getMessage());
} Defensive patterns
Strategy: try-catch
Validate before calling
// verify all assignment-holding workers are reachable before fetching status
for (WorkerAssignmentInfo a : assignments) {
if (!isWorkerReachable(a.getWorkerId())) {
throw new IllegalStateException("Worker " + a.getWorkerId() + " unreachable");
}
} Try / catch
try {
return getStatus(tenant, namespace, name, assignments, uri);
} catch (RuntimeException e) {
Throwable cause = e.getCause();
if (cause instanceof PulsarAdminException) {
// inspect the PulsarAdminException for the real failure
}
throw e;
} Prevention
- Monitor worker liveness; keep assignments consistent with live workers
- Keep inter-worker admin URL/TLS/auth configuration uniform
- Unwrap RuntimeException.getCause() to diagnose the PulsarAdminException
When it happens
Trigger: Requesting component (function/sink/source) status where assignments are spread across multiple workers and one remote worker's getStatus call fails: target worker down, TLS/auth misconfiguration between workers, function not found on the remote worker, or timeout.
Common situations: A worker in the cluster crashed or was drained while its assignment still exists; inter-worker admin URLs misconfigured (wrong host/port/TLS); security settings changed on one worker but not others.
Related errors
- PulsarAdmin is not enabled in function worker
- pulsarWebServiceUrl cannot be null
- Partitioned Topic Name should not contain '-partition-'
- Partitioned Topic Name should not contain '-partition-'
- Proxy not authorized to access resource (proxy:%s,original:%
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/704fdd8be5ced24f.
Report an issue: GitHub.