{"record":{"id":"fb3b55b225ce1452","repo":"apache/hadoop","slug":"f-already-exists","errorCode":null,"errorMessage":"f + \" already exists\"","messagePattern":"f \\+ \" already exists\"","errorType":"exception","errorClass":"FileAlreadyExistsException","httpStatus":null,"severity":"error","filePath":"hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BaiduBosFileSystem.java","lineNumber":195,"sourceCode":"    };\n  }\n\n  @Override\n  public FSDataOutputStream create(Path f, FsPermission permission,\n      boolean overwrite, int bufferSize, short replication,\n      long blockSize, Progressable progress) throws IOException {\n    Path absolutePath = makeAbsolute(f);\n    String key = pathToKey(absolutePath);\n\n    if (overwrite) {\n      if (store.isDirectory(key)) {\n        throw new FileAlreadyExistsException(\n            f + \" is a directory\");\n      }\n    } else {\n      try {\n        getFileStatus(f);\n        throw new FileAlreadyExistsException(\n            f + \" already exists\");\n      } catch (FileNotFoundException e) {\n        // nothing, ok\n      }\n    }\n\n    return new FSDataOutputStream(\n        store.createFile(key, getConf()), statistics);\n  }\n\n  /**\n   * Create a file non-recursively. The parent directory must\n   * already exist.\n   *\n   * @param f the file name to create\n   * @param permission the permission to set\n   * @param overwrite if true, overwrite the existing file\n   * @param bufferSize the buffer size","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-cloud-storage-project/hadoop-bos/src/main/java/org/apache/hadoop/fs/bos/BaiduBosFileSystem.java#L177-L213","documentation":"The mapreduce-API copy of StreamXmlRecordReader (org.apache.hadoop.streaming.mapreduce) mirrors the legacy one: its init reads CONF_NS+'begin' and CONF_NS+'end' through checkJobGet, and checkJobGet throws IOException 'JobConf: missing required property' when conf_.get(prop) is null. Both marker properties are mandatory for XML-style record extraction.","triggerScenarios":"Using -inputreader org.apache.hadoop.streaming.mapreduce.StreamXmlRecordReader without -jobconf stream.recordreader.begin / stream.recordreader.end, or setting them in a config file that is not actually loaded into the task's Configuration (conf_).","commonSituations":"Same family as the mapred variant: forgotten marker properties after switching from LineRecordReader; properties defined only on the client-side JobConf but overwritten by a wrapper (Hive/Pig streaming) that rebuilds the configuration; typo'd property keys.","solutions":["Add both -jobconf stream.recordreader.begin=<beginRegex> and -jobconf stream.recordreader.end=<endRegex> to the streaming command.","Confirm the properties survive to the task side: dump the effective config or read them back via job.getConfiguration().get(...) before submit.","Optional tuning keys that also live under stream.recordreader.: maxrec (default 50000) and lookahead (default 2*maxrec) — check them for typos too.","If you only need line records, use the default reader instead of StreamXmlRecordReader."],"exampleFix":"// before\njob.getConfiguration().set(\"stream.recordreader.class\",\n    \"org.apache.hadoop.streaming.mapreduce.StreamXmlRecordReader\");\n\n// after\njob.getConfiguration().set(\"stream.recordreader.class\",\n    \"org.apache.hadoop.streaming.mapreduce.StreamXmlRecordReader\");\njob.getConfiguration().set(\"stream.recordreader.begin\", \"<record>\");\njob.getConfiguration().set(\"stream.recordreader.end\", \"</record>\");","handlingStrategy":"validation","validationCode":"Configuration conf = job.getConfiguration();\nif (conf.get(\"stream.recordreader.class\", \"\").contains(\"StreamXmlRecordReader\")) {\n  Preconditions.checkState(conf.get(\"stream.recordreader.begin\") != null,\n      \"stream.recordreader.begin must be set\");\n  Preconditions.checkState(conf.get(\"stream.recordreader.end\") != null,\n      \"stream.recordreader.end must be set\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set begin/end markers whenever the XML record reader is selected.","Read the properties back from the effective Configuration before submit.","Watch for wrappers (Hive/Pig) that rebuild job conf and drop custom keys."],"tags":["hadoop","streaming","configuration","missing-property","xml-record-reader"],"backgroundTag":"missing-required-config","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}