{"record":{"id":"24ad1257b014ff36","repo":"apache/dolphinscheduler","slug":"put-key-s-value-s-error","errorCode":null,"errorMessage":"put key:%s, value:%s error","messagePattern":"put key:(.+?), value:(.+?) 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":150,"sourceCode":"            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) {\n            throw new RegistryException(String.format(\"Delete key: %s error\", key), e);\n        }\n    }\n\n    @Override\n    public Collection<String> children(String key) {\n        try {\n            final List<JdbcRegistryDataDTO> children = jdbcRegistryClient.listJdbcRegistryDataChildren(key);\n            return children\n                    .stream()","sourceCodeStart":132,"sourceCodeEnd":168,"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#L132-L168","documentation":"Wrapper thrown in JdbcRegistry.put: any exception raised while writing the key/value pair (as EPHEMERAL or PERSISTENT data) to the registry database — SQL errors, constraint violations, connectivity loss — is rethrown as a RegistryException carrying the key and value plus the original cause.","triggerScenarios":"Calling registry.put(key, value, deleteOnDisconnect) while the DB write fails: connection lost, constraint violation, transaction error, oversized value, or lock contention on the key row.","commonSituations":"Metadata DB restarted or unreachable; duplicate-key conflicts when two nodes put the same path concurrently; value exceeding column length.","solutions":["Check the cause exception for the underlying SQL error","Verify DB connectivity and that the registry tables exist","Retry the put with backoff for transient connection failures","Check for concurrent writers on the same key; use acquireLock to serialize"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (value == null || key == null) throw new IllegalArgumentException(\"key/value required\");","typeGuard":null,"tryCatchPattern":"try { registry.put(key, value, deleteOnDisconnect); } catch (RegistryException e) { retryWithBackoff(key, value); }","preventionTips":["Keep values within the DB column size","Serialize writes to the same key with acquireLock","Verify DB is writable at startup"],"tags":["registry","jdbc","database-write"],"backgroundTag":"database-write-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"}