{"record":{"id":"05655852ef9fe9cf","repo":"apache/dolphinscheduler","slug":"invalid-parent-path","errorCode":null,"errorMessage":"Invalid parent path ","messagePattern":"Invalid parent path ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/main/java/org/apache/dolphinscheduler/plugin/registry/jdbc/KeyUtils.java","lineNumber":38,"sourceCode":"import static com.google.common.base.Preconditions.checkNotNull;\n\nimport org.apache.dolphinscheduler.registry.api.RegistryConstants;\n\nimport org.apache.commons.lang3.StringUtils;\n\nimport lombok.experimental.UtilityClass;\n\n@UtilityClass\npublic class KeyUtils {\n\n    /**\n     * Whether the path is the parent path of the child\n     * <p> Only the parentPath is the parent path of the childPath, return true\n     * <p> If the parentPath is equal to the childPath, return false\n     */\n    public static boolean isParent(final String parentPath, final String childPath) {\n        if (StringUtils.isEmpty(parentPath)) {\n            throw new IllegalArgumentException(\"Invalid parent path \" + parentPath);\n        }\n        if (StringUtils.isEmpty(childPath)) {\n            throw new IllegalArgumentException(\"Invalid child path \" + childPath);\n        }\n        final String[] parentSplit = removeLastSlash(parentPath).split(RegistryConstants.PATH_SEPARATOR);\n        final String[] childSplit = removeLastSlash(childPath).split(RegistryConstants.PATH_SEPARATOR);\n        // If the parent path is longer than or equals the child path, it is impossible to be the parent path of the\n        // child path\n        if (parentSplit.length >= childSplit.length) {\n            return false;\n        }\n        for (int i = 0; i < parentSplit.length; i++) {\n            if (!parentSplit[i].equals(childSplit[i])) {\n                return false;\n            }\n        }\n        return true;\n","sourceCodeStart":20,"sourceCodeEnd":56,"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/KeyUtils.java#L20-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"A listener registered with an empty subscribePath; config where the registry root path is unset; string manipulation upstream that stripped the path to empty.","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"],"exampleFix":"// before\nboolean match = KeyUtils.isParent(subscribePath, eventPath);\n// after\nif (StringUtils.isNotEmpty(subscribePath)) {\n    boolean match = KeyUtils.isParent(subscribePath, eventPath);\n}","handlingStrategy":"validation","validationCode":"if (parentPath == null || parentPath.isEmpty()) throw new IllegalArgumentException(\"parentPath must be non-empty\");","typeGuard":null,"tryCatchPattern":"try { match = KeyUtils.isParent(parentPath, childPath); } catch (IllegalArgumentException e) { log.warn(\"bad path arg: {}\", e.getMessage()); match = false; }","preventionTips":["Validate configured root paths are non-empty at startup","Never register listeners with empty subscribe paths","Centralize path construction to avoid empty-string paths"],"tags":["registry","path","argument-validation"],"backgroundTag":"missing-required-argument","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"}