You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "zxn359014360 (via GitHub)" <gi...@apache.org> on 2026/03/24 09:56:32 UTC

[I] [Bug][api] ProcessScheduleTask fails due to missing IWorkflowControlClient bean when Quartz trigger fires [dolphinscheduler]

zxn359014360 opened a new issue, #18091:
URL: https://github.com/apache/dolphinscheduler/issues/18091

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   ---
   
   ### 问题描述
   在 DolphinScheduler 3.4.0 中,当调度任务(Schedule)上线后,Quartz 触发器可以正常注册,但在触发执行时,`ProcessScheduleTask` 无法成功实例化。
   
   根本原因是该类中通过 `@Autowired` 注入了 `IWorkflowControlClient`,但该接口在 API Server 的 Spring 容器中并未注册为 Bean,导致依赖注入失败,从而使 Quartz Job 执行失败。
   
   ---
   ### 错误日志
   org.springframework.beans.factory.NoSuchBeanDefinitionException:
   No qualifying bean of type 'org.apache.dolphinscheduler.extract.master.IWorkflowControlClient'
   
   ---
   
   ### 补充的内容
   #### 根因分析:
   1. `IWorkflowControlClient` 是 extract 模块中的接口:
      - 无 Spring 注解
      - 无 Bean 注册
   
   2. 实现类 `WorkflowControlClient` 位于 master 模块:
      - 不在 API Server classpath
   
   3. API Server 中其他调用方式(如 `TriggerWorkflowExecutorDelegate`)使用的是:
   
   Clients.withService(IWorkflowControlClient.class).withHost(...)
   
   即 **动态 RPC 代理模式**
   
   4. `ProcessScheduleTask` 仍然使用:
   
   @Autowired IWorkflowControlClient
   
   与当前架构不一致
   
   本质问题:RPC 调用模式已迁移,但该类未同步更新
   
   ---
   
   ### 需求或者建议
   
   建议将 `ProcessScheduleTask` 中的调用方式改为统一的 RPC 动态代理模式,例如:
   
   ```java
   Server masterServer = registryClient.getRandomServer(RegistryNodeType.MASTER)
    .orElseThrow(() -> new RuntimeException("no master server available"));
   
   IWorkflowControlClient client = Clients.withService(IWorkflowControlClient.class)
    .withHost(masterServer.getHost() + ":" + masterServer.getPort());
   
   client.scheduleTriggerWorkflow(request);
   ```
   ---
   ### 优先级
   Critical
   
   ### 影响范围
   该问题会导致所有基于 Quartz 的调度任务无法执行,仅手动触发不受影响。
   
   ### 其他说明
   该问题属于 RPC 架构迁移过程中遗漏导致的依赖注入问题,建议统一 API Server 中所有 IWorkflowControlClient 的调用方式,避免类似问题再次发生。
   
   
   ### What you expected to happen
   
   ### 期望的表现:
   Quartz 触发器应正常执行 `ProcessScheduleTask`,并通过 RPC 调用 Master 端接口 `scheduleTriggerWorkflow()` 成功触发工作流实例。
   
   ---
   
   ### 观察到的表现:
   Quartz 触发后任务执行失败,Trigger 状态被设置为 `ERROR`,工作流未被触发。
   
   ### How to reproduce
   
   1. 部署 DolphinScheduler 3.4.0(API Server / Master / Worker)
   2. 创建一个工作流定义并上线
   3. 创建调度(如 cron: `0/5 * * * * ? *`)并上线
   4. 等待 Quartz 触发执行
   5. 查看数据库表 `qrtz_triggers`,状态变为 `ERROR`
   6. 查看 API Server 日志
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   3.4.0
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][api] ProcessScheduleTask fails due to missing IWorkflowControlClient bean when Quartz trigger fires [dolphinscheduler]

Posted by "zxn359014360 (via GitHub)" <gi...@apache.org>.
zxn359014360 commented on issue #18091:
URL: https://github.com/apache/dolphinscheduler/issues/18091#issuecomment-4117719083

   感谢您的快速回复。
   我猜测在docker仓库的镜像包与我们使用的版本之间,可能存在打包或运行时差异,虽然版本号一致,但运行时 classpath 行为不同。
   
   ## 一、环境信息
   
   |配置项|详情|
   |-|-|
   |部署方式|Kubernetes(API / Master / Worker 分离部署)|
   |API 服务镜像|apache/dolphinscheduler-api:3.4.0|
   |数据库|PostgreSQL|
   |API Pod JDK |OpenJDK 1.8.0_472|
   |调度组件|Quartz(JDBC JobStore 存储模式)|
   |关键运行配置|API 服务 `/opt/dolphinscheduler/api-server/libs` 挂载为外部卷(`dolphinscheduler-api-libs`)|
   
   ---
   
   ## 二、问题排查过程
   
   ### 1. 数据库异常
   
   Quartz 触发器中状态变为 `ERROR`。
   
   **查询语句**
   
   ```Plain Text
   SELECT trigger_name, trigger_group, trigger_state FROM qrtz_triggers;
   ```
   
   
   **查询结果**
   
   |trigger_name|trigger_group|trigger_state|
   |-|-|-|
   |job_1|jobgroup_2|ERROR|
   
   ---
   
   ### 2. API 服务日志报错
   
   核心异常为 Spring Bean 注入失败,完整异常栈如下:
   
   ```Plain Text
   org.quartz.SchedulerException: Job instantiation failed
   Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException:
   Error creating bean with name 'org.apache.dolphinscheduler.scheduler.quartz.ProcessScheduleTask':
   Unsatisfied dependency expressed through field 'workflowInstanceController';
   
   nested exception is:
   org.springframework.beans.factory.NoSuchBeanDefinitionException:
   No qualifying bean of type 'org.apache.dolphinscheduler.extract.master.IWorkflowControlClient' available
   
   All triggers of Job jobgroup_2.job_1 set to ERROR state.
   ```
   
   <img width="1920" height="911" alt="Image" src="https://github.com/user-attachments/assets/36ffb4ac-9be6-425f-80be-8ed26a08d3d4" />
   
   ---
   
   ### 3. 运行时 Classpath 验证
   
   #### API 服务仅存在接口,无实现类
   
   ```Plain Text
   # 检索 extract 相关依赖
   kubectl exec -- ls /opt/dolphinscheduler/api-server/libs/ | grep -i extract
   # 输出:dolphinscheduler-extract-master-3.4.0.jar
   
   # 查看接口文件
   kubectl exec -- jar tf /opt/dolphinscheduler/api-server/libs/dolphinscheduler-extract-master-3.4.0.jar | grep IWorkflowControlClient
   # 输出:org/apache/dolphinscheduler/extract/master/IWorkflowControlClient.class
   ```
   
   
   **结论**:API 服务仅包含 `IWorkflowControlClient` 接口定义,无实现类、无 Spring Bean 注册。
   
   ---
   
   #### 实现类仅存在于 Master 模块
   
   ```Plain Text
   kubectl exec -- bash -c "
   for jar in /opt/dolphinscheduler/master-server/libs/dolphinscheduler-*.jar; do
     jar tf $jar 2>/dev/null | grep -iE 'WorkflowControlClient|IWorkflowControlClient' && echo ======;
   done"
   ```
   
   
   输出包含:
   
   ```Plain Text
   org/apache/dolphinscheduler/extract/master/IWorkflowControlClient.class
   org/apache/dolphinscheduler/server/master/rpc/WorkflowControlClient.class
   ```
   
   
   **结论**:`IWorkflowControlClient` 的实现类(`WorkflowControlClient`)仅部署在 Master 节点,API 节点无对应实现。
   
   ---
   
   ## 三、临时解决方式
   - 实现方式:为 API 服务新增 `IWorkflowControlClient` 接口的动态代理 Bean
   - 部署方式:将自定义 jar 包通过外部卷挂载到 API 服务依赖目录
   - 生效方式:重启 API 服务 Pod
   - 验证结果:Quartz 调度正常执行,触发器不再进入 `ERROR` 状态
   
   ---
   
   ## 四、补充说明
   如果需要,我们可以提供:
   - 脱敏后的 K8s 部署 YAML 文件
   - 修复前后完整 API 服务日志
   - API Pod 完整依赖 jar 包列表
   - 字节码反编译 `javap` 完整输出
   - 数据库触发器状态查询原始结果


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][api] ProcessScheduleTask fails due to missing IWorkflowControlClient bean when Quartz trigger fires [dolphinscheduler]

Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on issue #18091:
URL: https://github.com/apache/dolphinscheduler/issues/18091#issuecomment-4118525836

   Please using english to describe.
   
   I've verify that the workflow timing of a single shell node is executed normally in both `apache/dolphinscheduler-standalone-server:3.4.0` `apache/dolphinscheduler-api:3.4.0` `apache/dolphinscheduler-master:3.4.0` `apache/dolphinscheduler-woker:3.4.0` images. I still can't reproduce this issue. I have reason to doubt your mirror image unofficial mirror image. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][api] ProcessScheduleTask fails due to missing IWorkflowControlClient bean when Quartz trigger fires [dolphinscheduler]

Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on issue #18091:
URL: https://github.com/apache/dolphinscheduler/issues/18091#issuecomment-4116899115

   I just downloaded a 3.4.0 package and it works normally. I can't reproduce this issue in my environment. Please provide detailed steps to reproduce it. @zxn359014360 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][api] ProcessScheduleTask fails due to missing IWorkflowControlClient bean when Quartz trigger fires [dolphinscheduler]

Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS closed issue #18091: [Bug][api] ProcessScheduleTask fails due to missing IWorkflowControlClient bean when Quartz trigger fires
URL: https://github.com/apache/dolphinscheduler/issues/18091


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug][api] ProcessScheduleTask fails due to missing IWorkflowControlClient bean when Quartz trigger fires [dolphinscheduler]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #18091:
URL: https://github.com/apache/dolphinscheduler/issues/18091#issuecomment-4116846952

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   ---
   
   ### Problem description
   In DolphinScheduler 3.4.0, when the scheduled task (Schedule) comes online, the Quartz trigger can be registered normally, but when the execution is triggered, the `ProcessScheduleTask` cannot be successfully instantiated.
   
   The root cause is that `IWorkflowControlClient` is injected through `@Autowired` in this class, but the interface is not registered as a Bean in the Spring container of API Server, causing dependency injection to fail, thus causing Quartz Job execution to fail.
   
   ---
   ### Error log
   org.springframework.beans.factory.NoSuchBeanDefinitionException:
   No qualifying bean of type 'org.apache.dolphinscheduler.extract.master.IWorkflowControlClient'
   
   ---
   
   ### Additional content
   #### Root cause analysis:
   1. `IWorkflowControlClient` is the interface in the extract module:
      - No Spring annotations
      - No bean registration
   
   2. The implementation class `WorkflowControlClient` is located in the master module:
      - Not in API Server classpath
   
   3. Other calling methods in API Server (such as `TriggerWorkflowExecutorDelegate`) use:
   
   Clients.withService(IWorkflowControlClient.class).withHost(...)
   
   That is **Dynamic RPC Proxy Mode**
   
   4. `ProcessScheduleTask` still uses:
   
   @Autowired IWorkflowControlClient
   
   Inconsistent with current architecture
   
   Essential problem: The RPC calling mode has been migrated, but the class has not been updated synchronously
   
   ---
   
   ### Needs or suggestions
   
   It is recommended to change the calling method in `ProcessScheduleTask` to the unified RPC dynamic proxy mode, for example:
   
   ```java
   Server masterServer = registryClient.getRandomServer(RegistryNodeType.MASTER)
    .orElseThrow(() -> new RuntimeException("no master server available"));
   
   IWorkflowControlClient client = Clients.withService(IWorkflowControlClient.class)
    .withHost(masterServer.getHost() + ":" + masterServer.getPort());
   
   client.scheduleTriggerWorkflow(request);
   ```
   ---
   ### Priority
   Critical
   
   ### Scope of influence
   This problem will cause all Quartz-based scheduled tasks to fail to execute. Only manual triggering will not be affected.
   
   ### Other instructions
   This problem is a dependency injection problem caused by omissions in the RPC architecture migration process. It is recommended to unify the calling methods of all IWorkflowControlClients in the API Server to avoid similar problems from happening again.
   
   
   ### What you expected to happen
   
   ### Expected performance:
   The Quartz trigger should execute `ProcessScheduleTask` normally and call the Master-side interface `scheduleTriggerWorkflow()` through RPC to successfully trigger the workflow instance.
   
   ---
   
   ### Observed performance:
   After Quartz is triggered, the task execution fails, the Trigger status is set to `ERROR`, and the workflow is not triggered.
   
   ### How to reproduce
   
   1. Deploy DolphinScheduler 3.4.0 (API Server/Master/Worker)
   2. Create a workflow definition and go online
   3. Create a schedule (such as cron: `0/5 * * * * ? *`) and go online
   4. Wait for Quartz to trigger execution
   5. Check the database table `qrtz_triggers`, the status changes to `ERROR`
   6. View API Server logs
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   3.4.0
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org