{"record":{"id":"f775a754317b8fb4","repo":"apache/seatunnel","slug":"an-unexpected-error-occurred","errorCode":null,"errorMessage":"An unexpected error occurred","messagePattern":"An unexpected error occurred","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java","lineNumber":328,"sourceCode":"        Throwable cause = e.getCause();\n        if (cause instanceof UnsupportedOperationException) {\n            String message = cause.getMessage();\n            if (message.contains(\"The type \")\n                    && message.contains(\" in primary key field \")\n                    && message.contains(\" is unsupported\")) {\n                throw new PaimonConnectorException(\n                        PaimonConnectorErrorCode.UNSUPPORTED_PRIMARY_DATATYPE, message);\n            }\n        } else if (cause instanceof RuntimeException) {\n            String message = cause.getMessage();\n            // https://github.com/apache/paimon/pull/3320/files#diff-d3e068ea8caf83d2371f0eaa1cbf3d02ff06e1c1cdceec5fab2e065cecd96230\n            if (message.contains(\n                    \"Cannot define 'bucket-key' with bucket -1, please specify a bucket number.\")) {\n                throw new PaimonConnectorException(\n                        PaimonConnectorErrorCode.WRITE_PROPS_BUCKET_KEY_ERROR, message);\n            }\n        }\n        throw new CatalogException(\"An unexpected error occurred\", e);\n    }\n\n    // --------------------------------------------------------------------------------------------\n    // SPI load paimon catalog\n    // --------------------------------------------------------------------------------------------\n\n    public static PaimonCatalog loadPaimonCatalog(ReadonlyConfig readonlyConfig) {\n        org.apache.seatunnel.api.table.factory.CatalogFactory catalogFactory =\n                discoverFactory(\n                        Thread.currentThread().getContextClassLoader(),\n                        org.apache.seatunnel.api.table.factory.CatalogFactory.class,\n                        PaimonSink.PLUGIN_NAME);\n        if (catalogFactory == null) {\n            throw new PaimonConnectorException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    String.format(\n                            \"PluginName: %s, PluginType: %s, Message: %s\",\n                            PaimonSink.PLUGIN_NAME,","sourceCodeStart":310,"sourceCodeEnd":346,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java#L310-L346","documentation":"Generic CatalogException('An unexpected error occurred', e) thrown by PaimonCatalog.resolveException when createTable fails with a cause matching none of the recognized patterns (unsupported primary-key type, bucket-key error). The original Paimon exception is attached as the cause.","triggerScenarios":"createTable failing for any unrecognized reason: invalid schema, warehouse access errors, metastore connectivity, corrupt table metadata, or newer Paimon exception messages not yet mapped by resolveException.","commonSituations":"Misconfigured warehouse path or HDFS permissions; Paimon version mismatch producing new error messages; invalid column types or duplicate field names in schema; filesystem full or metastore down.","solutions":["Inspect the cause chain (getCause) for the real Paimon exception message","Verify paimon warehouse / metastore configuration and connectivity","Validate the table schema: field names unique, types supported by Paimon","Align connector and Paimon runtime versions; if a new Paimon message is misclassified, extend resolveException mapping"],"exampleFix":"// inspect root cause\ntry {\n    catalog.createTable(tablePath, catalogTable, false);\n} catch (CatalogException e) {\n    LOG.error(\"createTable failed, root cause:\", e.getCause());\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"// validate schema and catalog config up front\ncatalog.listDatabases(); // fail fast if warehouse/metastore unreachable","typeGuard":null,"tryCatchPattern":"try {\n    catalog.createTable(tablePath, catalogTable, false);\n} catch (CatalogException e) {\n    LOG.error(\"createTable failed; root cause:\", e.getCause());\n    throw e;\n}","preventionTips":["Always inspect getCause() — the generic message hides the real error","Fail fast by listing databases/tables after catalog creation","Keep connector and Paimon runtime versions aligned","Validate warehouse path, permissions, and schema before createTable"],"tags":["paimon","create-table","unexpected-error"],"backgroundTag":"internal-invariant-violation","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"}