{"record":{"id":"931738a1c0229cb7","repo":"apache/seatunnel","slug":"failed-to-open-catalog-s","errorCode":null,"errorMessage":"Failed to open catalog %s","messagePattern":"Failed to open catalog (.+?)","errorType":"exception","errorClass":"CatalogException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/catalog/ElasticSearchCatalog.java","lineNumber":91,"sourceCode":"    public ElasticSearchCatalog(String catalogName, String defaultDatabase, ReadonlyConfig config) {\n        this.catalogName = checkNotNull(catalogName, \"catalogName cannot be null\");\n        this.defaultDatabase = defaultDatabase;\n        this.config = checkNotNull(config, \"elasticSearchConfig cannot be null\");\n    }\n\n    @Override\n    public void open() throws CatalogException {\n        try {\n            esRestClient = EsRestClient.createInstance(config);\n            ElasticsearchClusterInfo elasticsearchClusterInfo = esRestClient.getClusterInfo();\n            if (LOGGER.isDebugEnabled()) {\n                LOGGER.debug(\n                        \"Success open es catalog: {}, cluster info: {}\",\n                        catalogName,\n                        elasticsearchClusterInfo);\n            }\n        } catch (Exception e) {\n            throw new CatalogException(String.format(\"Failed to open catalog %s\", catalogName), e);\n        }\n    }\n\n    @Override\n    public void close() throws CatalogException {\n        esRestClient.close();\n    }\n\n    @Override\n    public String name() {\n        return catalogName;\n    }\n\n    @Override\n    public String getDefaultDatabase() throws CatalogException {\n        return defaultDatabase;\n    }\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/catalog/ElasticSearchCatalog.java#L73-L109","documentation":"ElasticSearchCatalog.open failed to initialize the Elasticsearch catalog — typically creating/connecting the REST client and fetching cluster info — and wraps any exception in CatalogException 'Failed to open catalog <name>'. This fails job initialization before any source/sink can operate.","triggerScenarios":"open() is called and the underlying EsRestClient creation or cluster-info query throws — unreachable hosts, wrong address/port scheme, authentication failures (401/403), TLS/SSL handshake problems, or Elasticsearch returning an unexpected error.","commonSituations":"Elasticsearch is down or firewalled; mistyped hosts or protocol (http vs https); wrong username/password or missing credentials; self-signed certificates without proper truststore config; version incompatibility between the client and the ES cluster.","solutions":["Verify Elasticsearch is reachable: `curl -u user:pass http://<host>:9200/` from the SeaTunnel node.","Check catalog config: hosts list, http/https scheme, username/password, and TLS/truststore settings.","Fix authentication — wrong or missing credentials surface here; confirm with the same credentials via curl.","Inspect the root cause chained in the CatalogException (the original exception) to pinpoint connection vs auth vs TLS failure."],"exampleFix":"// before\nElasticsearch {\n  hosts = [\"https://es-node:9200\"] // cluster actually serves http\n}\n// after\nElasticsearch {\n  hosts = [\"http://es-node:9200\"]\n  username = \"elastic\"\n  password = \"***\"\n}","handlingStrategy":"try-catch","validationCode":"// health-check before opening the catalog\nHttpURLConnection c = (HttpURLConnection) new URL(\"http://es-node:9200/\").openConnection();\nc.setConnectTimeout(5000);\nif (c.getResponseCode() != 200) throw new IllegalStateException(\"Elasticsearch unreachable\");","typeGuard":null,"tryCatchPattern":"try {\n    catalog.open();\n} catch (CatalogException e) {\n    log.error(\"catalog open failed; root cause: {}\", e.getCause(), e);\n    // classify cause: UnknownHost/ConnectException vs auth 401 vs TLS handshake\n}","preventionTips":["Run connectivity/curl smoke tests to Elasticsearch from the job nodes before deploy.","Keep hosts, scheme (http/https), credentials, and TLS truststore settings verified in config checklist.","Monitor cluster health (green/yellow) and alert before job submissions.","Pin compatible client and cluster versions during upgrades."],"tags":["elasticsearch","catalog","connection","initialization"],"backgroundTag":"connection-refused","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"}