{"record":{"id":"f989646045c2f6a1","repo":"apache/hadoop","slug":"url-provided-is-null","errorCode":null,"errorMessage":"URL provided is null","messagePattern":"URL provided is null","errorType":"validation","errorClass":"InvalidUriException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java","lineNumber":1234,"sourceCode":"   * @param path for which URL has to be created.\n   * @param query to be added to the URL.\n   * @return URL for the REST operation.\n   * @throws AzureBlobFileSystemException if URL creation fails.\n   */\n  @VisibleForTesting\n  protected URL createRequestUrl(final URL baseUrl, final String path, final String query)\n          throws AzureBlobFileSystemException {\n    String encodedPath = path;\n    try {\n      encodedPath = urlEncode(path);\n    } catch (AzureBlobFileSystemException ex) {\n      LOG.debug(\"Unexpected error.\", ex);\n      throw new InvalidUriException(path);\n    }\n\n    final StringBuilder sb = new StringBuilder();\n    if (baseUrl == null) {\n      throw new InvalidUriException(\"URL provided is null\");\n    }\n    sb.append(baseUrl.toString());\n    sb.append(encodedPath);\n    sb.append(query);\n\n    final URL url;\n    try {\n      url = new URL(sb.toString());\n    } catch (MalformedURLException ex) {\n      throw new InvalidUriException(\"URL is malformed\" + sb.toString());\n    }\n    return url;\n  }\n\n  /**\n   * returns the url encoded string for a given value.\n   * @param value to be encoded.\n   * @return url encoded string.","sourceCodeStart":1216,"sourceCodeEnd":1252,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java#L1216-L1252","documentation":"createRequestUrl was called with a null base URL. The account endpoint URL that should prefix every request was never established, so no request URL can be built. This is an initialization/configuration defect rather than a service error.","triggerScenarios":"The AbfsClient was constructed without resolving an account base URL — typically a malformed filesystem URI (missing account host, e.g. abfs://container/ with no authority) or code constructing the client directly instead of through AzureBlobFileSystemStore initialization.","commonSituations":"Relative URIs relying on fs.defaultFS that is itself unset; configuration assembled dynamically where the account host is dropped; test harnesses instantiating client objects with null baseUrl.","solutions":["Use fully-qualified URIs of the form abfs://container@account.dfs.core.windows.net/path.","Verify fs.defaultFS / job configuration actually contains the account host before creating the FileSystem.","If constructing clients programmatically, ensure the base URL field is initialized from configuration before any request is attempted."],"exampleFix":"# before\nFileSystem fs = FileSystem.get(new URI(\"abfs://data/\"), conf); # no account host\n# after\nFileSystem fs = FileSystem.get(\n    new URI(\"abfs://data@myaccount.dfs.core.windows.net/\"), conf);","handlingStrategy":"validation","validationCode":"URI u = new URI(userUrl);\nif (u.getHost() == null || u.getAuthority() == null) {\n  throw new IllegalArgumentException(\"URI must include account host: \" + userUrl);\n}","typeGuard":null,"tryCatchPattern":"catch (InvalidUriException ex) {\n  if (\"URL provided is null\".equals(ex.getMessage())) {\n    // base endpoint unresolved: fix URI/config before retrying\n  } else throw ex;\n}","preventionTips":["Always use fully-qualified abfs://container@account.dfs.core.windows.net URIs.","Set fs.defaultFS correctly when relative paths are used.","Fail fast at startup if the filesystem URI has no authority."],"tags":["azure","abfs","uri","initialization","configuration"],"backgroundTag":"invalid-uri","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}