{"record":{"id":"3006d33c590ab8c1","repo":"apache/beam","slug":"exists-operation-failed-blobstoragefilesystem","errorCode":null,"errorMessage":"Exists operation failed","messagePattern":"Exists operation failed","errorType":"exception","errorClass":"BeamIOError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/azure/blobstoragefilesystem.py","lineNumber":231,"sourceCode":"    results = self._blobstorageIO().rename_files(src_dest_pairs)\n    # Retrieve exceptions.\n    exceptions = {(src, dest): error\n                  for (src, dest, error) in results if error is not None}\n    if exceptions:\n      raise BeamIOError(\"Rename operation failed.\", exceptions)\n\n  def exists(self, path):\n    \"\"\"Check if the provided path exists on the FileSystem.\n\n    Args:\n      path: string path that needs to be checked.\n\n    Returns: boolean flag indicating if path exists\n    \"\"\"\n    try:\n      return self._blobstorageIO().exists(path)\n    except Exception as e:  # pylint: disable=broad-except\n      raise BeamIOError(\"Exists operation failed\", {path: e})\n\n  def size(self, path):\n    \"\"\"Get size in bytes of a file on the FileSystem.\n\n    Args:\n      path: string filepath of file.\n\n    Returns: int size of file according to the FileSystem.\n\n    Raises:\n      ``BeamIOError``: if path doesn't exist.\n    \"\"\"\n    try:\n      return self._blobstorageIO().size(path)\n    except Exception as e:  # pylint: disable=broad-except\n      raise BeamIOError(\"Size operation failed\", {path: e})\n\n  def last_updated(self, path):","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/azure/blobstoragefilesystem.py#L213-L249","documentation":"BlobStorageFileSystem.exists() wraps the underlying BlobStorageIO.exists() call and re-raises any exception as BeamIOError('Exists operation failed', {path: e}). This signals that existence could not be determined (e.g. network or auth failure), not that the file is missing — a missing file simply returns False.","triggerScenarios":"Calling fs.exists(path) with an azfs:// path when the Azure SDK raises: invalid/mismatched account credentials, network failure, malformed connection options, or throttling from the storage service.","commonSituations":"Checking file existence during pipeline setup with expired or misconfigured Azure credentials; connectivity issues in CI containers without network access to the storage endpoint; account name typo causing DNS/auth failures.","solutions":["Read the wrapped exception in BeamIOError.exception_details[path] to identify the root cause (auth, network, etc.)","Validate Azure options (account name/key, connection string, endpoint) before calling","Test connectivity and credentials with a simple azure-storage-blob call or az CLI","Distinguish 'not found' (returns False) from this error — only the exception indicates an infrastructure problem"],"exampleFix":"// before\nexists = fs.exists(path)\n// after\ntry:\n    exists = fs.exists(path)\nexcept BeamIOError as e:\n    logging.error(f\"Could not check existence of {path}: {e.exception_details}\")\n    exists = False  # or re-raise, depending on semantics needed","handlingStrategy":"try-catch","validationCode":"# validate credentials/options before the call\nfrom apache_beam.io.azure import blobstorageio\nblobstorageio.parse_azfs_path(path)  # raises ValueError on malformed path","typeGuard":null,"tryCatchPattern":"try:\n    exists = fs.exists(path)\nexcept BeamIOError as e:\n    logging.error(\"exists check failed for %s: %s\", path, e.exception_details)\n    exists = False  # or re-raise; False here means 'unknown', not 'missing'","preventionTips":["Remember exists() returns False for missing files; only the exception means the check itself failed","Validate Azure credentials/options at pipeline startup","Avoid calling exists in a hot loop — batch or cache results to reduce throttling risk","Pre-validate path format with parse_azfs_path"],"tags":["python","apache-beam","azure-blob-storage","filesystem-io","error-wrapping"],"backgroundTag":"file-read-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}