{"record":{"id":"7c117b92422b4d2f","repo":"apache/hadoop","slug":"uri-resolution-failed","errorCode":null,"errorMessage":"URI resolution failed.","messagePattern":"URI resolution failed\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-federation-balance/src/main/java/org/apache/hadoop/tools/fedbalance/procedure/BalanceJournalInfoHDFS.java","lineNumber":163,"sourceCode":"    return jobs;\n  }\n\n  @Override\n  public void clear(BalanceJob job) throws IOException {\n    Path jobBase = getJobBaseDir(job);\n    FileSystem fs = FileSystem.get(workUri, conf);\n    if (fs.exists(jobBase)) {\n      fs.delete(jobBase, true);\n    }\n    LOG.debug(\"Clear journal of job=\" + job);\n  }\n\n  @Override\n  public void setConf(Configuration conf) {\n    try {\n      this.workUri = new URI(conf.get(SCHEDULER_JOURNAL_URI));\n    } catch (URISyntaxException e) {\n      throw new IllegalArgumentException(\"URI resolution failed.\", e);\n    }\n    this.conf = conf;\n    this.generator = new IdGenerator(Time.monotonicNow());\n  }\n\n  @Override\n  public Configuration getConf() {\n    return conf;\n  }\n\n  private Path getJobBaseDir(BalanceJob job) {\n    String jobId = job.getId();\n    return new Path(workUri.getPath(), jobId);\n  }\n\n  private Path getNewStateJobPath(BalanceJob job) {\n    Path basePath = getJobBaseDir(job);\n    Path logPath = new Path(basePath, JOB_PREFIX + generator.nextValue());","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-federation-balance/src/main/java/org/apache/hadoop/tools/fedbalance/procedure/BalanceJournalInfoHDFS.java#L145-L181","documentation":"BalanceJournalInfoHDFS.setConf() parses the configuration value hdfs.fedbalance.procedure.scheduler.journal.uri (FedBalanceConfigs.SCHEDULER_JOURNAL_URI) into a java.net.URI; a syntactically invalid string raises URISyntaxException, rethrown as IllegalArgumentException('URI resolution failed.') with the original exception attached. It happens when the journal store is instantiated - before any balance job runs - so fedbalance fails at startup/config time.","triggerScenarios":"Setting hdfs.fedbalance.procedure.scheduler.journal.uri to a malformed URI: embedded spaces, illegal characters, or broken scheme syntax. Note: if the key is absent entirely, new URI(null) fails with NullPointerException instead, so this exact message implies a present-but-unparseable value.","commonSituations":"Hand-edited site XML with an unencoded space or Windows-style backslash path; a value copied from documentation with placeholder text left in; missing scheme such as '//ns1/journal'.","solutions":["Set the property to a clean, fully-qualified URI, e.g. hdfs://ns1/fedbalance/journal.","Remove spaces and illegal characters; URL-encode anything unusual in the path.","Validate the value in isolation before deploying: 'jshell> new java.net.URI(\"hdfs://ns1/fedbalance/journal\")' must not throw."],"exampleFix":"<!-- before -->\n<property>\n  <name>hdfs.fedbalance.procedure.scheduler.journal.uri</name>\n  <value>hdfs://ns 1/fedbalance/journal</value>\n</property>\n\n<!-- after -->\n<property>\n  <name>hdfs.fedbalance.procedure.scheduler.journal.uri</name>\n  <value>hdfs://ns1/fedbalance/journal</value>\n</property>","handlingStrategy":"validation","validationCode":"String v = conf.get(\"hdfs.fedbalance.procedure.scheduler.journal.uri\");\ntry {\n  new java.net.URI(v);   // fail fast with the real syntax error before the scheduler starts\n} catch (URISyntaxException e) {\n  throw new IllegalArgumentException(\"Bad journal URI: \" + v, e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  info.setConf(conf);\n} catch (IllegalArgumentException e) {\n  if (\"URI resolution failed.\".equals(e.getMessage())) {\n    // fix hdfs.fedbalance.procedure.scheduler.journal.uri; cause holds the URISyntaxException position\n  }\n}","preventionTips":["Use plain, fully-qualified URIs without spaces for the journal config.","Add a config lint step (URI parse check) to deployment scripts for fedbalance sites."],"tags":["fedbalance","federation-balance","uri-syntax","configuration","journal"],"backgroundTag":"invalid-uri-syntax","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}