apache/dolphinscheduler · error · IllegalArgumentException
Invalid parent path
Error message
Invalid parent path
What it means
IllegalArgumentException thrown by KeyUtils.isParent when the parentPath argument is null or empty. isParent computes a path-prefix relationship by splitting on '/', which is meaningless for an empty parent, so the method fails fast.
Source
Thrown at dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java:38
import static com.google.common.base.Preconditions.checkNotNull;
import org.apache.dolphinscheduler.registry.api.RegistryConstants;
import org.apache.commons.lang3.StringUtils;
import lombok.experimental.UtilityClass;
@UtilityClass
public class KeyUtils {
/**
* Whether the path is the parent path of the child
* <p> Only the parentPath is the parent path of the childPath, return true
* <p> If the parentPath is equal to the childPath, return false
*/
public static boolean isParent(final String parentPath, final String childPath) {
if (StringUtils.isEmpty(parentPath)) {
throw new IllegalArgumentException("Invalid parent path " + parentPath);
}
if (StringUtils.isEmpty(childPath)) {
throw new IllegalArgumentException("Invalid child path " + childPath);
}
final String[] parentSplit = removeLastSlash(parentPath).split(RegistryConstants.PATH_SEPARATOR);
final String[] childSplit = removeLastSlash(childPath).split(RegistryConstants.PATH_SEPARATOR);
// If the parent path is longer than or equals the child path, it is impossible to be the parent path of the
// child path
if (parentSplit.length >= childSplit.length) {
return false;
}
for (int i = 0; i < parentSplit.length; i++) {
if (!parentSplit[i].equals(childSplit[i])) {
return false;
}
}
return true;
View on GitHub (pinned to 02eac45a1b)
Solutions
- Ensure the subscribe path is non-empty before registering the listener
- Validate root/path configuration values are set and non-empty
- Guard the call: check StringUtils.isNotEmpty(parentPath) first
- Fix upstream code that builds the path so it cannot produce an empty string
Example fix
// before
boolean match = KeyUtils.isParent(subscribePath, eventPath);
// after
if (StringUtils.isNotEmpty(subscribePath)) {
boolean match = KeyUtils.isParent(subscribePath, eventPath);
} Defensive patterns
Strategy: validation
Validate before calling
if (parentPath == null || parentPath.isEmpty()) throw new IllegalArgumentException("parentPath must be non-empty"); Try / catch
try { match = KeyUtils.isParent(parentPath, childPath); } catch (IllegalArgumentException e) { log.warn("bad path arg: {}", e.getMessage()); match = false; } Prevention
- Validate configured root paths are non-empty at startup
- Never register listeners with empty subscribe paths
- Centralize path construction to avoid empty-string paths
When it happens
Trigger: Calling KeyUtils.isParent("", child) or with null, typically from the change-listener adapter's scope matching when the subscription path was never set or is empty.
Common situations: A listener registered with an empty subscribePath; config where the registry root path is unset; string manipulation upstream that stripped the path to empty.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Invalid child path
- Invalid path
- no master server available
- no master server available
- no master server available
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/05655852ef9fe9cf.
Report an issue: GitHub.