{"record":{"id":"0b0fe103d1c5c2c3","repo":"apache/seatunnel","slug":"failed-listing-database-in-catalog-s","errorCode":null,"errorMessage":"Failed listing database in catalog %s","messagePattern":"Failed listing database in catalog (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/iris/IrisCatalog.java","lineNumber":171,"sourceCode":"    @Override\n    protected String getTableWithConditionSql(TablePath tablePath) {\n        return String.format(\n                getListTableSql(tablePath.getSchemaName()) + \" and TABLE_NAME = '%s'\",\n                tablePath.getTableName());\n    }\n\n    @Override\n    protected String getUrlFromDatabaseName(String databaseName) {\n        return defaultUrl;\n    }\n\n    @Override\n    public List<String> listTables(String schemaName)\n            throws CatalogException, DatabaseNotExistException {\n        try {\n            return queryString(defaultUrl, getListTableSql(schemaName), this::getTableName);\n        } catch (Exception e) {\n            throw new CatalogException(\n                    String.format(\"Failed listing database in catalog %s\", catalogName), e);\n        }\n    }\n\n    @Override\n    public CatalogTable getTable(String sqlQuery) throws SQLException {\n        Connection defaultConnection = getConnection(defaultUrl);\n        return CatalogUtils.getCatalogTable(defaultConnection, sqlQuery, new IrisTypeMapper());\n    }\n\n    @Override\n    public CatalogTable getTable(TablePath tablePath)\n            throws CatalogException, TableNotExistException {\n        if (!tableExists(tablePath)) {\n            throw new TableNotExistException(catalogName, tablePath);\n        }\n\n        String dbUrl;","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/iris/IrisCatalog.java#L153-L189","documentation":"IrisCatalog.listTables wraps any exception from running the table-listing query against the given schema into a CatalogException with message \"Failed listing database in catalog %s\" (the wording is misleading — it lists tables, not databases). The root cause is chained.","triggerScenarios":"Calling listTables(schemaName) when queryString throws: connection failure to defaultUrl, schema name does not exist, or the getListTableSql is invalid for the IRIS instance.","commonSituations":"Typo in schema/namespace name; IRIS credentials lacking privileges on the schema; network/firewall blocking the JDBC port; IRIS version where the system table queried by getListTableSql has a different name.","solutions":["Check the chained cause (getCause) for the concrete SQL/connection error","Verify the schemaName exists in IRIS (e.g. via IRIS management portal)","Confirm the catalog user has SELECT privileges on the metadata/system tables IRIS uses","Test defaultUrl connectivity with a standalone JDBC client","Check IRIS version compatibility with the SQL used by getListTableSql"],"exampleFix":"// before\nList<String> tables = catalog.listTables(schemaName); // CatalogException\n// after\ntry {\n    List<String> tables = catalog.listTables(schemaName);\n} catch (CatalogException e) {\n    LOG.error(\"listTables({}) failed: {}\", schemaName, e.getCause());\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"// check schema exists via a direct query\ntry (Connection c = DriverManager.getConnection(defaultUrl, user, pass);\n     ResultSet rs = c.getMetaData().getSchemas(null, schemaName)) {\n    if (!rs.next()) throw new IllegalStateException(\"Unknown IRIS schema: \" + schemaName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    List<String> tables = catalog.listTables(schemaName);\n} catch (CatalogException e) {\n    LOG.error(\"listTables({}) failed: {}\", schemaName, e.getCause(), e);\n    throw e;\n}","preventionTips":["Validate schema/namespace names before listing","Grant the catalog user SELECT on IRIS metadata tables","Verify defaultUrl and credentials with a standalone client first","Retry transient network failures with backoff"],"tags":["jdbc","iris","sql","catalog"],"backgroundTag":"sql-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"}