apache/seatunnel · error · PulsarConnectorException
PulsarConnectorErrorCode.PULSAR_AUTHENTICATION_FAILED
PulsarConnectorErrorCode.PULSAR_AUTHENTICATION_FAILED
Error message
Authentication parameters are required when using authentication plug-in.
What it means
PulsarConfigUtil.createAuthentication builds a Pulsar Authentication object from authPluginClassName and authParams; if an auth plugin class name is configured but the auth parameters are missing/null, it throws PulsarConnectorException(PULSAR_AUTHENTICATION_FAILED). Authentication data must be supplied whenever a plugin is declared.
Source
Thrown at seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/config/PulsarConfigUtil.java:122
builder.subscriptionName(config.getSubscriptionName());
return builder;
}
private static Authentication createAuthentication(BasePulsarConfig config) {
if (StringUtils.isBlank(config.getAuthPluginClassName())) {
return AuthenticationDisabled.INSTANCE;
}
if (StringUtils.isNotBlank(config.getAuthPluginClassName())) {
try {
return AuthenticationFactory.create(
config.getAuthPluginClassName(), config.getAuthParams());
} catch (PulsarClientException.UnsupportedAuthenticationException e) {
throw new PulsarConnectorException(
PulsarConnectorErrorCode.PULSAR_AUTHENTICATION_FAILED, e);
}
} else {
throw new PulsarConnectorException(
PulsarConnectorErrorCode.PULSAR_AUTHENTICATION_FAILED,
"Authentication parameters are required when using authentication plug-in.");
}
}
/**
* get TransactionCoordinatorClient
*
* @param pulsarClient
* @return
*/
public static TransactionCoordinatorClient getTcClient(PulsarClient pulsarClient) {
TransactionCoordinatorClient coordinatorClient =
((PulsarClientImpl) pulsarClient).getTcClient();
// enabled transaction.
if (coordinatorClient == null) {
throw new IllegalArgumentException("You haven't enable transaction in Pulsar client.");
}View on GitHub (pinned to cf67b549a7)
Solutions
- Add the required 'auth.params' option alongside 'auth.plugin.class' (e.g. {"token":"<token>"} or {"role":"...","tlsCertFile":"..."}).
- Verify the params JSON is valid for the chosen plugin class (token plugin needs token; TLS auth needs cert file).
- If authentication is not actually needed, remove the auth plugin class name so createAuthentication does not enter the plugin branch.
Example fix
// before
auth.plugin.class = "org.apache.pulsar.client.impl.auth.AuthenticationToken"
// after
auth.plugin.class = "org.apache.pulsar.client.impl.auth.AuthenticationToken"
auth.params = "{\"token\":\"eyJhbGciOi...\"}" Defensive patterns
Strategy: validation
Validate before calling
if (config.hasPath("auth.plugin.class")) { require(config.hasPath("auth.params") && !config.getString("auth.params").isEmpty(), "auth.params required with auth.plugin.class"); } Prevention
- Always configure auth.plugin.class and auth.params as a pair
- Store the token in a secret/env and template it in, never leave the param empty
- Test the plugin+params against a standalone PulsarClient first
- Remove auth plugin keys entirely when the cluster is unsecured
When it happens
Trigger: Called by createAdmin/createClient; config has auth.plugin.class set but auth.params is null or absent, so Authentication.token/implementation cannot be constructed.
Common situations: Users set the auth plugin class for a secured Pulsar cluster but forget the token or auth params JSON; config was copied from an example that omitted the secret parameters; parameters were moved to env vars but not wired into the config.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- Option '${valuesAndOptions[index + 1]}' is not valid for the
- AzureCosmosDB requires key, primary_key, secondary_key, or a
- Invalid user/password specified
- The GCS service_account_key_file option must not be blank
- accessId and accesskey must be provided when sts_token is us
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/df92e59669ab3b07.
Report an issue: GitHub.