FN20200222 opened a new issue, #16714: URL: https://github.com/apache/dolphinscheduler/issues/16714
### 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 docker dev remote shell find bug,Caused by: java.lang.IllegalStateException: SshClient not started. Please call start() method before connecting to a server ### What you expected to happen [LOG-PATH]: /opt/dolphinscheduler/logs/20241020/122878391380640/1/1/1.log, [HOST]: 172.17.0.2:1234 2024-10-20 20:53:57.006 INFO [WorkerTaskExecutorThreadPool] - ************************************************************************************************ ********************************* Initialize task context ************************************ ************************************************************************************************ 2024-10-20 20:53:57.010 INFO [WorkerTaskExecutorThreadPool] - Begin to initialize task 2024-10-20 20:53:57.010 INFO [WorkerTaskExecutorThreadPool] - Set task startTime: 1729428837010 2024-10-20 20:53:57.010 INFO [WorkerTaskExecutorThreadPool] - Set task appId: 1_1 2024-10-20 20:53:57.016 INFO [WorkerTaskExecutorThreadPool] - End initialize task { "taskInstanceId" : 1, "taskName" : "N1", "firstSubmitTime" : 1729428836894, "startTime" : 1729428837010, "taskType" : "REMOTESHELL", "workflowInstanceHost" : "172.17.0.2:5678", "host" : "172.17.0.2:1234", "logPath" : "/opt/dolphinscheduler/logs/20241020/122878391380640/1/1/1.log", "processId" : 0, "workflowDefinitionCode" : 122878391380640, "workflowDefinitionVersion" : 1, "workflowInstanceId" : 1, "scheduleTime" : 0, "globalParams" : "[]", "executorId" : 1, "cmdTypeIfComplement" : 0, "tenantCode" : "default", "workflowDefinitionId" : 0, "projectId" : 0, "projectCode" : 122878284245664, "taskParams" : "{\"localParams\":[],\"rawScript\":\"echo $(date)\",\"resourceList\":[],\"type\":\"SSH\",\"datasource\":1}", "prepareParamsMap" : { "system.task.definition.name" : { "prop" : "system.task.definition.name", "direct" : "IN", "type" : "VARCHAR", "value" : "N1" }, "system.project.name" : { "prop" : "system.project.name", "direct" : "IN", "type" : "VARCHAR", "value" : null }, "system.project.code" : { "prop" : "system.project.code", "direct" : "IN", "type" : "VARCHAR", "value" : "122878284245664" }, "system.workflow.instance.id" : { "prop" : "system.workflow.instance.id", "direct" : "IN", "type" : "VARCHAR", "value" : "1" }, "system.biz.curdate" : { "prop" : "system.biz.curdate", "direct" : "IN", "type" : "VARCHAR", "value" : "20241020" }, "system.biz.date" : { "prop" : "system.biz.date", "direct" : "IN", "type" : "VARCHAR", "value" : "20241019" }, "system.task.instance.id" : { "prop" : "system.task.instance.id", "direct" : "IN", "type" : "VARCHAR", "value" : "1" }, "system.workflow.definition.name" : { "prop" : "system.workflow.definition.name", "direct" : "IN", "type" : "VARCHAR", "value" : null }, "system.task.definition.code" : { "prop" : "system.task.definition.code", "direct" : "IN", "type" : "VARCHAR", "value" : "122878359943840" }, "system.workflow.definition.code" : { "prop" : "system.workflow.definition.code", "direct" : "IN", "type" : "VARCHAR", "value" : "122878391380640" }, "system.datetime" : { "prop" : "system.datetime", "direct" : "IN", "type" : "VARCHAR", "value" : "20241020205356" } }, "taskAppId" : "1_1", "taskTimeout" : 2147483647, "workerGroup" : "default", "currentExecutionStatus" : "SUBMITTED_SUCCESS", "resourceParametersHelper" : { "resourceMap" : { "DATASOURCE" : { "1" : { "resourceType" : "DATASOURCE", "type" : "SSH", "connectionParams" : "{\"user\":\"root\",\"password\":\"**********\",\"host\":\"47.95.15.189\",\"port\":22}", "DATASOURCE" : null } } } }, "endTime" : 0, "dryRun" : 0, "paramsMap" : { }, "cpuQuota" : -1, "memoryMax" : -1, "testFlag" : 0, "logBufferEnable" : false, "dispatchFailTimes" : 0, "failover" : false } 2024-10-20 20:53:57.017 INFO [WorkerTaskExecutorThreadPool] - *********************************************************************************************** ********************************* Load task instance plugin ********************************* *********************************************************************************************** 2024-10-20 20:53:57.033 INFO [WorkerTaskExecutorThreadPool] - Send task status RUNNING_EXECUTION master: 172.17.0.2:1234 2024-10-20 20:53:57.038 INFO [WorkerTaskExecutorThreadPool] - Current tenant is default tenant, will use bootstrap user: root to execute the task 2024-10-20 20:53:57.038 INFO [WorkerTaskExecutorThreadPool] - TenantCode: root check successfully 2024-10-20 20:53:57.043 INFO [WorkerTaskExecutorThreadPool] - WorkflowInstanceExecDir: /tmp/dolphinscheduler/exec/process/root/122878284245664/122878391380640_1/1/1 check successfully 2024-10-20 20:53:57.044 INFO [WorkerTaskExecutorThreadPool] - Create TaskChannel: org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteShellTaskChannel successfully 2024-10-20 20:53:57.044 INFO [WorkerTaskExecutorThreadPool] - Download resources successfully: ResourceContext(resourceItemMap={}) 2024-10-20 20:53:57.046 INFO [WorkerTaskExecutorThreadPool] - Download upstream files: [] successfully 2024-10-20 20:53:57.047 INFO [WorkerTaskExecutorThreadPool] - Task plugin instance: REMOTESHELL create successfully 2024-10-20 20:53:57.047 INFO [WorkerTaskExecutorThreadPool] - shell task params {"localParams":[],"rawScript":"echo $(date)","resourceList":[],"type":"SSH","datasource":1} 2024-10-20 20:53:57.054 INFO [WorkerTaskExecutorThreadPool] - Success initialized task plugin instance successfully 2024-10-20 20:53:57.054 INFO [WorkerTaskExecutorThreadPool] - Set taskVarPool: null successfully 2024-10-20 20:53:57.056 INFO [WorkerTaskExecutorThreadPool] - ************************************************************************************************ ********************************* Execute task instance ************************************* *********************************************************************************************** 2024-10-20 20:53:57.061 INFO [WorkerTaskExecutorThreadPool] - raw script : #!/bin/bash echo $(date) echo DOLPHINSCHEDULER-REMOTE-SHELL-TASK-STATUS-$? 2024-10-20 20:53:57.602 INFO [WorkerTaskExecutorThreadPool] - upload script from local:/tmp/dolphinscheduler/exec/process/root/122878284245664/122878391380640_1/1/1/1_1_node.sh to remote: /tmp/dolphinscheduler-remote-shell-root/dolphinscheduler-remoteshell-1.sh 2024-10-20 20:53:57.735 ERROR [WorkerTaskExecutorThreadPool] - shell task error org.apache.dolphinscheduler.plugin.task.api.TaskException: Remote shell task error at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.run(RemoteExecutor.java:100) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteShellTask.handle(RemoteShellTask.java:104) at org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerTaskExecutor.executeTask(DefaultWorkerTaskExecutor.java:51) at org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecutor.run(WorkerTaskExecutor.java:173) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: java.nio.file.FileAlreadyExistsException: /tmp/dolphinscheduler-remote-shell-root/dolphinscheduler-remoteshell-1.sh at java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:119) at java.nio.file.Files.copy(Files.java:1277) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.uploadScript(RemoteExecutor.java:218) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.saveCommand(RemoteExecutor.java:206) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.run(RemoteExecutor.java:92) ... 6 common frames omitted 2024-10-20 20:53:57.735 ERROR [WorkerTaskExecutorThreadPool] - Task execute failed, due to meet an exception org.apache.dolphinscheduler.plugin.task.api.TaskException: Execute shell task error at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteShellTask.handle(RemoteShellTask.java:110) at org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerTaskExecutor.executeTask(DefaultWorkerTaskExecutor.java:51) at org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecutor.run(WorkerTaskExecutor.java:173) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: org.apache.dolphinscheduler.plugin.task.api.TaskException: Remote shell task error at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.run(RemoteExecutor.java:100) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteShellTask.handle(RemoteShellTask.java:104) ... 5 common frames omitted Caused by: java.nio.file.FileAlreadyExistsException: /tmp/dolphinscheduler-remote-shell-root/dolphinscheduler-remoteshell-1.sh at java.nio.file.CopyMoveHelper.copyToForeignTarget(CopyMoveHelper.java:119) at java.nio.file.Files.copy(Files.java:1277) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.uploadScript(RemoteExecutor.java:218) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.saveCommand(RemoteExecutor.java:206) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.run(RemoteExecutor.java:92) ... 6 common frames omitted 2024-10-20 20:53:57.736 INFO [WorkerTaskExecutorThreadPool] - kill remote task dolphinscheduler-remoteshell-1 2024-10-20 20:53:57.736 ERROR [WorkerTaskExecutorThreadPool] - Cancel task failed, this will not affect the taskInstance status, but you need to check manual org.apache.dolphinscheduler.plugin.task.api.TaskException: cancel application error at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteShellTask.cancel(RemoteShellTask.java:121) at org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecutor.cancelTask(WorkerTaskExecutor.java:134) at org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecutor.afterThrowing(WorkerTaskExecutor.java:115) at org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerTaskExecutor.afterThrowing(DefaultWorkerTaskExecutor.java:61) at org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecutor.run(WorkerTaskExecutor.java:180) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: org.apache.dolphinscheduler.plugin.task.api.TaskException: SSH connection failed at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.getSession(RemoteExecutor.java:82) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.runRemote(RemoteExecutor.java:224) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.getTaskPid(RemoteExecutor.java:200) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.kill(RemoteExecutor.java:158) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteShellTask.cancel(RemoteShellTask.java:119) ... 7 common frames omitted Caused by: java.lang.IllegalStateException: SshClient not started. Please call start() method before connecting to a server at org.apache.sshd.client.SshClient.doConnect(SshClient.java:627) at org.apache.sshd.client.SshClient.doConnect(SshClient.java:616) at org.apache.sshd.client.SshClient.connect(SshClient.java:547) at org.apache.sshd.client.SshClient.connect(SshClient.java:539) at org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:74) at org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:57) at org.apache.dolphinscheduler.plugin.datasource.ssh.SSHUtils.getSession(SSHUtils.java:41) at org.apache.dolphinscheduler.plugin.task.remoteshell.RemoteExecutor.getSession(RemoteExecutor.java:77) ... 11 common frames omitted 2024-10-20 20:53:57.746 INFO [WorkerTaskExecutorThreadPool] - Get a exception when execute the task, will send the task status: FAILURE to master: 172.17.0.2:1234 2024-10-20 20:53:57.747 INFO [WorkerTaskExecutorThreadPool] - FINALIZE_SESSION ### How to reproduce docker dev remote shell find bug,Caused by: java.lang.IllegalStateException: SshClient not started. Please call start() method before connecting to a server ### Anything else _No response_ ### Version dev ### Are you willing to submit PR? - [ ] 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
