specified destination directory does not exist

Tavo

I am trying to create a Workflow using the Oozie dashboard provided by the Hue interface. Trying to do it step by step, my workflow only has one java step. The relevant piece of code of this java step is as follows:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class InputPathsCalculator {

    private static final Logger LOGGER = LoggerFactory.getLogger(InputPathsCalculator.class);

    public static void main(String[] args) throws IOException {
    System.out.println("sout-ing");
    LOGGER.info("putting something in the log");
    JobConf jobConf = new JobConf();
    jobConf.addResource(new Path("/etc/hadoop/conf/hdfs-site.xml"));

    Path outputPath = new Path(args[1]);
    List<Path> inputPaths = calculateInputPaths(args[0], jobConf);
    FileUtil.copy(fileSystem,
                         inputPaths.toArray(new Path[0]),
                         fileSystem,
                         outputPath,
                         false,
                         true,
                         jobConf);
    }
}

calculateInputPaths(...) is a method that has been tested in isolation and works just fine. The arguments that I pass to the method are a config file, and a String with the value /usr/myUser/outputs/.

I have two problems here: 1. I can't see anything in any logs. Not what I put into the console, not what I put into the logs 2. The outputs directory exists, but I get the following stack trace:

org.apache.oozie.action.hadoop.JavaMainException: java.io.IOException: `/user/eliasg/outputs/output': specified destination directory does not exist
  at org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:58)
  at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:39)
  at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:36)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:226)
  at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
  at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:450)
  at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
  at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
  at java.security.AccessController.doPrivileged(Native Method)
  at javax.security.auth.Subject.doAs(Subject.java:415)
  at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
  at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.io.IOException: `/user/eliasg/outputs/output': specified destination directory does not exist
  at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:306)
  at com.ig.hadoop.jsonextractor.InputPathsCalculator.main(InputPathsCalculator.java:37)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:55)
  ... 15 more

I have the feeling that for point 2, my jobConfig is missing something that will let it work with hdfs, but I don't know what. About point 1, I am completely lost.

Tavo
  1. I was looking at the wrong place. The logs were there, but apparently I needed to look at the map task container logs instead of the list of apps log.
  2. I have discovered that adding hdfs-site.xml to the jobConf is not enough. There is a property that is not enabled by default and needs to be set. That property is: jobConf.set("fs.default.name", String.format("hdfs://%1$s", jobConf.get("dfs.nameservices")));

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

The specified project directory ''" does not exist

Ansible template - Destination directory does not exist error

Duplicity specified archive directory does not exist

Specified "public" directory {path} does not exist

“Destination directory does not exist” error while doing template copying

Copy files to destination and create destination if does not exist

Could not open sqlite database, specified directory or database file does not exist

Download and move file only if it does not exist on destination directory, otherwise do nothing

Linux: copy and create destination dir if it does not exist

mv: Move file only if destination does not exist

Directory does not exist with FileWriter

Check if directory does not exist

The working directory does not exist

LocalDB instance specified does not exist

Serverless: The specified bucket does not exist

specified JRE installation does not exist

The specified provider "google" does not exist

The specified LocalDb instance does not exist

NiFi 1.10.0 - PutFile does not see the destination directory

rsync wants to copy files that already exist in the destination directory

Check is destination directory exist then proceed if not then create it and proceed afterwards

pushd does not go into specified directory

.ssh directory does not exist debian

exec: does not exist (No such file or directory)

Python: Package directory does not exist

Directory 'mc/etc' does not exist

cmake source directory does not exist

"No such file or directory exist", but it obviously does

Create directory when it does not exist