apache/beam · error · RuntimeError
Unrecognized SDK wheel file
Error message
Unrecognized SDK wheel file: %s
What it means
Raised by Stager._desired_sdk_filename_in_staging_location when --sdk_location points to a .whl file whose basename does not start with 'apache_beam'. Only recognized Beam SDK wheels can be staged; anything else is rejected. This prevents staging an arbitrary wheel as if it were the SDK.
Solutions
- Point --sdk_location at a wheel whose filename starts with 'apache_beam' (e.g. apache_beam-2.xx.0-cp310-...whl)
- Rename/restore the Beam wheel to its canonical apache_beam-*.whl filename
- Use a non-wheel sdk_location (e.g. a staging directory or the default) if you meant to stage sources
- Verify you are not accidentally passing an unrelated .whl
Example fix
# before --sdk_location=./dist/my_custom_pkg-1.0-py3-none-any.whl # after --sdk_location=./dist/apache_beam-2.60.0-cp310-cp310-manylinux1_x86_64.whl
Defensive patterns
Strategy: validation
Validate before calling
import os
sdk_location = options.get('sdk_location', '')
if sdk_location.endswith('.whl'):
name = os.path.basename(sdk_location)
if not name.startswith('apache_beam'):
raise ValueError(f'{sdk_location} is not an apache_beam wheel') Type guard
def is_beam_wheel(sdk_location: str) -> bool:
import os
return (not sdk_location.endswith('.whl')) or os.path.basename(sdk_location).startswith('apache_beam') Try / catch
try:
stage(sdk_location=sdk_location)
except RuntimeError as e:
if 'Unrecognized SDK wheel file' in str(e):
sys.exit('--sdk_location must point to an apache_beam-*.whl file')
raise Prevention
- Never rename Beam wheels; keep the canonical apache_beam-*.whl filename
- Double-check the sdk_location path points at the Beam SDK, not another dependency
- Validate sdk_location in launch scripts before submission
When it happens
Trigger: Running with --sdk_location=/path/to/foo.whl (or any non-apache_beam wheel filename) so the split basename fails the 'apache_beam' prefix check.
Common situations: Pointing sdk_location at a private dependency wheel by mistake; renaming a Beam wheel so the apache_beam prefix is lost; copy-pasting a wrong path into sdk_location.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- A BigQuery table or a query must be specified
- A cluster_identifier should be Optional[Union[str…
- A context manager constructor (not a fully constructed…
- A has been supplied to the model handler, but the required…
- A pubsub message attribute key must not exceed 256 bytes.
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/5c3dcc65e5fa9cbf.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/python/apache_beam/runners/portability/stager.py:915
if not output_files:
raise RuntimeError(
'File %s not found.' % os.path.join(temp_dir, '*.tar.gz'))
return output_files[0]
finally:
os.chdir(saved_current_directory)
@staticmethod
def _desired_sdk_filename_in_staging_location(sdk_location) -> str:
"""Returns the name that SDK file should have in the staging location.
Args:
sdk_location: Full path to SDK file.
"""
if sdk_location.endswith('.whl'):
_, wheel_filename = FileSystems.split(sdk_location)
if wheel_filename.startswith('apache_beam'):
return wheel_filename
else:
raise RuntimeError('Unrecognized SDK wheel file: %s' % sdk_location)
else:
return names.STAGED_SDK_SOURCES_FILENAME
@staticmethod
def _create_beam_sdk(
sdk_remote_location,
temp_dir) -> list[beam_runner_api_pb2.ArtifactInformation]:
"""Creates a Beam SDK file with the appropriate version.
Args:
sdk_remote_location: A URL from which the file can be downloaded or a
remote file location. The SDK file can be a tarball or a wheel.
temp_dir: path to temporary location where the file should be
downloaded.
Returns:
A list of ArtifactInformation of local files path and SDK files that
will be staged to the staging location.View on GitHub (pinned to 12126d8942)