{"record":{"id":"5044cc60bee77410","repo":"langflow-ai/langflow","slug":"created-snapshot-binding-has-non-uuid-source-ref","errorCode":null,"errorMessage":"Created snapshot binding has non-UUID source_ref={source_ref!r} for tool_id={tool_id!r}.","messagePattern":"Created snapshot binding has non-UUID source_ref=(.+?) for tool_id=(.+?)\\.","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/mapper.py","lineNumber":1807,"sourceCode":"        \"\"\"Map adapter created snapshot bindings to API ``created_tools``.\"\"\"\n        created_tools: list[WatsonxApiCreatedTool] = []\n        for binding in adapter_created_snapshot_bindings:\n            tool_id = str(binding.tool_id or \"\").strip()\n            source_ref = str(binding.source_ref or \"\").strip()\n            if not tool_id or not source_ref:\n                msg = (\n                    f\"Created snapshot binding has empty tool_id={binding.tool_id!r} or \"\n                    f\"source_ref={binding.source_ref!r}; cannot map tool binding.\"\n                )\n                raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=msg)\n            try:\n                created_tool = WatsonxApiCreatedTool(\n                    flow_version_id=source_ref,\n                    tool_id=tool_id,\n                )\n            except ValidationError as exc:\n                msg = f\"Created snapshot binding has non-UUID source_ref={source_ref!r} for tool_id={tool_id!r}.\"\n                raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=msg) from exc\n            created_tools.append(created_tool)\n        return created_tools\n\n    def _dump_key_value_connection_payloads(self, key_value_payloads: list[Any] | None) -> list[dict[str, Any]] | None:\n        if not key_value_payloads:\n            return None\n        normalized: list[dict[str, Any]] = []\n        for payload in key_value_payloads:\n            item: dict[str, Any] = {\"app_id\": payload.app_id}\n            environment_variables = self._to_adapter_environment_variables(payload.credentials)\n            if environment_variables is not None:\n                item[\"environment_variables\"] = environment_variables\n            normalized.append(item)\n        return normalized\n\n    def _to_adapter_environment_variables(self, credentials: list[Any] | None) -> dict[str, dict[str, Any]] | None:\n        if not credentials:\n            return None","sourceCodeStart":1789,"sourceCodeEnd":1825,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/mapper.py#L1789-L1825","documentation":"Companion to the empty-binding check: when mapping adapter created snapshot bindings to WatsonxApiCreatedTool, the source_ref (flow_version_id) must be a UUID. Constructing WatsonxApiCreatedTool with a non-UUID source_ref fails pydantic validation, which the mapper converts to HTTP 500. The adapter returned a binding whose source reference is not a Langflow flow-version UUID.","triggerScenarios":"Adapter returns a created-snapshot binding whose source_ref is e.g. a provider-internal id, a name, or a string in an unexpected format instead of the Langflow flow_version_id that was sent in the create request.","commonSituations":"Adapter version drift where source_ref semantics changed; a custom adapter implementation echoing provider ids instead of the client-supplied flow_version_id; log/mapping refactor in the adapter layer.","solutions":["Inspect the adapter response (server logs) for the created bindings and check what source_ref contains — it must equal the flow_version_id Langflow sent.","Update or align the adapter so created bindings echo back the client flow_version_id unchanged.","If wxO returns its own reference, add the id translation in the adapter before returning bindings to the mapper.","Retry after fixing the adapter; the wxO-side snapshot may need manual cleanup if the tool was created."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"def has_uuid_source_ref(binding) -> bool:\n    try:\n        UUID(str(binding.source_ref))\n        return True\n    except (ValueError, AttributeError, TypeError):\n        return False","tryCatchPattern":"try:\n    created = await client.patch(f\"/api/v1/deployments/{id}\", json=body)\nexcept HTTPError as e:\n    if e.response.status_code == 500 and \"non-UUID source_ref\" in e.response.text:\n        log.error(\"adapter source_ref drift; bindings must echo flow_version_id\")\n    raise","preventionTips":["Adapter contract: created snapshot bindings must echo the client-supplied flow_version_id verbatim.","Add adapter integration tests asserting source_ref parses as UUID.","Treat occurrences as an adapter bug, not a client fix."],"tags":["watsonx-orchestrate","deployments","http-500","uuid","created-tools"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}