{"record":{"id":"0ce4b853e907ffe3","repo":"apache/beam","slug":"size-operation-failed-blobstoragefilesystem","errorCode":null,"errorMessage":"Size operation failed","messagePattern":"Size operation failed","errorType":"exception","errorClass":"BeamIOError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/azure/blobstoragefilesystem.py","lineNumber":247,"sourceCode":"      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):\n    \"\"\"Get UNIX Epoch time in seconds on the FileSystem.\n\n    Args:\n      path: string path of file.\n\n    Returns: float UNIX Epoch time\n\n    Raises:\n      ``BeamIOError``: if path doesn't exist.\n    \"\"\"\n    try:\n      return self._blobstorageIO().last_updated(path)\n    except Exception as e:  # pylint: disable=broad-except\n      raise BeamIOError(\"Last updated operation failed\", {path: e})\n\n  def checksum(self, path):","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/azure/blobstoragefilesystem.py#L229-L265","documentation":"BlobStorageFileSystem.size() returns the byte size of a file via BlobStorageIO.size() and re-raises any exception as BeamIOError('Size operation failed', {path: e}). Per the docstring it is also the expected error if the path does not exist, since the underlying call raises when the blob is missing.","triggerScenarios":"Calling fs.size(path) on an azfs:// path for a blob that does not exist, or when the underlying Azure SDK call fails (auth, network, permissions).","commonSituations":"Stat'ing a file produced by an earlier pipeline stage that has not been written yet; path built with the wrong container or prefix; credentials lacking read permission on the container; transient Azure errors.","solutions":["Call fs.exists(path) first or check the wrapped exception to distinguish missing-file from other failures","Verify the path with blobstorageio.parse_azfs_path to catch malformed paths early","Confirm credentials have read access to the container","Retry on transient Azure errors (throttling/network) with backoff"],"exampleFix":"// before\nsize = fs.size(path)\n// after\ntry:\n    size = fs.size(path)\nexcept BeamIOError as e:\n    if not fs.exists(path):\n        raise FileNotFoundError(path) from e\n    raise","handlingStrategy":"try-catch","validationCode":"if not fs.exists(path):\n    raise FileNotFoundError(f\"no such blob: {path}\")","typeGuard":null,"tryCatchPattern":"try:\n    size = fs.size(path)\nexcept BeamIOError as e:\n    details = e.exception_details.get(path)\n    logging.error(\"size failed for %s: %s\", path, details)\n    raise","preventionTips":["Call exists() before size() when the file may legitimately be absent","Ensure read permissions on the container","Retry transient Azure errors (throttling, timeouts) with exponential backoff","Verify path format with parse_azfs_path before calls"],"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"}