You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Steve Loughran (JIRA)" <ji...@apache.org> on 2010/03/04 18:03:28 UTC

[jira] Created: (HADOOP-6614) RunJar should provide more diags when it can't create a temp file

RunJar should provide more diags when it can't create a temp file
-----------------------------------------------------------------

                 Key: HADOOP-6614
                 URL: https://issues.apache.org/jira/browse/HADOOP-6614
             Project: Hadoop Common
          Issue Type: Improvement
          Components: util
    Affects Versions: 0.22.0
            Reporter: Steve Loughran
            Priority: Minor


When you see a stack trace about permissions, it is better if the trace included the file/directory at fault:
{code}
Exception in thread "main" java.io.IOException: Permission denied
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.checkAndCreate(File.java:1704)
	at java.io.File.createTempFile(File.java:1792)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:147)
{code}

As it is, you need to go into the code, discover that it's {{${hadoop.tmp.dir}/hadoop-unjar}}, but you need to know the value of hadoop.tmp.dir to really find out what the problem is.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6614) RunJar should provide more diags when it can't create a temp file

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842247#action_12842247 ] 

Steve Loughran commented on HADOOP-6614:
----------------------------------------

The root cause here is of course the JRE not providing the filename; same as all those ConnectionRefused exceptions that omit the (hostname, port) information needed to debug it. More people would benefit if we could get the changes back in there, but it's too late.

> RunJar should provide more diags when it can't create a temp file
> -----------------------------------------------------------------
>
>                 Key: HADOOP-6614
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6614
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.22.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> When you see a stack trace about permissions, it is better if the trace included the file/directory at fault:
> {code}
> Exception in thread "main" java.io.IOException: Permission denied
> 	at java.io.UnixFileSystem.createFileExclusively(Native Method)
> 	at java.io.File.checkAndCreate(File.java:1704)
> 	at java.io.File.createTempFile(File.java:1792)
> 	at org.apache.hadoop.util.RunJar.main(RunJar.java:147)
> {code}
> As it is, you need to go into the code, discover that it's {{${hadoop.tmp.dir}/hadoop-unjar}}, but you need to know the value of hadoop.tmp.dir to really find out what the problem is.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6614) RunJar should provide more diags when it can't create a temp file

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841446#action_12841446 ] 

Todd Lipcon commented on HADOOP-6614:
-------------------------------------

+1 to this idea. I've seen this come up on the mailing list pretty often - a clear message pointing them to the config hadoop.tmp.dir and the current setting would be helpful.

> RunJar should provide more diags when it can't create a temp file
> -----------------------------------------------------------------
>
>                 Key: HADOOP-6614
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6614
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.22.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> When you see a stack trace about permissions, it is better if the trace included the file/directory at fault:
> {code}
> Exception in thread "main" java.io.IOException: Permission denied
> 	at java.io.UnixFileSystem.createFileExclusively(Native Method)
> 	at java.io.File.checkAndCreate(File.java:1704)
> 	at java.io.File.createTempFile(File.java:1792)
> 	at org.apache.hadoop.util.RunJar.main(RunJar.java:147)
> {code}
> As it is, you need to go into the code, discover that it's {{${hadoop.tmp.dir}/hadoop-unjar}}, but you need to know the value of hadoop.tmp.dir to really find out what the problem is.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6614) RunJar should provide more diags when it can't create a temp file

Posted by "Paul Baclace (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928522#action_12928522 ] 

Paul Baclace commented on HADOOP-6614:
--------------------------------------

Since File.createTempFile() is invoked by org.apache.hadoop.util.RunJar.main() and it can catch IOException, although the exact name of the temp file is unknown, the containing directory is known since it is hadoop.tmp.dir property.  A patch suggestion follows.

----------

    final File workDir = File.createTempFile("hadoop-unjar", "", tmpDir);
    workDir.delete();
    workDir.mkdirs();
    if (!workDir.isDirectory()) {
      System.err.println("Mkdirs failed to create " + workDir);
      System.exit(-1);
    }


-----Becomes:-----

    // use createTempFile to create a tmp directory
    File workDir = null;
    try {
        workDir = File.createTempFile("hadoop-unjar", "", tmpDir);
    } catch (IOException ioe) {
        System.err.println("Mkdirs failed to create (" + ioe.getMessage() + ") "  + tmpDir);
        System.exit(-1);
    }
    workDir.delete();
    workDir.mkdirs();
    if (!workDir.isDirectory()) {
      System.err.println("Mkdirs failed to create " + workDir);
      System.exit(-1);
    }
    // workDir now refers to an unshared temp dir. 



> RunJar should provide more diags when it can't create a temp file
> -----------------------------------------------------------------
>
>                 Key: HADOOP-6614
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6614
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.22.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> When you see a stack trace about permissions, it is better if the trace included the file/directory at fault:
> {code}
> Exception in thread "main" java.io.IOException: Permission denied
> 	at java.io.UnixFileSystem.createFileExclusively(Native Method)
> 	at java.io.File.checkAndCreate(File.java:1704)
> 	at java.io.File.createTempFile(File.java:1792)
> 	at org.apache.hadoop.util.RunJar.main(RunJar.java:147)
> {code}
> As it is, you need to go into the code, discover that it's {{${hadoop.tmp.dir}/hadoop-unjar}}, but you need to know the value of hadoop.tmp.dir to really find out what the problem is.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-6614) RunJar should provide more diags when it can't create a temp file

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-6614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841999#action_12841999 ] 

Steve Loughran commented on HADOOP-6614:
----------------------------------------

Easily done, I can even think of a test for it, though if the runner calls System.exit it may be tricky

> RunJar should provide more diags when it can't create a temp file
> -----------------------------------------------------------------
>
>                 Key: HADOOP-6614
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6614
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.22.0
>            Reporter: Steve Loughran
>            Priority: Minor
>
> When you see a stack trace about permissions, it is better if the trace included the file/directory at fault:
> {code}
> Exception in thread "main" java.io.IOException: Permission denied
> 	at java.io.UnixFileSystem.createFileExclusively(Native Method)
> 	at java.io.File.checkAndCreate(File.java:1704)
> 	at java.io.File.createTempFile(File.java:1792)
> 	at org.apache.hadoop.util.RunJar.main(RunJar.java:147)
> {code}
> As it is, you need to go into the code, discover that it's {{${hadoop.tmp.dir}/hadoop-unjar}}, but you need to know the value of hadoop.tmp.dir to really find out what the problem is.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.