{"record":{"id":"05fa943fe4cc4f90","repo":"apache/dolphinscheduler","slug":"invalid-subscribe-scope","errorCode":null,"errorMessage":"Invalid subscribe scope ","messagePattern":"Invalid subscribe scope ","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/JdbcRegistryDataChangeListenerAdapter.java","lineNumber":88,"sourceCode":"                .eventData(value)\n                .type(Event.Type.ADD)\n                .build();\n        listener.notify(event);\n    }\n\n    private boolean isPathMatch(final String subscribePath,\n                                final String eventPath,\n                                final SubscribeListener.SubscribeScope subscribeScope) {\n        switch (subscribeScope) {\n            case PATH_ONLY:\n                return KeyUtils.isSamePath(subscribePath, eventPath);\n            case CHILDREN_ONLY:\n                return KeyUtils.isParent(subscribePath, eventPath);\n            case ALL:\n                return KeyUtils.isParent(subscribePath, eventPath)\n                        || KeyUtils.isSamePath(subscribePath, eventPath);\n            default:\n                throw new IllegalArgumentException(\"Invalid subscribe scope \" + subscribeScope);\n        }\n    }\n\n}\n","sourceCodeStart":70,"sourceCodeEnd":93,"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/JdbcRegistryDataChangeListenerAdapter.java#L70-L93","documentation":"IllegalArgumentException thrown by JdbcRegistryDataChangeListenerAdapter.isPathMatch when a subscriber's subscribe scope is not one of the known enum values (PATH_ONLY, CHILDREN_ONLY, ALL). This is an internal invariant: the scope comes from the subscribe API, so it indicates a corrupted/unknown enum passed through.","triggerScenarios":"A change event (added/changed/deleted) fires for a subscribed path and the adapter's switch hits the default branch because the stored subscribeScope value is null or an unrecognized enum constant (e.g. after an enum change between versions).","commonSituations":"Custom code registering a listener with a null or custom scope; incompatibility after upgrading where enum constants were renamed; deserialized state carrying an obsolete scope.","solutions":["Register listeners with a valid SubscribeScope: PATH_ONLY, CHILDREN_ONLY, or ALL","Never pass null as the subscribe scope","Check for version mismatch between modules after an upgrade","Grep for custom enum extensions of SubscribeScope and remove them"],"exampleFix":"// before\nregistry.subscribe(path, listener, null);\n// after\nregistry.subscribe(path, listener, SubscribeScope.ALL);","handlingStrategy":"validation","validationCode":"if (scope != SubscribeScope.PATH_ONLY && scope != SubscribeScope.CHILDREN_ONLY && scope != SubscribeScope.ALL) throw new IllegalArgumentException(\"bad scope\");","typeGuard":"if (scope instanceof SubscribeScope && java.util.EnumSet.of(SubscribeScope.PATH_ONLY, SubscribeScope.CHILDREN_ONLY, SubscribeScope.ALL).contains(scope)) { /* valid */ }","tryCatchPattern":"try { registry.subscribe(path, listener, scope); } catch (IllegalArgumentException e) { log.error(\"invalid subscribe scope\", e); }","preventionTips":["Always pass an enum constant, never null or a raw value","Recheck SubscribeScope usage after version upgrades","Keep listener registration centralized so scopes are validated once"],"tags":["registry","enum","subscribe"],"backgroundTag":"invalid-enum-value","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"}