{"record":{"id":"fd4bb89213e5b386","repo":"stanfordnlp/CoreNLP","slug":"could-not-parse-subnet-subnet","errorCode":null,"errorMessage":"Could not parse subnet: ${subnet}","messagePattern":"Could not parse subnet: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/edu/stanford/nlp/pipeline/StanfordCoreNLPServer.java","lineNumber":245,"sourceCode":"    }\n    this.shutdownKey = new BigInteger(130, new Random()).toString(32);\n    IOUtils.writeStringToFile(shutdownKey, tmpFile.getPath(), \"utf-8\");\n    // set status port\n    if (props != null && props.containsKey(\"status_port\")) {\n      this.statusPort = Integer.parseInt(props.getProperty(\"status_port\"));\n    } else if (props != null && props.containsKey(\"port\")) {\n      this.statusPort = Integer.parseInt(props.getProperty(\"port\"));\n    }\n    // parse blockList\n    if (blockList == null) {\n      this.blockListSubnets = Collections.emptyList();\n    } else {\n      this.blockListSubnets = new ArrayList<>();\n      for (String subnet : IOUtils.readLines(blockList)) {\n        try {\n          this.blockListSubnets.add(parseSubnet(subnet));\n        } catch (IllegalArgumentException e) {\n          warn(\"Could not parse subnet: \" + subnet);\n        }\n      }\n    }\n  }\n\n  /**\n   * Parse the URL parameters into a map of (key, value) pairs. <br>\n   * https://codereview.stackexchange.com/questions/175332/splitting-url-query-string-to-key-value-pairs\n   *\n   * @param uri The URL that was requested.\n   *\n   * @return A map of (key, value) pairs corresponding to the request parameters.\n   *\n   * @throws IllegalStateException Thrown if we could not decode the URL with utf8.\n   */\n  private static Map<String, String> getURLParams(URI uri) {\n    String query = uri.getRawQuery();\n    if (query != null) {","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/StanfordCoreNLPServer.java#L227-L263","documentation":"When loading a block list of subnets, StanfordCoreNLPServer parses each line into a subnet via parseSubnet. If a line is not a valid subnet (bad CIDR notation, garbage line, comment typo), the IllegalArgumentException is caught and this warning is logged; the bad subnet is skipped rather than failing server startup.","triggerScenarios":"Starting the server with a block-list file (-blockList or blockListSubnets property) containing a line that is not valid CIDR, e.g. '10.0.0.0/33', 'abc', or an empty/malformed line.","commonSituations":"Hand-edited block list files with typos; lists generated by other tools with comments or headers left inline; IPv6 entries when the parser expects IPv4 (or vice versa).","solutions":["Open the block-list file and fix or remove the invalid subnet line logged in the warning","Use proper CIDR notation, e.g. 10.0.0.0/8 or 192.168.1.0/24","Remove comment lines and blank lines from the block list","Validate each line with a CIDR checker before deploying the file"],"exampleFix":"// before (blocklist.txt)\n10.0.0.0/33\nbad-subnet\n// after (blocklist.txt)\n10.0.0.0/8\n192.168.1.0/24","handlingStrategy":"validation","validationCode":"Pattern CIDR = Pattern.compile(\"^(\\\\d{1,3}\\\\.){3}\\\\d{1,3}/\\\\d{1,2}$\");\nfor (String line : Files.readAllLines(blockList)) {\n  if (!CIDR.matcher(line.trim()).matches())\n    throw new IllegalArgumentException(\"Invalid subnet in block list: \" + line);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate CIDR notation before deploying block lists","Strip comments/blank lines from generated lists","Test server startup with the block list before production","Use tooling to generate rather than hand-edit subnet lists"],"tags":["nlp","server","network","configuration"],"backgroundTag":"invalid-argument-format","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}