[ 
https://issues.apache.org/jira/browse/HADOOP-9790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13723236#comment-13723236
 ] 

Xi Fang commented on HADOOP-9790:
---------------------------------

This is a Hadoop bug related to 
https://issues.apache.org/jira/browse/MAPREDUCE-4374. On Windows when setting 
up environment variable for child tasks, we add quotes to the environment 
variable values to avoid escaping special characters. In Cmd shell, the 
quotation marks are set as part of the environment variable value. So when we 
receive the environment variables in Hadoop code, we should remove the 
surrounding quotes. We already have code in several places to do so. I am 
thinking this could be something we missed in previous patch.

It is involved to debug this issue because we need to pass debug opts to oozie, 
hadoop and child tasks, which are difficult. I tried a different approach, 
searching for "System.getenv()" across oozie and hadoop projects, and found two 
suspicious places:
In DistCp.java
{code}
  private static JobConf createJobConf(Configuration conf) {
    ...
    String tokenFile = System.getenv("HADOOP_TOKEN_FILE_LOCATION");
    if (tokenFile != null) {
      LOG
        .info("Setting env property for mapreduce.job.credentials.binary to: "
          + tokenFile);
      jobconf.set("mapreduce.job.credentials.binary", tokenFile);
    }
{code} 

and in UserGroupInfomration.java
{code}
static UserGroupInformation getLoginUser() throws IOException {
  ...
        String fileLocation = System.getenv(HADOOP_TOKEN_FILE_LOCATION);
        if (fileLocation != null && isSecurityEnabled()) {
          // load the token storage file and put all of the tokens into the
          // user.
          Credentials cred = Credentials.readTokenStorageFile(
              new Path("file:///" + fileLocation), conf);
{code}

The first one is very likely to be the root cause of this oozie test failure 
(see JobClient.readTokensFromFiles() 
{code}
String binaryTokenFilename =
      conf.get("mapreduce.job.credentials.binary");
    if (binaryTokenFilename != null) {
      Credentials binary = 
        Credentials.readTokenStorageFile(new Path("file:///" +  
                                                  binaryTokenFilename), conf);
      credentials.addAll(binary);
    }
{code}
). 

The second one looks like a potential bug we may run into. We need to fix both.

                
> Job token path is not unquoted properly
> ---------------------------------------
>
>                 Key: HADOOP-9790
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9790
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 1-win
>         Environment: Windows
>            Reporter: Xi Fang
>            Assignee: Xi Fang
>
> Found during oozie unit tests (TestDistCpActionExecutor) and oozie ad-hoc 
> testing (distcp action).
> The error is:
> Exception reading 
> file:/"D:/git/Monarch/project/oozie-monarch/core/target/test-data/minicluster/mapred/local/0_0/taskTracker/test/jobcache/job_20130725105336682_0001/jobToken".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to