{"record":{"id":"651def25010d7de2","repo":"apache/dolphinscheduler","slug":"check-key-s-exist-error","errorCode":null,"errorMessage":"Check key: %s exist error","messagePattern":"Check key: (.+?) exist error","errorType":"exception","errorClass":"RegistryException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java","lineNumber":183,"sourceCode":"        try {\n            final List<JdbcRegistryDataDTO> children = jdbcRegistryClient.listJdbcRegistryDataChildren(key);\n            return children\n                    .stream()\n                    .map(JdbcRegistryDataDTO::getDataKey)\n                    .map(fullPath -> StringUtils.substringBefore(fullPath.substring(key.length() + 1), \"/\"))\n                    .distinct()\n                    .collect(Collectors.toList());\n        } catch (Exception e) {\n            throw new RegistryException(String.format(\"Get key: %s children error\", key), e);\n        }\n    }\n\n    @Override\n    public boolean exists(String key) {\n        try {\n            return jdbcRegistryClient.existJdbcRegistryDataKey(key);\n        } catch (Exception e) {\n            throw new RegistryException(String.format(\"Check key: %s exist error\", key), e);\n        }\n    }\n\n    @Override\n    public boolean acquireLock(String key) {\n        try {\n            jdbcRegistryClient.acquireJdbcRegistryLock(key);\n            return true;\n        } catch (RegistryException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new RegistryException(String.format(\"Acquire lock: %s error\", key), e);\n        }\n    }\n\n    @Override\n    public boolean acquireLock(String key, long timeout) {\n        try {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java#L165-L201","documentation":"Thrown by JdbcRegistry.exists when the existence check query against the registry database fails. Unlike get, absence of the key returns false rather than throwing — this error means the check itself could not run.","triggerScenarios":"Calling registry.exists(key) while the DB is unreachable, credentials are wrong, or the query throws.","commonSituations":"Metadata DB down or during failover, wrong JDBC datasource config, schema not initialized.","solutions":["Inspect the cause for the real connection/SQL error","Verify DB connectivity and registry configuration","Retry with backoff for transient failures","Confirm registry tables exist in the configured schema"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// check datasource: try (Connection c = dataSource.getConnection()) { }","typeGuard":null,"tryCatchPattern":"try { exists = registry.exists(key); } catch (RegistryException e) { exists = false; /* or fail fast per business need */ }","preventionTips":["Confirm schema/tables exist before first use","Use exists() for absence checks so absence never throws","Set up DB health checks and retries"],"tags":["registry","jdbc","database"],"backgroundTag":"database-query-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}