Skip to content

[BUG] Permission denied if not found dolphinscheder-env.sh #3125

@davidzollo

Description

@davidzollo

when worker server execute the task , if not found dolphinscheder-env.sh, will get System.getProperty("user.home") + File.separator + ".bash_profile" , and it will lead to Permission denied error, something like [INFO] 2020-07-04 12:43:12.640 - [taskAppId=TASK-3-58-65]:[121] - -> /tmp/dolphinscheduler/exec/process/1/3/58/65/3_58_65.command: line 4: /Users/stone/.bash_profile: Permission denied

the related code in CommonUtils.java

public static String getSystemEnvPath() {
    String envPath = PropertyUtils.getString(Constants.DOLPHINSCHEDULER_ENV_PATH);
    if (StringUtils.isEmpty(envPath)) {
      URL envDefaultPath = CommonUtils.class.getClassLoader().getResource(Constants.ENV_PATH);

      if (envDefaultPath != null){
        envPath = envDefaultPath.getPath();
        logger.debug("env path :{}", envPath);
      }else{
        envPath = System.getProperty("user.home") + File.separator + ".bash_profile";
      }
    }

    return envPath;
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions