{"record":{"id":"35b912c3e64224cd","repo":"apache/dolphinscheduler","slug":"get-key-s-error","errorCode":null,"errorMessage":"Get key: %s error","messagePattern":"Get key: (.+?) 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":140,"sourceCode":"                listener.onUpdate(ConnectionState.RECONNECTED);\n            }\n        });\n    }\n\n    @Override\n    public String get(String key) {\n        try {\n            // get the key value\n            // Directly get from the db?\n            Optional<JdbcRegistryDataDTO> jdbcRegistryDataOptional = jdbcRegistryClient.getJdbcRegistryDataByKey(key);\n            if (!jdbcRegistryDataOptional.isPresent()) {\n                throw new RegistryException(\"key: \" + key + \" not exist\");\n            }\n            return jdbcRegistryDataOptional.get().getDataValue();\n        } catch (RegistryException registryException) {\n            throw registryException;\n        } catch (Exception e) {\n            throw new RegistryException(String.format(\"Get key: %s error\", key), e);\n        }\n    }\n\n    @Override\n    public void put(String key, String value, boolean deleteOnDisconnect) {\n        try {\n            DataType dataType = deleteOnDisconnect ? DataType.EPHEMERAL : DataType.PERSISTENT;\n            jdbcRegistryClient.putJdbcRegistryData(key, value, dataType);\n        } catch (Exception ex) {\n            throw new RegistryException(String.format(\"put key:%s, value:%s error\", key, value), ex);\n        }\n    }\n\n    @Override\n    public void delete(String key) {\n        try {\n            jdbcRegistryClient.deleteJdbcRegistryDataByKey(key);\n        } catch (Exception e) {","sourceCodeStart":122,"sourceCodeEnd":158,"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#L122-L158","documentation":"Generic wrapper thrown by JdbcRegistry.get when the underlying database access to fetch the key fails for any reason other than the key simply not existing (those get the 'not exist' error). The original exception is preserved as the cause.","triggerScenarios":"Calling registry.get(key) when the DB is down, the connection pool is exhausted, the registry table is missing, or the query throws a SQL/transaction error.","commonSituations":"Database unreachable after failover, wrong JDBC config (bad URL/credentials), schema not initialized, network partition between the app and the metadata DB.","solutions":["Check the wrapped cause exception for the real SQL/connection error","Verify DB connectivity and credentials in the registry JDBC config","Confirm the registry schema tables exist (run the init DDL)","Retry with backoff if the cause is a transient connection error"],"exampleFix":"try {\n    String value = registry.get(key);\n} catch (RegistryException e) {\n    logger.error(\"get failed, cause: {}\", e.getCause(), e);\n    throw e;\n}","handlingStrategy":"retry","validationCode":"// verify DB connectivity before calls: try (Connection c = dataSource.getConnection()) { }","typeGuard":null,"tryCatchPattern":"try { value = registry.get(key); } catch (RegistryException e) { if (isTransient(e.getCause())) retryWithBackoff(); else throw e; }","preventionTips":["Monitor DB health and connection pool saturation","Initialize registry schema before startup","Log e.getCause() to distinguish SQL errors from absence"],"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"}