{"record":{"id":"135a3d73fab5b39b","repo":"apache/seatunnel","slug":"failed-getting-table-s","errorCode":null,"errorMessage":"Failed getting table %s","messagePattern":"Failed getting table (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseCatalog.java","lineNumber":138,"sourceCode":"                                    (long) column.getEstimatedLength(),\n                                    column.getScale(),\n                                    column.isNullable(),\n                                    null,\n                                    null,\n                                    null,\n                                    sourceTypeMap.get(column.getColumnName())));\n\n            TableIdentifier tableIdentifier =\n                    TableIdentifier.of(\n                            catalogName, tablePath.getDatabaseName(), tablePath.getTableName());\n            return CatalogTable.of(\n                    tableIdentifier,\n                    builder.build(),\n                    buildConnectorOptions(tablePath),\n                    Collections.emptyList(),\n                    \"\");\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed getting table %s\", tablePath.getFullName()), e);\n        }\n    }\n\n    @Override\n    public void createTable(TablePath tablePath, CatalogTable table, boolean ignoreIfExists)\n            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {\n        log.debug(\"Create table :{}.{}\", tablePath.getDatabaseName(), tablePath.getTableName());\n        proxy.createTable(\n                tablePath.getDatabaseName(),\n                tablePath.getTableName(),\n                template,\n                table.getComment(),\n                table.getTableSchema());\n    }\n\n    @Override\n    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseCatalog.java#L120-L156","documentation":"ClickhouseCatalog.getTable builds a CatalogTable by querying ClickHouse metadata through its proxy client. Any exception during metadata lookup, option building, or connection is wrapped in a CatalogException with 'Failed getting table <name>'. It signals the catalog could not read the table's schema or metadata from the ClickHouse server.","triggerScenarios":"Calling getTable(tablePath) (e.g. via catalogTable) when the table does not exist, the user lacks privileges to describe it, the ClickHouse server is unreachable, or the database/table name is wrong.","commonSituations":"Typo in database or table name in the catalog config; table dropped between exists-check and getTable; insufficient ClickHouse grants (no DESCRIBE access); network/auth failures to the ClickHouse HTTP or native port.","solutions":["Verify the TablePath database and table names exist in ClickHouse (SHOW TABLES FROM <db>) and match the config exactly","Check the ClickHouse user has SELECT/DESCRIBE privileges on the table","Confirm connectivity (host, port, credentials) used by the catalog's proxy client and retry","Catch CatalogException and, if the cause is missing table, route to TableNotExistException handling or create the table first"],"exampleFix":"// before\nCatalogTable table = catalog.getTable(tablePath); // throws CatalogException if missing\n// after\nif (catalog.tableExists(tablePath)) {\n    CatalogTable table = catalog.getTable(tablePath);\n} else {\n    throw new TableNotExistException(catalogName, tablePath);\n}","handlingStrategy":"try-catch","validationCode":"if (!catalog.tableExists(tablePath)) {\n    throw new TableNotExistException(catalogName, tablePath);\n}\n// also verify connectivity\nboolean reachable = pingClickHouse(catalogOptions);","typeGuard":null,"tryCatchPattern":"try {\n    CatalogTable table = catalog.getTable(tablePath);\n} catch (CatalogException e) {\n    Throwable cause = e.getCause();\n    if (cause != null && String.valueOf(cause.getMessage()).contains(\"UNKNOWN_TABLE\")) {\n        throw new TableNotExistException(catalogName, tablePath, cause);\n    }\n    throw e;\n}","preventionTips":["Call tableExists before getTable, or map UNKNOWN_TABLE causes to TableNotExistException","Verify database/table spelling against SHOW TABLES in ClickHouse","Grant the configured user DESCRIBE/SELECT privileges on target tables","Health-check the ClickHouse connection (host, port, credentials) before catalog operations"],"tags":["clickhouse","catalog","metadata"],"backgroundTag":"database-query-failed","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"}