lianayu opened a new issue #900: [BUG] 租户编码 filled in digital type ,
URL: https://github.com/apache/incubator-dolphinscheduler/issues/900
 
 
   *For better global communication, please give priority to using English 
description, thx! *
   
   **Describe the bug**
   如果‘租户管理‘中创建的租户对应编码为数字,工作流执行时会报错。
   
   **To Reproduce**
   **escheduler-api-server.log**
   [INFO] 2019-09-26 11:46:37.534 cn.escheduler.api.service.LoggerService:[65] 
- [INFO] 2019-09-26 11:46:19.122 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_1_11_11]  -> 
sudo: unknown user: 12
           sudo: unable to initialize policy plugin
   
   **escheduler-worker.log** 
   [INFO] 2019-09-26 13:24:47.080 
cn.escheduler.common.queue.TaskQueueZkImpl:[206] - consume tasks: 
[2_16_2_16_-1],there still have 0 tasks need to be executed
   [INFO] 2019-09-26 13:24:47.083 
cn.escheduler.server.worker.runner.FetchTaskThread:[163] - worker fetch taskId 
: 16 from queue 
   [INFO] 2019-09-26 13:24:47.085 
cn.escheduler.common.queue.TaskQueueZkImpl:[273] - consume task 
/escheduler/tasks_queue/2_16_2_16_-1
   [INFO] 2019-09-26 13:24:47.131 
cn.escheduler.server.worker.runner.FetchTaskThread:[182] - remove 
task:2_16_2_16_-1 from queue
   [INFO] 2019-09-26 13:24:47.136 
cn.escheduler.server.worker.runner.FetchTaskThread:[205] - task instance  local 
execute path : /tmp/escheduler/exec/process/2/3/16/16 
   [INFO] 2019-09-26 13:24:47.142 
cn.escheduler.server.worker.runner.FetchTaskThread:[133] - create os user : 12
   [INFO] 2019-09-26 13:24:47.142 
cn.escheduler.server.worker.runner.FetchTaskThread:[136] - execute cmd : sudo 
useradd -g root 12
   [INFO] 2019-09-26 13:24:47.164 
cn.escheduler.server.worker.runner.FetchTaskThread:[226] - task : 16 ready to 
submit to task scheduler thread
   [INFO] 2019-09-26 13:24:47.170 
cn.escheduler.server.worker.runner.TaskScheduleThread:[142] - script path : 
/tmp/escheduler/exec/process/2/3/16/16
   [INFO] 2019-09-26 13:24:47.181 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] 
shell task params {"rawScript":"echo 
\"1111\"","localParams":[],"resourceList":[]}
   [INFO] 2019-09-26 13:24:47.183 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] raw 
script : echo "1111"
   [INFO] 2019-09-26 13:24:47.184 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] 
task dir : /tmp/escheduler/exec/process/2/3/16/16
   [INFO] 2019-09-26 13:24:47.184 
cn.escheduler.server.worker.log.TaskLogger:[183] - [taskAppId=TASK_3_16_16] 
tenantCode user:12, task dir:3_16_16
   [INFO] 2019-09-26 13:24:47.184 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] 
create command file:/tmp/escheduler/exec/process/2/3/16/16/3_16_16.command
   [INFO] 2019-09-26 13:24:47.185 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] 
command : #!/bin/sh
   BASEDIR=$(cd `dirname $0`; pwd)
   cd $BASEDIR
   source /root/.bash_profile
   /tmp/escheduler/exec/process/2/3/16/16/3_16_16_node.sh
   [INFO] 2019-09-26 13:24:47.186 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] 
task run command:
   sudo -u 12 sh /tmp/escheduler/exec/process/2/3/16/16/3_16_16.command
   [INFO] 2019-09-26 13:24:47.193 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] 
process start, process id is: 130406
   [INFO] 2019-09-26 13:24:47.195 
cn.escheduler.server.worker.log.TaskLogger:[188] - [taskAppId=TASK_3_16_16] 
process has exited, work dir:/tmp/escheduler/exec/process/2/3/16/16, pid:130406 
,exitStatusCode:1
   [INFO] 2019-09-26 13:24:47.197 
cn.escheduler.server.worker.log.TaskLogger:[178] - [taskAppId=TASK_3_16_16] 
process id is 130406
   [INFO] 2019-09-26 13:24:47.198 
cn.escheduler.server.worker.runner.TaskScheduleThread:[213] - task : 3_16_16 
exit status code : 1
   
   根据日志分析 sudo useradd -g root 12 创建失败,导致任务失败。
   原因如下:
   
![image](https://user-images.githubusercontent.com/6259646/65665538-59da1680-e06e-11e9-8251-5c905cf30ca6.png)
   
   
![image](https://user-images.githubusercontent.com/6259646/65665525-4f1f8180-e06e-11e9-9c54-9b1a69d7bff8.png)
   
   解决方式:
   是否考虑在 “租户管理”新增/修改时对'租户编码'增加校验。校验规则参考linux 
系统中用户名命名规则:不能超过32个字符而且只能用词组字符。就是只能使用数字、字母、下划线的组合
   
   **Which version of Easy Scheduler:**
    -[1.1.0-preview]

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to