{"record":{"id":"5774b59722655829","repo":"apache/beam","slug":"the-requested-file-doesn-t-exist","errorCode":null,"errorMessage":"The requested file doesn't exist.","messagePattern":"The requested file doesn't exist\\.","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/blobstore/AzureBlobStoreFileSystem.java","lineNumber":299,"sourceCode":"    if (blobClient.exists()) {\n      throw new IOException(\"This filename is already in use.\");\n    }\n\n    OutputStream outputStream;\n    try {\n      outputStream = blobClient.getBlockBlobClient().getBlobOutputStream();\n    } catch (BlobStorageException e) {\n      throw (IOException) e.getCause();\n    }\n    return newChannel(outputStream);\n  }\n\n  @Override\n  protected ReadableByteChannel open(AzfsResourceId resourceId) throws IOException {\n    BlobContainerClient containerClient =\n        client.get().getBlobContainerClient(resourceId.getContainer());\n    if (!containerClient.exists()) {\n      throw new FileNotFoundException(\"The requested file doesn't exist.\");\n    }\n    BlobClient blobClient = containerClient.getBlobClient(resourceId.getBlob());\n    if (!blobClient.exists()) {\n      throw new FileNotFoundException(\"The requested file doesn't exist.\");\n    }\n    LOG.info(\"Creating a ReadableByteChannel for {}\", resourceId);\n    return new AzureReadableSeekableByteChannel(blobClient);\n  }\n\n  @Override\n  protected void copy(List<AzfsResourceId> srcPaths, List<AzfsResourceId> destPaths)\n      throws IOException {\n    checkArgument(\n        srcPaths.size() == destPaths.size(),\n        \"sizes of source paths and destination paths do not match\");\n\n    Iterator<AzfsResourceId> sourcePathsIterator = srcPaths.iterator();\n    Iterator<AzfsResourceId> destinationPathsIterator = destPaths.iterator();","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/azure/src/main/java/org/apache/beam/sdk/io/azure/blobstore/AzureBlobStoreFileSystem.java#L281-L317","documentation":"In open(), the filesystem first verifies that the blob container itself exists. If client.getBlobContainerClient(container).exists() returns false, it throws a FileNotFoundException with this message, since nothing under a nonexistent container can be read. This check runs before the individual blob existence check.","triggerScenarios":"Calling FileSystems.open() on an azfs://container/blob path where the container name does not exist in the storage account.","commonSituations":"Typos in the container segment of the azfs URI; reading from a container that was deleted or created in a different storage account; case-sensitivity mistakes (Azure container names are lowercase); wrong account configured via AzureOptions.","solutions":["Verify the container exists with 'az storage container exists --account-name <acct> --name <container>'.","Fix the container name in the azfs:// URI (lowercase, correct spelling).","Confirm the correct storage account is supplied via AzureOptions.setAzureAccessToken/accessKey.","Create the container if it should exist (az storage container create)."],"exampleFix":"// before\nReadableByteChannel ch = FileSystems.open(FileSystems.matchNewResource(\"azfs://mycontainer/MyBlob\", true));\n// after\n// ensure container 'mycontainer' exists in the configured account and blob name is valid\nReadableByteChannel ch = FileSystems.open(FileSystems.matchNewResource(\"azfs://mycontainer/myblob.txt\", true));","handlingStrategy":"validation","validationCode":"// verify container before opening\nBlobServiceClient svc = new BlobServiceClientBuilder().connectionString(conn).buildClient();\nboolean containerExists = svc.getBlobContainerClient(container).exists();\nif (!containerExists) throw new IllegalArgumentException(\"Container missing: \" + container);","typeGuard":null,"tryCatchPattern":"try {\n  return FileSystems.open(resourceId);\n} catch (FileNotFoundException e) {\n  // container or blob missing: log path, skip or create container\n  LOG.warn(\"azfs resource not found: {}\", resourceId);\n  return null;\n}","preventionTips":["Keep azfs URIs lowercase for the container segment (Azure requirement).","Verify storage account/container configuration once at pipeline startup.","Use constants/config for container names instead of hand-typed strings."],"tags":["azure","blob-storage","file-not-found","io","container"],"backgroundTag":"file-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}