{"record":{"id":"77361052661cb1c8","repo":"apache/seatunnel","slug":"no-support-operation-failed","errorCode":"NO_SUPPORT_OPERATION_FAILED","errorMessage":"unable to open CopyManager Operation in this JDBC writer. Please configure option use_copy_statement = false.","messagePattern":"unable to open CopyManager Operation in this JDBC writer\\. Please configure option use_copy_statement = false\\.","errorType":"error_code","errorClass":"JdbcConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/executor/CopyManagerBatchStatementExecutor.java","lineNumber":61,"sourceCode":"\npublic class CopyManagerBatchStatementExecutor implements JdbcBatchStatementExecutor<SeaTunnelRow> {\n\n    private final String copySql;\n    private final TableSchema tableSchema;\n    CopyManagerProxy copyManagerProxy;\n    CSVFormat csvFormat = CSVFormat.POSTGRESQL_CSV;\n    CSVPrinter csvPrinter;\n\n    public CopyManagerBatchStatementExecutor(String copySql, TableSchema tableSchema) {\n        this.copySql = copySql;\n        this.tableSchema = tableSchema;\n    }\n\n    public static void copyManagerProxyChecked(JdbcConnectionProvider connectionProvider) {\n        try (Connection connection = connectionProvider.getConnection()) {\n            new CopyManagerProxy(connection);\n        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {\n            throw new JdbcConnectorException(\n                    JdbcConnectorErrorCode.NO_SUPPORT_OPERATION_FAILED,\n                    \"unable to open CopyManager Operation in this JDBC writer. Please configure option use_copy_statement = false.\",\n                    e);\n        } catch (SQLException e) {\n            throw new JdbcConnectorException(\n                    JdbcConnectorErrorCode.CREATE_DRIVER_FAILED, \"unable to open JDBC writer\", e);\n        }\n    }\n\n    @Override\n    public void prepareStatements(Connection connection) throws SQLException {\n        try {\n            this.copyManagerProxy = new CopyManagerProxy(connection);\n            this.csvPrinter = new CSVPrinter(new StringBuilder(), csvFormat);\n        } catch (NoSuchMethodException\n                | IllegalAccessException\n                | InvocationTargetException\n                | IOException e) {","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/executor/CopyManagerBatchStatementExecutor.java#L43-L79","documentation":"CopyManagerBatchStatementExecutor.copyManagerProxyChecked() probes whether the JDBC driver's Connection can be adapted into the internal CopyManagerProxy (reflective access to the driver's CopyManager API). If reflection fails (NoSuchMethodException/IllegalAccessException/InvocationTargetException), the driver does not expose a compatible Copy API and a NO_SUPPORT_OPERATION_FAILED JdbcConnectorException is thrown advising use_copy_statement = false.","triggerScenarios":"JDBC sink with use_copy_statement=true for PostgreSQL/Greenplum-style COPY writes; the runtime JDBC driver lacks or hides the expected CopyManager method (wrong driver version, shaded/renamed classes, non-PG driver).","commonSituations":"Driver upgrade/downgrade changed the org.postgresql.copy.CopyManager API surface; using a forked or embedded driver (e.g. pgjdbc shaded differently); accidentally enabling use_copy_statement for a database whose driver has no CopyManager.","solutions":["Set use_copy_statement = false in the JDBC sink options to fall back to standard batch inserts","Use the standard, unshaded PostgreSQL JDBC driver version compatible with this SeaTunnel release","Verify the driver jar on the classpath actually contains org.postgresql.copy.CopyManager with the expected constructor/method","Remove conflicting older driver jars from the lib/ or plugin directory"],"exampleFix":"// before\nJdbcSinkOptions: { use_copy_statement = true }\n// after\nJdbcSinkOptions: { use_copy_statement = false }","handlingStrategy":"try-catch","validationCode":"try (Connection c = provider.getConnection()) {\n    Class.forName(\"org.postgresql.Driver\");\n    Class.forName(\"org.postgresql.copy.CopyManager\"); // driver must expose COPY API\n} catch (Throwable t) { log.warn(\"CopyManager unavailable, set use_copy_statement=false\", t); }","typeGuard":"static boolean driverSupportsCopy(Connection c) throws SQLException {\n    return c.isWrapperFor(org.postgresql.PGConnection.class);\n}","tryCatchPattern":"try {\n    CopyManagerBatchStatementExecutor.copyManagerProxyChecked(provider);\n} catch (JdbcConnectorException e) {\n    if (JdbcConnectorErrorCode.NO_SUPPORT_OPERATION_FAILED.equals(e.getErrorCode())) {\n        options.setUseCopyStatement(false); // rebuild executor with batch inserts\n    } else throw e;\n}","preventionTips":["Set use_copy_statement=false unless you confirmed the PG driver supports CopyManager","Ship the unshaded official PostgreSQL driver jar to all nodes","Probe driver COPY capability in a startup health check"],"tags":["jdbc","copy","postgresql","driver"],"backgroundTag":"operation-not-supported","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}