apache/dolphinscheduler · error · RegistryException
key: not exist
Error message
key: not exist
What it means
Thrown by JdbcRegistry.get when the queried key has no row in the registry database. The JDBC registry stores registry data in DB tables; unlike ZooKeeper, a missing key is surfaced as a RegistryException rather than a null return, so callers must treat absence as exceptional.
Source
Thrown at dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/JdbcRegistry.java:134
public void onDisConnected() {
listener.onUpdate(ConnectionState.DISCONNECTED);
}
@Override
public void onReconnected() {
listener.onUpdate(ConnectionState.RECONNECTED);
}
});
}
@Override
public String get(String key) {
try {
// get the key value
// Directly get from the db?
Optional<JdbcRegistryDataDTO> jdbcRegistryDataOptional = jdbcRegistryClient.getJdbcRegistryDataByKey(key);
if (!jdbcRegistryDataOptional.isPresent()) {
throw new RegistryException("key: " + key + " not exist");
}
return jdbcRegistryDataOptional.get().getDataValue();
} catch (RegistryException registryException) {
throw registryException;
} catch (Exception e) {
throw new RegistryException(String.format("Get key: %s error", key), e);
}
}
@Override
public void put(String key, String value, boolean deleteOnDisconnect) {
try {
DataType dataType = deleteOnDisconnect ? DataType.EPHEMERAL : DataType.PERSISTENT;
jdbcRegistryClient.putJdbcRegistryData(key, value, dataType);
} catch (Exception ex) {
throw new RegistryException(String.format("put key:%s, value:%s error", key, value), ex);
}
}View on GitHub (pinned to 02eac45a1b)
Solutions
- Check key existence with registry.exists(key) before calling get
- Verify the key string matches what was written by put (path prefix, no typos, trailing-slash conventions)
- Re-put or recreate the expected registry data if it should exist
- Wrap get in try-catch for RegistryException and fall back to a default or re-lookup
Example fix
// before
String value = registry.get(key);
// after
if (registry.exists(key)) {
String value = registry.get(key);
} else {
// handle missing key
} Defensive patterns
Strategy: validation
Validate before calling
if (!registry.exists(key)) { throw new IllegalStateException("registry key missing: " + key); } Try / catch
try { value = registry.get(key); } catch (RegistryException e) { if (e.getMessage().contains("not exist")) { /* handle absence */ } else { throw e; } } Prevention
- Call exists() before get() for optional keys
- Use tryExists/exists semantics instead of exception-driven control flow
- Log the constructed key when missing to catch prefix/typo bugs
When it happens
Trigger: Calling registry.get(path) for a path that was never put, was already deleted, or whose ephemeral node disappeared when the owning session disconnected.
Common situations: A master/worker looks up a task or process path after its owner died and cleanup removed the ephemeral key; a typo or stale prefix in the constructed key; racing another component's delete.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Get key: %s error
- put key:%s, value:%s error
- Delete key: %s error
- Get key: %s children error
- Check key: %s exist error
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/0d03a78af9c37df0.
Report an issue: GitHub.