{"record":{"id":"8de36e1428593e24","repo":"apache/hadoop","slug":"could-not-parse-port-in-kms-uri-url","errorCode":null,"errorMessage":"Could not parse port in kms uri [${url}]","messagePattern":"Could not parse port in kms uri \\[(.+?)\\]","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java","lineNumber":299,"sourceCode":"        throws IOException {\n      if (SCHEME_NAME.equals(providerUri.getScheme())) {\n        URL origUrl = new URL(extractKMSPath(providerUri).toString());\n        String authority = origUrl.getAuthority();\n        // check for ';' which delimits the backup hosts\n        if (Strings.isNullOrEmpty(authority)) {\n          throw new IOException(\n              \"No valid authority in kms uri [\" + origUrl + \"]\");\n        }\n        // Check if port is present in authority\n        // In the current scheme, all hosts have to run on the same port\n        int port = -1;\n        String hostsPart = authority;\n        if (authority.contains(\":\")) {\n          String[] t = authority.split(\":\");\n          try {\n            port = Integer.parseInt(t[1]);\n          } catch (Exception e) {\n            throw new IOException(\n                \"Could not parse port in kms uri [\" + origUrl + \"]\");\n          }\n          hostsPart = t[0];\n        }\n        KMSClientProvider[] providers =\n            createProviders(conf, origUrl, port, hostsPart);\n        return new LoadBalancingKMSClientProvider(providerUri, providers, conf);\n      }\n      return null;\n    }\n\n    private KMSClientProvider[] createProviders(Configuration conf,\n        URL origUrl, int port, String hostsPart) throws IOException {\n      String[] hosts = hostsPart.split(\";\");\n      KMSClientProvider[] providers = new KMSClientProvider[hosts.length];\n      for (int i = 0; i < hosts.length; i++) {\n        try {\n          providers[i] =","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java#L281-L317","documentation":"Error \"Could not parse port in kms uri [${url}]\" thrown in apache/hadoop.","triggerScenarios":"Raised at runtime when the documented precondition or configuration requirement for this operation is violated.","commonSituations":"Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.","solutions":["Use a numeric port in the KMS URI."],"exampleFix":"kms://http@kms-host:9600/kms","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"}