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

   ### 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
   
   The version of dolphinscheduler is 3.1.7.
   The shell script is:
   ```
   http_code=`curl -s -o result -w "%{http_code}" -X GET  'http://url of our 
service'`
   if [[ $http_code -eq 200 ]]; then
       echo "task execute success."
   else
       echo "task execute failed."
       cat result 
       exit 1
   fi
   param=`cat result` 
   echo $param
   echo  '${setValue(paramOut='${param}')}'
   ```
   "paramOut" is set as a task param with OUT direct.
   
   The task is scheduled to run every minute and all was work well when the 
task is settled, but ArrayIndexOutOfBoundsException is throw after about ten 
hours  and it's never recoverd. when run shell task with output param. 
   
   And there is another problem: most of the time  the param passing is wroking 
well, the next task node can obtain the correct param passed by the first shell 
task, but some time the next task obtain the param as blank  and there is no 
error log. This situation happend occasionally.
   
   
   The task log:
   ```
   [INFO] 2024-08-28 02:23:02.470 +0000 - task run command: sudo -u 
dolphinscheduler -E bash 
/data1/dolphinscheduler-data/exec/process/dolphinscheduler/11465962145888/14603302834144_23/281095/325874/281095_325874.command
   [INFO] 2024-08-28 02:23:02.471 +0000 - process start, process id is: 7742
   [INFO] 2024-08-28 02:23:02.528 +0000 - process has exited. execute 
path:/data1/dolphinscheduler-data/exec/process/dolphinscheduler/11465962145888/14603302834144_23/281095/325874,
 processId:7742 ,exitStatusCode:0 ,processWaitForStatus:true ,processExitValue:0
   [ERROR] 2024-08-28 02:23:02.530 +0000 - shell task error
   java.lang.ArrayIndexOutOfBoundsException: 1
        at 
org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getMapByString(AbstractParameters.java:191)
        at 
org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.dealOutParam(AbstractParameters.java:144)
        at 
org.apache.dolphinscheduler.plugin.task.shell.ShellTask.handle(ShellTask.java:99)
        at 
org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerDelayTaskExecuteRunnable.executeTask(DefaultWorkerDelayTaskExecuteRunnable.java:49)
        at 
org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecuteRunnable.run(WorkerTaskExecuteRunnable.java:174)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at 
com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
        at 
com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
        at 
com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)
   [ERROR] 2024-08-28 02:23:02.531 +0000 - 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.shell.ShellTask.handle(ShellTask.java:108)
        at 
org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerDelayTaskExecuteRunnable.executeTask(DefaultWorkerDelayTaskExecuteRunnable.java:49)
        at 
org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecuteRunnable.run(WorkerTaskExecuteRunnable.java:174)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at 
com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:131)
        at 
com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:74)
        at 
com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:82)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)
   Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
        at 
org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.getMapByString(AbstractParameters.java:191)
        at 
org.apache.dolphinscheduler.plugin.task.api.parameters.AbstractParameters.dealOutParam(AbstractParameters.java:144)
        at 
org.apache.dolphinscheduler.plugin.task.shell.ShellTask.handle(ShellTask.java:99)
        ... 9 common frames omitted
   [INFO] 2024-08-28 02:23:02.531 +0000 -  -> task execute success.
        cat: result: No such file or directory
        
   [INFO] 2024-08-28 02:23:02.531 +0000 - FINALIZE_SESSION
   [INFO] 2024-08-28 02:23:02.531 +0000 - cancel process: 7742
   [INFO] 2024-08-28 02:23:02.531 +0000 - Get a exception when execute the 
task, will send the task execute result to master, the current task execute 
result is TaskExecutionStatus{code=6, desc='failure'}
   [INFO] 2024-08-28 02:23:03.471 +0000 - FINALIZE_SESSION
   ```
   
   ### What you expected to happen
   
   param passing working well
   
   ### How to reproduce
   
    as described above
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   3.1.x
   
   ### 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]

Reply via email to