{"record":{"id":"591b57b82f72e9df","repo":"apache/seatunnel","slug":"common-11","errorCode":"COMMON-11","errorMessage":"Failed to initialize error sink writer","messagePattern":"Failed to initialize error sink writer","errorType":"error_code","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/error/DefaultErrorSinkWriter.java","lineNumber":437,"sourceCode":"            if (e instanceof Error) {\n                throw (Error) e;\n            }\n            log.error(\n                    \"Failed to initialize error sink writer for pluginName={}, errorTable={}, optionKeys={}\",\n                    sinkConfig.getPluginName(),\n                    sinkConfig.getErrorTable(),\n                    optionKeys(sinkConfig.getOptions()),\n                    e);\n            try {\n                closeWriterIfPossible();\n            } catch (Throwable closeEx) {\n                if (closeEx instanceof Error) {\n                    throw (Error) closeEx;\n                }\n                e.addSuppressed(closeEx);\n            }\n            releaseErrorSinkClassLoaderIfNeeded();\n            throw new SeaTunnelRuntimeException(\n                    CommonErrorCodeDeprecated.WRITER_OPERATION_FAILED,\n                    \"Failed to initialize error sink writer\",\n                    e);\n        }\n    }\n\n    private MetricsContext metricsContextOrNoop() {\n        return metricsContext == null ? new NoopMetricsContext() : metricsContext;\n    }\n\n    private EventListener eventListenerOrNoop() {\n        return eventListener == null ? event -> {} : eventListener;\n    }\n\n    static void validateSupportedErrorSinkLifecycle(\n            String pluginName, SeaTunnelSink<SeaTunnelRow, ?, ?, ?> sink) throws Exception {\n        List<String> unsupportedFeatures = new ArrayList<>();\n        if (sink.getWriterStateSerializer().isPresent()) {","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/error/DefaultErrorSinkWriter.java#L419-L455","documentation":"SeaTunnelRuntimeException with code CommonErrorCodeDeprecated.WRITER_OPERATION_FAILED thrown by ensureInitialized when opening/initializing the ROUTE error sink writer (creating the sink writer from the error-sink configuration) fails. Any exception raised during sink writer creation is wrapped as the cause, and the error sink classloader is released before propagating.","triggerScenarios":"open() or writeAndCheckAccepted() call ensureInitialized(); the underlying error sink's SinkWriter creation throws (bad plugin, missing plugin jar, invalid sink config, connection failure during sink init).","commonSituations":"Error-sink plugin name typo or plugin not installed; error sink needs credentials/connection that are wrong; incompatible error-sink options (e.g. transactional options on an unsupported sink); classloader/JAR conflicts.","solutions":["Read the wrapped cause for the real initialization failure","Verify the error sink plugin is installed (install-plugin.sh) and the pluginName is correct","Validate error-sink config options against the sink's documented options","Remove transactional/exactly-once options from the error sink (see ROUTE lifecycle restrictions)","Check network/credentials needed by the error sink"],"exampleFix":"# before\nerror-sink {\n  plugin_name = \"Jdbc\"\n  url = \"jdbc:mysql://wrong-host:3306/db\"\n}\n# after\nerror-sink {\n  plugin_name = \"Console\"\n}","handlingStrategy":"fallback","validationCode":"// pre-validate error sink config before job start\nOptions.checkErrorSinkConfig(sinkConfig); // verify pluginName installed and options valid","typeGuard":null,"tryCatchPattern":"try {\n    errorSinkWriter.open();\n} catch (SeaTunnelRuntimeException e) {\n    if (CommonErrorCodeDeprecated.WRITER_OPERATION_FAILED.equals(e.getSeaTunnelErrorCode())) {\n        LOG.error(\"Error sink init failed: \", e.getCause());\n        // fall back to Console error sink or fail job\n    }\n    throw e;\n}","preventionTips":["Verify the error-sink plugin is installed before submitting the job","Test error-sink connectivity/credentials in isolation","Keep error-sink options simple (no transactional features)","Pin connector/driver versions to avoid init incompatibilities"],"tags":["error-sink","initialization-failure","writer-operation-failed","zeta-engine"],"backgroundTag":"module-init-failed","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"}