{"record":{"id":"c0fb0ae28e528b5e","repo":"apache/seatunnel","slug":"publication-autocreation-is-disabled-please-creat","errorCode":null,"errorMessage":"Publication autocreation is disabled, please create one and restart the connector.","messagePattern":"Publication autocreation is disabled, please create one and restart the connector\\.","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java","lineNumber":205,"sourceCode":"\n                String selectPublication =\n                        String.format(\n                                \"SELECT COUNT(1) FROM pg_publication WHERE pubname = '%s'\",\n                                publicationName);\n                conn.query(\n                        selectPublication,\n                        rs -> {\n                            if (rs.next()) {\n                                Long count = rs.getLong(1);\n                                // Close eagerly as the transaction might stay running\n                                if (count == 0L) {\n                                    LOGGER.info(\n                                            \"Creating new publication '{}' for plugin '{}'\",\n                                            publicationName,\n                                            plugin);\n                                    switch (publicationAutocreateMode) {\n                                        case DISABLED:\n                                            throw new ConnectException(\n                                                    \"Publication autocreation is disabled, please create one and restart the connector.\");\n                                        case ALL_TABLES:\n                                            String createPublicationStmt =\n                                                    String.format(\n                                                            \"CREATE PUBLICATION %s FOR ALL TABLES;\",\n                                                            publicationName);\n                                            LOGGER.info(\n                                                    \"Creating Publication with statement '{}'\",\n                                                    createPublicationStmt);\n                                            // Publication doesn't exist, create it.\n                                            conn.executeWithoutCommitting(createPublicationStmt);\n                                            break;\n                                        case FILTERED:\n                                            createOrUpdatePublicationModeFilterted(\n                                                    tableFilterString, conn, false);\n                                            break;\n                                    }\n                                } else {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java#L187-L223","documentation":"initPublication checks whether the configured publication exists; when it does not and publication_autocreate_mode is DISABLED, it throws this ConnectException telling the user to create the publication manually and restart. pgoutput requires a publication, so without autocreation and without an existing publication the connector cannot proceed.","triggerScenarios":"Using plugin pgoutput, the SELECT from pg_publications finds no publication matching publication.name, and PublicationAutocreateMode.DISABLED is configured, so instead of CREATE PUBLICATION the connector fails fast.","commonSituations":"Config copied from a decoderbufs setup where no publication is needed; publication dropped by cleanup tooling; publication name typo between connector config and the database.","solutions":["Create the publication manually on the server: CREATE PUBLICATION <name> FOR ALL TABLES; (or FOR TABLE ...).","Or set publication.autocreate.mode=filtered (or all_tables) so the connector creates it.","Verify publication.name in the connector config exactly matches an existing publication: SELECT pubname FROM pg_publications;","Recreate the publication if it was dropped: it must include all tables the connector captures."],"exampleFix":"-- before\n\"publication.autocreate.mode\" = \"disabled\"\n-- after (option A: config)\n\"publication.autocreate.mode\" = \"filtered\"\n-- after (option B: SQL)\nCREATE PUBLICATION seatunnel_publication FOR ALL TABLES;","handlingStrategy":"validation","validationCode":"SELECT pubname FROM pg_publications; -- must contain the configured publication.name, or set publication.autocreate.mode != disabled","typeGuard":null,"tryCatchPattern":"try {\n    connection.initPublication();\n} catch (ConnectException e) {\n    // create the publication via SQL and restart the connector\n}","preventionTips":["Pre-create the publication (CREATE PUBLICATION ... FOR ALL TABLES) before first start.","Keep publication.name consistent between config and database.","If autocreation is disabled, treat the publication as part of infrastructure provisioning."],"tags":["cdc","postgres","pgoutput","publication","config"],"backgroundTag":"missing-required-config-field","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"}