{"record":{"id":"43af2c5fc608f438","repo":"apache/beam","slug":"no-expansion-service-was-specified-and-could-not-find-a","errorCode":null,"errorMessage":"No expansion service was specified and could not find a default expansion service for %s: '%s'.","messagePattern":"No expansion service was specified and could not find a default expansion service for (.+?): '(.+?)'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/transforms/managed.py","lineNumber":214,"sourceCode":"        config_url=self._config_url)\n\n  def default_label(self) -> str:\n    return \"Managed Write(%s)\" % self._sink.upper()\n\n\ndef _resolve_expansion_service(\n    transform_name: str,\n    identifier: str,\n    expansion_service,\n    pipeline_options=None):\n  if expansion_service:\n    return expansion_service\n\n  gradle_target = None\n  if identifier in MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING:\n    gradle_target = MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING.get(identifier)\n  if not gradle_target:\n    raise ValueError(\n        \"No expansion service was specified and could not find a \"\n        f\"default expansion service for {transform_name}: '{identifier}'.\")\n\n  # Extract maven_repository_url and user_agent from pipeline options if\n  # available\n  maven_repository_url = None\n  user_agent = None\n  if pipeline_options:\n    from apache_beam.options import pipeline_options as po\n    setup_options = pipeline_options.view_as(po.SetupOptions)\n    maven_repository_url = setup_options.maven_repository_url\n    user_agent = setup_options.user_agent\n\n  return BeamJarExpansionService(\n      gradle_target,\n      maven_repository_url=maven_repository_url,\n      user_agent=user_agent)\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/transforms/managed.py#L196-L232","documentation":"Managed transforms run via a Java expansion service. If the user did not pass an expansion_service and no default JAR target exists for the transform identifier, this ValueError is raised because Beam cannot start a service to expand the transform.","triggerScenarios":"Running a managed transform (e.g. Read/Write) whose identifier is missing from MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING while expansion_service=None, typically on an old Beam version or a custom transform.","commonSituations":"Using a Beam version where the requested managed transform has no prebuilt expansion service jar; custom expansion environments without the default Maven repository; running with a pipeline option misconfiguration.","solutions":["Pass an explicit expansion_service argument pointing to your running expansion service address.","Upgrade apache_beam so a default expansion service jar target exists for the transform.","Verify MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING includes your transform's identifier."],"exampleFix":"// before\nbeam.managed.Write('iceberg')\n// after\nbeam.managed.Write('iceberg', expansion_service='localhost:8099')","handlingStrategy":"validation","validationCode":"from apache_beam.transforms.managed import MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING\nidentifier = Write._WRITE_TRANSFORMS.get(sink.lower())\nassert identifier in MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING or expansion_service, \"need expansion_service\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide expansion_service in environments without default jar access","Pin a Beam version known to support your managed transform"],"tags":["python","apache-beam","expansion-service"],"backgroundTag":"missing-dependency","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"}