{"record":{"id":"df92e59669ab3b07","repo":"apache/seatunnel","slug":"pulsarconnectorerrorcode-pulsar-authentication-fai","errorCode":"PulsarConnectorErrorCode.PULSAR_AUTHENTICATION_FAILED","errorMessage":"Authentication parameters are required when using authentication plug-in.","messagePattern":"Authentication parameters are required when using authentication plug-in\\.","errorType":"error_code","errorClass":"PulsarConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/config/PulsarConfigUtil.java","lineNumber":122,"sourceCode":"        builder.subscriptionName(config.getSubscriptionName());\n        return builder;\n    }\n\n    private static Authentication createAuthentication(BasePulsarConfig config) {\n        if (StringUtils.isBlank(config.getAuthPluginClassName())) {\n            return AuthenticationDisabled.INSTANCE;\n        }\n\n        if (StringUtils.isNotBlank(config.getAuthPluginClassName())) {\n            try {\n                return AuthenticationFactory.create(\n                        config.getAuthPluginClassName(), config.getAuthParams());\n            } catch (PulsarClientException.UnsupportedAuthenticationException e) {\n                throw new PulsarConnectorException(\n                        PulsarConnectorErrorCode.PULSAR_AUTHENTICATION_FAILED, e);\n            }\n        } else {\n            throw new PulsarConnectorException(\n                    PulsarConnectorErrorCode.PULSAR_AUTHENTICATION_FAILED,\n                    \"Authentication parameters are required when using authentication plug-in.\");\n        }\n    }\n\n    /**\n     * get TransactionCoordinatorClient\n     *\n     * @param pulsarClient\n     * @return\n     */\n    public static TransactionCoordinatorClient getTcClient(PulsarClient pulsarClient) {\n        TransactionCoordinatorClient coordinatorClient =\n                ((PulsarClientImpl) pulsarClient).getTcClient();\n        // enabled transaction.\n        if (coordinatorClient == null) {\n            throw new IllegalArgumentException(\"You haven't enable transaction in Pulsar client.\");\n        }","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-pulsar/src/main/java/org/apache/seatunnel/connectors/seatunnel/pulsar/config/PulsarConfigUtil.java#L104-L140","documentation":"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.","triggerScenarios":"Called by createAdmin/createClient; config has auth.plugin.class set but auth.params is null or absent, so Authentication.token/implementation cannot be constructed.","commonSituations":"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.","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."],"exampleFix":"// before\nauth.plugin.class = \"org.apache.pulsar.client.impl.auth.AuthenticationToken\"\n// after\nauth.plugin.class = \"org.apache.pulsar.client.impl.auth.AuthenticationToken\"\nauth.params = \"{\\\"token\\\":\\\"eyJhbGciOi...\\\"}\"","handlingStrategy":"validation","validationCode":"if (config.hasPath(\"auth.plugin.class\")) { require(config.hasPath(\"auth.params\") && !config.getString(\"auth.params\").isEmpty(), \"auth.params required with auth.plugin.class\"); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["pulsar","authentication","config"],"backgroundTag":"missing-credentials","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}