langflow-ai/langflow · error · HTTPException

Cannot resolve provider snapshot ids for flow_version_ids in

Error message

Cannot resolve provider snapshot ids for flow_version_ids in watsonx operations: [{flow_version_id}]

What it means

Raised while translating an upsert_flows item during watsonx_orchestrate deployment update. When the item carries remove_app_ids, the mapper must convert existing provider tools to remove-operations, which requires a provider snapshot id looked up from the deployment's flow-version attachments. If flow_version_id is not in flow_version_snapshot_id_map, the id cannot be resolved and HTTP 422 is returned. The flow version was never deployed/snapshotted for this deployment.

Source

Thrown at src/backend/base/langflow/api/v1/mappers/deployments/watsonx_orchestrate/mapper.py:1691

                if item.tool_display_name:
                    provider_operations.append(
                        {
                            "op": "rename_tool",
                            "tool": {
                                "source_ref": str(flow_version_id),
                                "tool_id": existing_tool_id,
                            },
                            "tool_display_name": item.tool_display_name,
                        }
                    )
                continue

            if item.remove_app_ids:
                msg = (
                    "Cannot resolve provider snapshot ids for flow_version_ids "
                    f"in watsonx operations: [{flow_version_id}]"
                )
                raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail=msg)
            flow_tool = self._get_flow_tool_payload(
                flow_tool_by_flow_version_id=flow_tool_by_flow_version_id,
                flow_version_id=flow_version_id,
                field_name="upsert_flows item flow_version_id",
            )
            if item.add_app_ids:
                provider_operations.append(
                    self._to_bind_provider_operation(
                        raw_name=flow_tool["raw_name"],
                        app_ids=item.add_app_ids,
                    )
                )

        # Update flow removals.
        for flow_version_id in remove_flows:
            if flow_version_snapshot_id_map is None or flow_version_id not in flow_version_snapshot_id_map:
                msg = (
                    "Cannot resolve provider snapshot ids for flow_version_ids "

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Verify each upsert_flows[].flow_version_id is actually attached to this deployment and was previously deployed to wxO (has a provider_snapshot_id in the deployment attachments).
  2. Re-run the deployment update that pushes the flow (add_flows) so a snapshot id gets recorded, then retry the remove operation.
  3. If the flow version genuinely has no provider tool yet, drop the remove_app_ids from that item — there is nothing to remove.
  4. Check server logs / authz_deployment_tool table for missing or empty provider_snapshot_id values on the deployment's attachments.

Example fix

// before
{"upsert_flows": [{"flow_version_id": "<uuid-not-yet-deployed>", "remove_app_ids": ["app1"]}]}
// after
{"upsert_flows": [{"flow_version_id": "<uuid-deployed-with-snapshot>", "remove_app_ids": ["app1"]}]}
Defensive patterns

Strategy: validation

Validate before calling

# before sending upsert_flows with remove_app_ids
snapshotted = {str(a.flow_version_id) for a in (await get_deployment(deployment_id)).flow_attachments if a.provider_snapshot_id}
for item in payload.upsert_flows:
    if item.remove_app_ids and str(item.flow_version_id) not in snapshotted:
        item.remove_app_ids = []  # nothing deployed to unbind yet

Type guard

def is_snapshotted(item, snapshotted_ids: set[str]) -> bool:
    return str(item.flow_version_id) in snapshotted_ids

Try / catch

try:
    resp = await client.patch(f"/api/v1/deployments/{id}", json=body)
except HTTPError as e:
    if e.response.status_code == 422 and "Cannot resolve provider snapshot ids" in e.response.text:
        snapshotted = await fetch_snapshotted_flow_versions(id)
        body = prune_unresolvable(body, snapshotted)
    raise

Prevention

When it happens

Trigger: PATCH/PUT a wxO deployment with provider_data.upsert_flows[] where an item has remove_app_ids (or otherwise needs existing tool resolution) and its flow_version_id has no provider_snapshot_id attachment row for that deployment.

Common situations: Referencing a flow version that was added to the deployment but never successfully pushed to wxO (partial create); using a flow_version_id from a different deployment; stale client state after the deployment was recreated; attachments whose provider_snapshot_id is blank.

Related errors


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/bc7d22e47eb8adc7. Report an issue: GitHub.