{"record":{"id":"e4df795cf26d55e0","repo":"apache/beam","slug":"last-updated-operation-failed","errorCode":null,"errorMessage":"last_updated operation failed","messagePattern":"last_updated operation failed","errorType":"exception","errorClass":"BeamIOError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/aws/s3filesystem.py","lineNumber":266,"sourceCode":"      return s3io.S3IO(options=self._options).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 s3io.S3IO(options=self._options).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):\n    \"\"\"Fetch checksum metadata of a file on the\n    :class:`~apache_beam.io.filesystem.FileSystem`.\n\n    Args:\n      path: string path of a file.\n\n    Returns: string containing checksum\n\n    Raises:\n      ``BeamIOError``: if path isn't a file or doesn't exist.\n    \"\"\"\n    try:\n      return s3io.S3IO(options=self._options).checksum(path)\n    except Exception as e:  # pylint: disable=broad-except\n      raise BeamIOError(\"Checksum operation failed\", {path: e})\n","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/aws/s3filesystem.py#L248-L284","documentation":"Raised by S3FileSystem.last_updated when S3IO.last_updated(path) raises; wrapped as BeamIOError keyed by path. Fetching the modification timestamp requires the object to exist and a working S3 client.","triggerScenarios":"Calling fs.last_updated('s3://bucket/key') on a nonexistent object, malformed path, or when the S3 HEAD request fails due to credentials, region, or network errors.","commonSituations":"Incremental sync jobs reading mtimes of files that were deleted or renamed; bucket in wrong region relative to client config; missing IAM s3:GetObject permission.","solutions":["Confirm the object exists (fs.exists) before querying last_updated","Verify IAM permissions include s3:GetObject/s3:ListBucket","Check AWS credentials and client region configuration","Catch BeamIOError and skip/handle paths whose metadata is unavailable"],"exampleFix":"// before\nmtime = fs.last_updated(path)\n// after\ntry:\n    mtime = fs.last_updated(path)\nexcept BeamIOError as e:\n    logging.warning('no mtime for %s: %s', path, e)\n    mtime = None","handlingStrategy":"try-catch","validationCode":"if not fs.exists(path):\n    raise FileNotFoundError(path)","typeGuard":null,"tryCatchPattern":"try:\n    mtime = fs.last_updated(path)\nexcept BeamIOError as e:\n    log.warning('last_updated failed for %s: %s', path, e)\n    mtime = None","preventionTips":["Handle vanishing objects in sync jobs","Confirm IAM read permissions","Retry transient S3 errors with backoff"],"tags":["s3","io","aws","file-metadata"],"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"}