{"record":{"id":"1aea50e04acc9a56","repo":"apache/beam","slug":"could-not-process-the-expansion-request-request","errorCode":null,"errorMessage":"Could not process the expansion request: + request","messagePattern":"Could not process the expansion request: \\+ request","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/transform-service/src/main/java/org/apache/beam/sdk/transformservice/ExpansionService.java","lineNumber":205,"sourceCode":"            expansionServiceClientFactory.getExpansionServiceClient(endpoint).expand(request);\n        if (!response.getError().isEmpty()) {\n          errorResponses.put(endpoint.getUrl(), response);\n          continue;\n        }\n        return response;\n      } catch (RuntimeException e) {\n        lastException = e;\n      }\n    }\n    if (lastException != null) {\n      throw new RuntimeException(\"Expansion request to transform service failed.\", lastException);\n    }\n    if (!errorResponses.isEmpty()) {\n      return getAggregatedErrorResponse(errorResponses);\n    } else if (lastException != null) {\n      throw new RuntimeException(\"Expansion request to transform service failed.\", lastException);\n    } else {\n      throw new RuntimeException(\"Could not process the expansion request: \" + request);\n    }\n  }\n\n  ExpansionApi.DiscoverSchemaTransformResponse processDiscover(\n      ExpansionApi.DiscoverSchemaTransformRequest request) {\n    // Trying out expansion services and aggregating all successful results.\n    // If all services fail, return the last successful response any.\n    // If there are no successful responses, re-raises the last error.\n    List<ExpansionApi.DiscoverSchemaTransformResponse> successfulResponses = new ArrayList<>();\n    ExpansionApi.DiscoverSchemaTransformResponse lastErrorResponse = null;\n    for (Endpoints.ApiServiceDescriptor endpoint : endpoints) {\n      try {\n        ExpansionApi.DiscoverSchemaTransformResponse response =\n            expansionServiceClientFactory.getExpansionServiceClient(endpoint).discover(request);\n        if (response.getError().isEmpty()) {\n          successfulResponses.add(response);\n        } else {\n          lastErrorResponse = response;","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/transform-service/src/main/java/org/apache/beam/sdk/transformservice/ExpansionService.java#L187-L223","documentation":"Final fallback in ExpansionService.processExpand: thrown when no expansion service attempt threw an exception, yet none produced a usable expansion response, and no aggregated error response was assembled. Indicates the request was never successfully processed but the failure mode is unknown.","triggerScenarios":"processExpand loops over all configured expansion services, each returns without exception but without a valid expansion (e.g. empty/unmatched response), leaving errorResponses empty and lastException null.","commonSituations":"Malformed request built by the client; service silently returning an empty result; config pointing at services that do not recognize the transform URN.","solutions":["Check the message's request dump for the transform URN and payload being requested.","Verify the transform URN/schema is supported by the configured expansion services.","Confirm the expansion services in the config are the correct ones for the transform being expanded.","Enable debug logging on the ExpansionService client to see individual service responses."],"exampleFix":"// before\nthrow new RuntimeException(\"Could not process the expansion request: \" + request);\n// after\nthrow new RuntimeException(\n    \"No expansion service could process the request (urn=\" + request + \"). \"\n    + \"Check that the configured services support this transform.\");","handlingStrategy":"validation","validationCode":"// validate the transform URN is one your expansion services support before expanding\nSet<String> supported = Set.of(\"beam:schematransform:...\", ...);\nif (!supported.contains(transformUrn)) {\n  throw new IllegalArgumentException(\"Unsupported transform URN: \" + transformUrn);\n}","typeGuard":null,"tryCatchPattern":"try {\n  expansionResult = expansionService.expand(request);\n} catch (RuntimeException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Could not process the expansion request\")) {\n    LOG.error(\"No expansion service recognized the request: {}\", request);\n  }\n  throw e;\n}","preventionTips":["Confirm the configured expansion services actually register the transforms you use.","Log the full expansion request to diagnose unsupported URNs.","Point the config at the correct service(s) for your transform family."],"tags":["java","grpc","expansion-service"],"backgroundTag":"unexpected-api-response-shape","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"}