apache/beam · error · RuntimeError
error downloading the file
Error message
error downloading the file %s locally to load the Feast feature store.
What it means
Raised by `download_fs_yaml_file` when any exception occurs while reading the Feast feature store yaml from its source (typically GCS) and writing it to a local temp file. The original exception is swallowed and replaced by a RuntimeError naming the file path, so the download step failed — network, permissions, or path is the cause.
Solutions
- Verify the yaml path exists and is readable: `apache_beam.io.filesystems.FileSystems.exists(path)`.
- Check the worker's service account has read permission on the GCS object/bucket.
- Copy the yaml locally and pass a local path for local runs to isolate the issue.
- If transient, retry `__enter__`; enable logging to capture the original exception cause.
Example fix
// before
FeastFeatureStoreEnrichmentHandler(feature_store_yaml_path='gs://my-bucket/fs.yaml', ...)
// after (verify first)
assert FileSystems.exists('gs://my-bucket/fs.yaml'), 'yaml missing/unreadable' Defensive patterns
Strategy: try-catch
Validate before calling
from apache_beam.io.filesystems import FileSystems
assert FileSystems.exists(fs_yaml_path), f'{fs_yaml_path} missing or unreadable' Try / catch
try:
with FileSystems.open(path) as f:
data = f.read()
except Exception as e:
raise RuntimeError(f'Cannot read {path}: {e!r}') from e Prevention
- Check GCS IAM (storage.objects.get) for the worker service account.
- Verify the yaml is uploaded before pipeline launch.
- Run a local FileSystems.exists check in CI.
When it happens
Trigger: `__enter__` calls `download_fs_yaml_file(feature_store_yaml_path)`; the path is wrong, the bucket/object does not exist, the caller lacks read permission, or FileSystems.open raises for an unsupported/failed filesystem.
Common situations: Typo in gs:// path; missing GCS object after a cleanup job; Dataflow worker service account lacks storage.objects.get; transient network failure during pipeline startup.
Understand the failure class
Background: "failed to read file", EACCES, ENOENT and "could not read <path>" errors: when a program can't read a file from disk — this error's family across 49 libraries.
Related errors
- cache_root GCS bucket path is invalid.
- Doubly compressed files not supported.
- Found no files that match
- GCS not available; please install apache_beam[gcp]
- src and dst files do not exist. src
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/910357f09b62f828.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/python/apache_beam/transforms/enrichment_handlers/feast_feature_store.py:52
]
EntityRowFn = Callable[[beam.Row], Mapping[str, Any]]
_LOGGER = logging.getLogger(__name__)
LOCAL_FEATURE_STORE_YAML_FILENAME = 'fs_yaml_file.yaml'
def download_fs_yaml_file(gcs_fs_yaml_file: str):
"""Download the feature store config file for Feast."""
try:
with FileSystems.open(gcs_fs_yaml_file, 'r') as gcs_file:
with tempfile.NamedTemporaryFile(suffix=LOCAL_FEATURE_STORE_YAML_FILENAME,
delete=False) as local_file:
local_file.write(gcs_file.read())
return Path(local_file.name)
except Exception:
raise RuntimeError(
'error downloading the file %s locally to load the '
'Feast feature store.' % gcs_fs_yaml_file)
def _validate_feature_names(feature_names, feature_service_name):
"""Check if one of `feature_names` or `feature_service_name` is provided."""
if ((not feature_names and not feature_service_name) or
bool(feature_names and feature_service_name)):
raise ValueError(
'Please provide exactly one of a list of feature names to fetch '
'from online store (`feature_names`) or a feature service name for '
'the Feast online feature store (`feature_service_name`).')
def _validate_feature_store_yaml_path_exists(fs_yaml_file):
"""Check if the feature store yaml path exists."""
if not FileSystems.exists(fs_yaml_file):
raise ValueError(View on GitHub (pinned to 12126d8942)