{"record":{"id":"d543c27891947a7b","repo":"apache/hadoop","slug":"the-source-cluster-must-be-specified","errorCode":null,"errorMessage":"The source cluster must be specified.","messagePattern":"The source cluster must be specified\\.","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-federation-balance/src/main/java/org/apache/hadoop/tools/fedbalance/FedBalance.java","lineNumber":162,"sourceCode":"     */\n    public Builder setDiffThreshold(int value) {\n      this.diffThreshold = value;\n      return this;\n    }\n\n    /**\n     * Build the balance job.\n     */\n    public BalanceJob build() throws IOException {\n      // Construct job context.\n      FedBalanceContext context;\n      Path dst = new Path(inputDst);\n      if (dst.toUri().getAuthority() == null) {\n        throw new IOException(\"The destination cluster must be specified.\");\n      }\n      Path src = new Path(inputSrc);\n      if (src.toUri().getAuthority() == null) {\n        throw new IOException(\"The source cluster must be specified.\");\n      }\n      context = new FedBalanceContext.Builder(src, dst, NO_MOUNT, getConf())\n          .setForceCloseOpenFiles(forceCloseOpen).setUseMountReadOnly(false)\n          .setMapNum(map).setBandwidthLimit(bandwidth).setTrash(trashOpt)\n          .setDiffThreshold(diffThreshold).build();\n\n      LOG.info(context.toString());\n      // Construct the balance job.\n      BalanceJob.Builder<BalanceProcedure> builder = new BalanceJob.Builder<>();\n      DistCpProcedure dcp =\n          new DistCpProcedure(DISTCP_PROCEDURE, null, delayDuration, context);\n      builder.nextProcedure(dcp);\n      TrashProcedure tp =\n          new TrashProcedure(TRASH_PROCEDURE, null, delayDuration, context);\n      builder.nextProcedure(tp);\n      return builder.build();\n    }\n  }","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-federation-balance/src/main/java/org/apache/hadoop/tools/fedbalance/FedBalance.java#L144-L180","documentation":"Mirror of error 5049 in FedBalance.BalanceJob.Builder.build(): after validating dst, it parses inputSrc and requires a non-null authority, because fedbalance must know which cluster to snapshot, disable writes on, and read from. A src without scheme/authority (e.g. /data instead of hdfs://ns1/data) is rejected at build time.","triggerScenarios":"Passing -src /data or any Path whose toUri().getAuthority() is null to the fedbalance CLI; note dst is validated first, so if you see this message the dst URI was already well-formed.","commonSituations":"Habit from 'hdfs dfs' commands where fs.defaultFS supplies the cluster; scripts that build src from a relative config value; single-cluster testing reused for fedbalance.","solutions":["Set -src to a fully-qualified URI: hdfs://<nameservice-or-namenode>:<port>/path.","Verify the src nameservice resolves from this client (hdfs getconf -namenodes or a listing of hdfs://ns1/).","Keep both -src and -dst fully qualified in scripts so neither check fires."],"exampleFix":"# before\nhdfs fedbalance -src /data -dst hdfs://ns2/balance/data\n\n# after\nhdfs fedbalance -src hdfs://ns1/data -dst hdfs://ns2/balance/data","handlingStrategy":"validation","validationCode":"String srcStr = \"hdfs://ns1/data\";\nif (new Path(srcStr).toUri().getAuthority() == null) {\n  throw new IllegalArgumentException(\"fedbalance -src must include the cluster authority, e.g. hdfs://ns1/path\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mandate fully-qualified src/dst URIs in fedbalance job templates.","Validate both URIs' authority in a preflight check before submitting."],"tags":["fedbalance","federation-balance","uri-validation","path","cluster-addressing"],"backgroundTag":"missing-filesystem-authority","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}