hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Brickley (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-6614) RunJar should provide more diags when it can't create a temp file
Date Sun, 31 Jul 2011 16:04:09 GMT

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

Dan Brickley commented on HADOOP-6614:
--------------------------------------

I also found my way to this error, from quite another route:

It seems some .jar files can cause errors when unzipped. This triggers in /src/core/org/apache/hadoop/util/RunJar.java

if (!file.getParentFile().isDirectory()) {
                throw new IOException("Mkdirs failed to create " +
                                      file.getParentFile().toString());
              }

...causing (in me) huge confusion, as I went chasing around trying to understand what was
going on with tmp dir creation (in hdfs, in local system, etc.). After poking at hadoop a
bit it became clear the jar I was using was problematic. I'm investigating how I ended up
with a weird jar (it was a Mahout 0.6 trunk build), but unzipping it in OSX in an empty dir
gave the following:
[...]
inflated: org/apache/commons/compress/utils/IOUtils.class
  created: META-INF/maven/org.apache.commons/commons-compress/
 inflated: META-INF/maven/org.apache.commons/commons-compress/pom.xml
 inflated: META-INF/maven/org.apache.commons/commons-compress/pom.properties
  created: javax/xml/
  created: javax/xml/parsers/
  created: javax/xml/transform/
  created: javax/xml/transform/dom/
  created: javax/xml/transform/sax/
  created: javax/xml/transform/stream/
java.io.IOException: license : could not create directory
	at sun.tools.jar.Main.extractFile(Main.java:909)
	at sun.tools.jar.Main.extract(Main.java:852)
	at sun.tools.jar.Main.run(Main.java:242)
	at sun.tools.jar.Main.main(Main.java:1149)

Possible related: http://jira.codehaus.org/browse/PICO-299

In this bad-jar scenario, the error message is pretty misleading since 99% of the jar unzips
into the perfectly writable tmp dir; only the bad jar entry causes the error.

> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message