{"record":{"id":"c44120bd211960b6","repo":"apache/beam","slug":"the-sdk-location-option-was-used-with-an-unsupported-type-of","errorCode":null,"errorMessage":"The --sdk_location option was used with an unsupported type of location: %s","messagePattern":"The --sdk_location option was used with an unsupported type of location: (.+?)","errorType":"validation","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/runners/portability/stager.py","lineNumber":338,"sourceCode":"                  file, os.path.basename(file)))\n\n      # Handle extra local packages that should be staged.\n      if setup_options.extra_packages is not None:\n        resources.extend(\n            Stager._create_extra_packages(\n                setup_options.extra_packages, temp_dir=temp_dir))\n\n      if hasattr(setup_options, 'sdk_location'):\n        sdk_location = setup_options.sdk_location\n        if Stager._is_remote_path(sdk_location):\n          try:\n            resources.extend(\n                Stager._create_beam_sdk(\n                    sdk_remote_location=setup_options.sdk_location,\n                    temp_dir=temp_dir,\n                ))\n          except:\n            raise RuntimeError(\n                'The --sdk_location option was used with an unsupported '\n                'type of location: %s' % sdk_location)\n\n        elif sdk_location == 'default':\n          # Use default location for a runner.\n          pass\n        elif sdk_location == 'container':\n          # Used in the past to indicate that SDK should be used from container\n          # image instead of being staged.\n          # Equivalent to 'default' now, leaving for backwards compatibility.\n          pass\n        else:\n          if os.path.isdir(setup_options.sdk_location):\n            sdk_path = os.path.join(\n                setup_options.sdk_location, names.STAGED_SDK_SOURCES_FILENAME)\n          else:\n            sdk_path = setup_options.sdk_location\n","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/runners/portability/stager.py#L320-L356","documentation":"create_job_resources wraps any failure to build or fetch an SDK tarball from --sdk_location in this RuntimeError, so the unsupported-location message can mask the underlying exception (the bare except re-raises with no chaining). The location was neither a local file, a supported remote URL, nor 'default'.","triggerScenarios":"--sdk_location set to a value that _create_beam_sdk cannot handle (bad scheme, unreachable URL, corrupt remote path) causing an exception inside the try block.","commonSituations":"Typo in a gs:// or https:// SDK location; pointing at a directory rather than a tarball; network failure downloading the SDK; using an SDK location scheme not supported by the filesystems installed.","solutions":["Print/inspect the chained failure: run with sdk_location temporarily set to a valid local tarball to isolate the cause","Set --sdk_location to a valid value: 'default', an empty string (skip staging), a local .tar.gz path, or a reachable https:// URL to a Beam SDK tarball","Verify the URL is downloadable (curl -I) and names a Beam SDK tar.gz","Check that required Beam filesystem plugins/dependencies (e.g. gcsfs) are installed if using a remote scheme"],"exampleFix":"// before\n--sdk_location=gs://my-bucket/sdks/  (directory, not a tarball)\n// after\n--sdk_location=gs://my-bucket/sdks/apache_beam-2.60.0.tar.gz","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    Stager.create_and_stage_job_resources(setup_options)\nexcept RuntimeError as e:\n    if 'unsupported type of location' in str(e):\n        logging.warning('sdk_location rejected; retrying with default', exc_info=True)\n        setup_options.sdk_location = 'default'\n        Stager.create_and_stage_job_resources(setup_options)\n    else:\n        raise","preventionTips":["Test the sdk_location URL with curl -I before submitting","Prefer 'default' or an explicit local tarball path","Install filesystem extras (apache_beam[gcp]) for remote schemes"],"tags":["python","cli","config","sdk-staging","beam"],"backgroundTag":"invalid-config-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}