{"record":{"id":"dfc051acb9c44925","repo":"apache/seatunnel","slug":"check-database-exists-failed","errorCode":null,"errorMessage":"check database exists failed","messagePattern":"check database exists failed","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java","lineNumber":187,"sourceCode":"    @Override\n    public String name() {\n        return catalogName;\n    }\n\n    @Override\n    public String getDefaultDatabase() throws CatalogException {\n        return defaultDatabase;\n    }\n\n    @Override\n    public boolean databaseExists(String databaseName) throws CatalogException {\n        try (PreparedStatement ps = conn.prepareStatement(DorisCatalogUtil.DATABASE_QUERY)) {\n            ps.setString(1, databaseName);\n            try (ResultSet rs = ps.executeQuery()) {\n                return rs.next();\n            }\n        } catch (SQLException e) {\n            throw new CatalogException(\"check database exists failed\", e);\n        }\n    }\n\n    @Override\n    public List<String> listDatabases() throws CatalogException {\n        List<String> databases = new ArrayList<>();\n        try (PreparedStatement ps = conn.prepareStatement(DorisCatalogUtil.ALL_DATABASES_QUERY);\n                ResultSet rs = ps.executeQuery()) {\n            while (rs.next()) {\n                String database = rs.getString(1);\n                databases.add(database);\n            }\n        } catch (SQLException e) {\n            throw new CatalogException(\"list databases failed\", e);\n        }\n        Collections.sort(databases);\n        return databases;\n    }","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java#L169-L205","documentation":"DorisCatalog.databaseExists wraps SQLException from the database-existence query into CatalogException('check database exists failed'); the check itself failed due to connection loss or SQL errors, distinct from the database simply not existing.","triggerScenarios":"Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check JDBC connection health and reconnect (stale connections after idle timeout)","Look at FE audit logs for the failing query","Verify the configured user has permission to list databases"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}