{"record":{"id":"de46c6e93e76e28a","repo":"apache/hadoop","slug":"minreplication-uris-length-minimum-replicat","errorCode":null,"errorMessage":"<minReplication> < <uris.length>: Minimum replication < #destinations","messagePattern":"<minReplication> < <uris\\.length>: Minimum replication < #destinations","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/NflyFSystem.java","lineNumber":231,"sourceCode":"  private NflyFSystem(URI[] uris, Configuration conf, int minReplication,\n      EnumSet<NflyKey> nflyFlags) throws IOException {\n    this(uris, conf, minReplication, nflyFlags, null);\n  }\n\n  /**\n   * Creates a new Nfly instance.\n   *\n   * @param uris the list of uris in the mount point\n   * @param conf configuration object\n   * @param minReplication minimum copies to commit a write op\n   * @param nflyFlags modes such readMostRecent\n   * @param fsGetter to get the file system instance with the given uri\n   * @throws IOException\n   */\n  private NflyFSystem(URI[] uris, Configuration conf, int minReplication,\n      EnumSet<NflyKey> nflyFlags, FsGetter fsGetter) throws IOException {\n    if (uris.length < minReplication) {\n      throw new IOException(minReplication + \" < \" + uris.length\n          + \": Minimum replication < #destinations\");\n    }\n    setConf(conf);\n    final String localHostName = InetAddress.getLocalHost().getHostName();\n\n    // build a list for topology resolution\n    final List<String> hostStrings = new ArrayList<String>(uris.length + 1);\n    for (URI uri : uris) {\n      final String uriHost = uri.getHost();\n      // assume local file system or another closest filesystem if no authority\n      hostStrings.add(uriHost == null ? localHostName : uriHost);\n    }\n    // resolve the client node\n    hostStrings.add(localHostName);\n\n    final DNSToSwitchMapping tmpDns = ReflectionUtils.newInstance(conf.getClass(\n        CommonConfigurationKeys.NET_TOPOLOGY_NODE_SWITCH_MAPPING_IMPL_KEY,\n        ScriptBasedMapping.class, DNSToSwitchMapping.class), conf);","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/NflyFSystem.java#L213-L249","documentation":"Error \"<minReplication> < <uris.length>: Minimum replication < #destinations\" thrown in apache/hadoop.","triggerScenarios":"Thrown by NflyFSystem when the configured minimum replication (nfly.minReplication) is less than the number of destination URIs, so writes cannot satisfy the policy.","commonSituations":"See trigger scenarios.","solutions":["Set minReplication less than or equal to the number of configured Nfly target URIs.","Add more destination URIs or lower the minimum replication setting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}