{"record":{"id":"bbde3a48840fa307","repo":"apache/beam","slug":"path-does-not-exist-s","errorCode":null,"errorMessage":"Path does not exist: %s","messagePattern":"Path does not exist: (.+?)","errorType":"exception","errorClass":"BeamIOError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/io/localfilesystem.py","lineNumber":293,"sourceCode":"    \"\"\"\n    try:\n      return os.path.getsize(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    if not self.exists(path):\n      raise BeamIOError('Path does not exist: %s' % path)\n    return os.path.getmtime(path)\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 file size.\n\n    Raises:\n      ``BeamIOError``: if path isn't a file or doesn't exist.\n    \"\"\"\n    if not self.exists(path):\n      raise BeamIOError('Path does not exist: %s' % path)\n    return str(os.path.getsize(path))\n","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/io/localfilesystem.py#L275-L311","documentation":"LocalFileSystem.last_updated returns the modification time of a file, but first checks self.exists(path) and raises BeamIOError('Path does not exist: %s' % path) when the check fails. It exists precisely to give a clear error instead of a raw OSError from os.path.getmtime when the path is missing or inaccessible.","triggerScenarios":"Calling LocalFileSystem.last_updated(path) for a path that does not exist, has been deleted, is a broken symlink, or is not accessible so that exists() returns False. Also triggered by transient races where the file is removed between the exists check and getmtime.","commonSituations":"Reading mtime of an output file before the pipeline produced it; checking files on a mount that is temporarily unavailable; stale cached paths from a previous run.","solutions":["Verify the path exists and is spelled correctly (absolute vs relative, URL scheme) before calling last_updated.","Check FileSystems.exists(path) in your own code first if you want to handle absence gracefully.","Catch BeamIOError and treat a missing path as 'no timestamp available' in your workflow.","If the file should exist, investigate why it is missing: deleted by retention/cleanup jobs, wrong stage/output directory, or failed upstream step.","Use checksum/metadata variants only when you actually need them; ensure path is a file, since exists may hold for directories too."],"exampleFix":"// before\nmtime = fs.last_updated(path)\n// after\nfrom apache_beam.io.filesystem import BeamIOError\ntry:\n    mtime = fs.last_updated(path)\nexcept BeamIOError:\n    mtime = None  # path absent or inaccessible","handlingStrategy":"try-catch","validationCode":"from apache_beam.io.filesystems import FileSystems\nif not FileSystems.exists(path):\n    raise FileNotFoundError(path)","typeGuard":null,"tryCatchPattern":"from apache_beam.io.filesystem import BeamIOError\ntry:\n    mtime = fs.last_updated(path)\nexcept BeamIOError:\n    mtime = None  # treat as 'no timestamp available'","preventionTips":["Confirm the producing pipeline step completed before reading mtimes","Use the FileSystems facade so path schemes route to the right filesystem","Handle transient deletions (cleanup jobs, tmp reapers) explicitly"],"tags":["python","apache-beam","filesystem","mtime","path-not-found"],"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"}