{"record":{"id":"6d574b42c8b2050f","repo":"langflow-ai/langflow","slug":"missing-deployment-name-while-shaping-wxo-deployme","errorCode":null,"errorMessage":"Missing deployment name while shaping wxO deployment metadata.","messagePattern":"Missing deployment name while shaping wxO deployment metadata\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/mapper.py","lineNumber":1525,"sourceCode":"            \"created_at\": item.created_at,\n            \"updated_at\": item.updated_at,\n        }\n\n    def shape_deployment_get_data(\n        self,\n        provider_data: AdapterPayload | None,\n        *,\n        name: str | None = None,\n    ) -> dict[str, Any] | None:\n        parsed = self.parse_adapter_slot(\n            slot=WXO_ADAPTER_PAYLOAD_SCHEMAS.deployment_item_data,\n            slot_name=\"deployment_item_data\",\n            raw=provider_data,\n            operation=\"reading deployment metadata\",\n        )\n        if name is None:\n            msg = \"Missing deployment name while shaping wxO deployment metadata.\"\n            raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=msg)\n        return WatsonxApiDeploymentGetProviderData(\n            llm=parsed.llm,\n            name=name,\n            display_name=parsed.display_name,\n            environments=parsed.environments,\n        ).model_dump(mode=\"json\")\n\n    def shape_config_item_data(self, provider_data: dict[str, Any]) -> WatsonxApiConfigListItem:\n        return self.parse_adapter_slot(\n            slot=self.api_payloads.config_item_data,\n            slot_name=\"config_item_data\",\n            raw=provider_data,\n            operation=\"reading the configuration\",\n        )\n\n    def _to_bind_provider_operation(self, *, raw_name: str, app_ids: list[str]) -> AdapterPayload:\n        return {\n            \"op\": \"bind\",","sourceCodeStart":1507,"sourceCodeEnd":1543,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/mapper.py#L1507-L1543","documentation":"Raised by WatsonxOrchestrateMapper.shape_deployment_get_data when the caller does not pass a deployment name while building the GET /deployments/{id} response for a watsonx_orchestrate deployment. The name is a required field of WatsonxApiDeploymentGetProviderData, so the mapper refuses to shape metadata without it and returns HTTP 500. It is an internal invariant violation (caller-side bug or a deployment row lacking a name), not a client payload problem.","triggerScenarios":"GET a watsonx_orchestrate deployment whose route handler calls shape_deployment_get_data(provider_data, name=None) — e.g. the deployment DB row or adapter item has no name, or a new call path forgets to forward the name kwarg.","commonSituations":"Extending the deployments API and adding a new caller of shape_deployment_get_data without passing name; a deployment record created by an older version or by direct DB insert where the name column is NULL; adapter list/get responses that omit the name field.","solutions":["Check the deployment DB row / adapter response that produced the request and confirm the deployment actually has a name; if NULL, fix the data or re-create the deployment through the API.","If you are calling shape_deployment_get_data from your own code, always pass a non-None name (e.g. name=item.name or deployment.name).","If the name legitimately comes from the provider response and can be absent, decide on a fallback (use id) or surface a 404 instead — but as shipped, a 500 here means the caller contract was broken.","Report as a Langflow bug if it occurs on a stock GET /api/v1/deployments/{id} with a normally-created wxO deployment."],"exampleFix":"// before\nawait mapper.shape_deployment_get_data(provider_data)  # name defaults to None -> 500\n# after\nawait mapper.shape_deployment_get_data(provider_data, name=deployment.name)","handlingStrategy":"validation","validationCode":"// caller of shape_deployment_get_data\nif name is None or not name.strip():\n    raise ValueError(\"deployment name is required before shaping wxO GET data\")\ndata = mapper.shape_deployment_get_data(provider_data, name=name)","typeGuard":"def has_deployment_name(item: object) -> bool:\n    return isinstance(getattr(item, \"name\", None), str) and bool(item.name.strip())","tryCatchPattern":"try:\n    data = mapper.shape_deployment_get_data(provider_data, name=name)\nexcept HTTPException as e:\n    if e.status_code == 500 and \"Missing deployment name\" in e.detail:\n        log.error(\"deployment %s has no name; data integrity issue\", deployment_id)\n    raise","preventionTips":["Always pass a validated non-empty name kwarg when shaping wxO deployment GET data.","Enforce NOT NULL on deployment name at creation time so rows never lack a name.","Add a regression test asserting every route that reads a wxO deployment forwards the name."],"tags":["watsonx-orchestrate","deployments","http-500","invariant"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}