{"record":{"id":"10266dc0b8547c24","repo":"apache/hadoop","slug":"unable-to-parse-as-a-uri-check-the-setting-f","errorCode":null,"errorMessage":"Unable to parse '{}' as a URI, check the setting for mapreduce.application.framework.path","messagePattern":"Unable to parse '(.+?)' as a URI, check the setting for mapreduce\\.application\\.framework\\.path","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java","lineNumber":180,"sourceCode":"    return TaskAttemptStateUI.valueOf(attemptStateStr);\n  }\n\n  public static TaskStateUI taskState(String taskStateStr) {\n    return TaskStateUI.valueOf(taskStateStr);\n  }\n\n  // gets the base name of the MapReduce framework or null if no\n  // framework was configured\n  private static String getMRFrameworkName(Configuration conf) {\n    String frameworkName = null;\n    String framework =\n        conf.get(MRJobConfig.MAPREDUCE_APPLICATION_FRAMEWORK_PATH, \"\");\n    if (!framework.isEmpty()) {\n      URI uri;\n      try {\n        uri = new URI(framework);\n      } catch (URISyntaxException e) {\n        throw new IllegalArgumentException(\"Unable to parse '\" + framework\n            + \"' as a URI, check the setting for \"\n            + MRJobConfig.MAPREDUCE_APPLICATION_FRAMEWORK_PATH, e);\n      }\n\n      frameworkName = uri.getFragment();\n      if (frameworkName == null) {\n        frameworkName = new Path(uri).getName();\n      }\n    }\n    return frameworkName;\n  }\n\n  private static void setMRFrameworkClasspath(\n      Map<String, String> environment, Configuration conf) throws IOException {\n    // Propagate the system classpath when using the mini cluster\n    if (conf.getBoolean(YarnConfiguration.IS_MINI_YARN_CLUSTER, false)) {\n      MRApps.addToEnvironment(environment, Environment.CLASSPATH.name(),\n          System.getProperty(\"java.class.path\"), conf);","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/util/MRApps.java#L162-L198","documentation":"MRApps.getMRFrameworkName parses mapreduce.application.framework.path with new URI(framework) to extract the framework name (URI fragment if present, else the path's last component). If the configured string is not a syntactically valid URI, it rethrows as IllegalArgumentException naming the exact key and echoing the bad value. This key points jobs at an alternative MapReduce framework bundle instead of the built-in one.","triggerScenarios":"Setting mapreduce.application.framework.path to a value java.net.URI cannot parse: unescaped spaces, malformed scheme, stray characters — e.g. 'hdfs://nn/opt/my framework.zip'.","commonSituations":"Site config pasted from documentation with spaces in paths; environment-variable substitution producing an empty/garbled value; copying a local path into an hdfs URI incorrectly.","solutions":["Fix the value to be a valid URI, e.g. 'hdfs://nn/user/me/mr-framework.zip#mr-framework' (URL-encode unsafe characters)","Leave mapreduce.application.framework.path unset to use the default MapReduce framework","Validate the setting by parsing it with java.net.URI in a config lint step before deploying"],"exampleFix":"# before\n<property><name>mapreduce.application.framework.path</name>\n  <value>hdfs:///opt/mr framework.zip</value></property>\n\n# after\n<property><name>mapreduce.application.framework.path</name>\n  <value>hdfs:///opt/mr-framework.zip#mr-framework</value></property>","handlingStrategy":"validation","validationCode":"String framework = conf.get(\"mapreduce.application.framework.path\", \"\");\nif (!framework.isEmpty()) {\n  try { new URI(framework); }\n  catch (URISyntaxException e) {\n    throw new ConfigException(\"mapreduce.application.framework.path is not a valid URI: \" + framework);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  uri = new URI(framework);\n} catch (URISyntaxException e) {\n  throw new IllegalArgumentException(\n      \"Fix mapreduce.application.framework.path: \" + framework, e);\n}","preventionTips":["URI-encode spaces and unsafe characters in framework paths (or avoid spaces entirely)","Prefer a fragment to name the framework: hdfs://host/path/bundle.zip#framework-name","Lint custom MR settings by parsing them as URIs in a config smoke test"],"tags":["hadoop","mapreduce","configuration","uri","framework-path"],"backgroundTag":"invalid-uri-syntax","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}