langflow-ai/langflow · error · HTTPException

Unexpected result while {operation} ({provider_label}): {det

Error message

Unexpected result while {operation} ({provider_label}): {detail}

What it means

500 from BaseDeploymentMapper.parse_adapter_slot when slot.parse(raw) raises AdapterPayloadValidationError — the provider/adapter payload is present but fails schema validation. The first validation error (exc.format_first_error()) is included in the client-facing detail, and the full detail plus slot/provider are logged. Internal contract violation between adapter and mapper, not user input.

Source

Thrown at src/backend/base/langflow/api/v1/mappers/deployments/base.py:948

        See ``parse_api_request_slot`` for user-supplied input.
        """
        provider_label = self.get_provider_label()
        if slot is None:
            logger.error("Payload slot '%s' is not configured for %s", slot_name, provider_label)
            msg = f"The {provider_label} integration is not configured for {operation}."
            raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=msg)
        try:
            return slot.parse(raw)
        except AdapterPayloadMissingError as exc:
            logger.error("Empty adapter payload for slot '%s' (%s)", slot_name, provider_label)
            raise HTTPException(
                status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
                detail=f"Empty result while {operation} ({provider_label}).",
            ) from exc
        except AdapterPayloadValidationError as exc:
            detail = exc.format_first_error()
            logger.error("Invalid adapter payload for slot '%s' (%s): %s", slot_name, provider_label, detail)
            raise HTTPException(
                status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
                detail=f"Unexpected result while {operation} ({provider_label}): {detail}",
            ) from exc

    def parse_api_request_slot(
        self,
        *,
        slot: PayloadSlot[Any] | None,
        slot_name: str,
        raw: Any,
        outer_payload: Any | None = None,
    ) -> Any:
        """Parse a user-supplied API payload, raising 422 on failure.

        Use for data sent **by** the user in the API request (inbound).
        Failures are input errors — the user can fix them.
        ``slot_name`` is logged for debugging but not exposed to the user.
        See ``parse_adapter_slot`` for adapter-boundary payloads.

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Read the surfaced detail — it names the first failing field/constraint
  2. Compare the provider's current API responses against the adapter's slot schema (server log has full detail)
  3. Pin or downgrade the provider API version if it changed, or update the adapter models
  4. Capture the raw payload via logging and validate it offline against the slot model
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = await provider_deployment_call(client, ...)
except httpx.HTTPStatusError as e:
    if e.response.status_code == 500 and "Unexpected result while" in e.response.json()["detail"]:
        log_and_report(e.response.json()["detail"])  # names the failing field — no retry helps
    raise

Prevention

When it happens

Trigger: Provider API changed a field type/shape (e.g. status now numeric, dates renamed) so the mapped payload no longer validates; adapter bug producing wrong types; partial serialization of a nested object.

Common situations: Provider API version bump breaking the adapter's Pydantic models; provider returning localized/alternate enum values the slot does not accept.

Related errors


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