microsoft/semantic-kernel · error · FunctionExecutionException
Error running OpenAPI operation: {operation.id}
Error message
Error running OpenAPI operation: {operation.id} What it means
The inner executor wraps `await runner.run_operation(...)` in a try/except: any exception while actually running the REST operation (URL building, payload building, transport) is logged with `exc_info=True` and re-raised as `FunctionExecutionException` keyed on `operation.id`. The original traceback is preserved via `from e` and is in the logs.
Source
Thrown at python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py:172
f"`{parameter.name}` parameter of the `{plugin_name}.{operation.id}` REST function."
)
options = RestApiRunOptions(
server_url_override=(
execution_parameters.server_url_override
if execution_parameters and execution_parameters.server_url_override is not None
else None
),
api_host_url=Uri(document_uri).get_left_part() if document_uri is not None else None,
timeout=execution_parameters.timeout
if execution_parameters and execution_parameters.timeout is not None
else None,
)
return await runner.run_operation(operation, kernel_arguments, options)
except Exception as e:
logger.error(f"Error running OpenAPI operation: {operation.id}", exc_info=True)
raise FunctionExecutionException(f"Error running OpenAPI operation: {operation.id}") from e
parameters: list[KernelParameterMetadata] = [
KernelParameterMetadata(
name=p.alternative_name or p.name,
description=f"{p.description or p.name}",
default_value=p.default_value or "",
is_required=p.is_required,
type_=p.type if p.type is not None else TYPE_MAPPING.get(p.type, "object"),
schema_data=(
p.schema
if p.schema is not None and isinstance(p.schema, dict)
else {"type": f"{p.type}"}
if p.type
else None
),
)
for p in rest_operation_params
]View on GitHub (pinned to c028a0c7dc)
Solutions
- Inspect logs (the `logger.error(..., exc_info=True)` line) to see the underlying exception.
- If it is an SSRF rejection, ensure the resolved URL matches `server_url_validation_allowed_base_urls`.
- If it is network/timeout, raise `timeout` in `OpenAPIFunctionExecutionParameters` or fix connectivity.
- If it is auth, verify the `auth_callback` returns valid credentials.
- Reproduce with a direct `runner.run_operation` call to bypass the wrapper and see the raw error.
Example fix
# before
result = await kernel.invoke(op, KernelArguments(id=1)) # raises 1488
# after: surface the root cause
import logging
logging.getLogger("semantic_kernel.connectors.openapi_plugin").setLevel(logging.DEBUG)
# then re-run; the exc_info traceback shows the real failure (network / SSRF / auth) Defensive patterns
Strategy: retry
Validate before calling
# pre-flight: ensure URL will validate and network is reachable
from semantic_kernel.connectors.openapi_plugin.server_url_validator import (
validate_server_url, ServerUrlValidationOptions,
)
await validate_server_url(resolved_url, options) Try / catch
from semantic_kernel.exceptions import FunctionExecutionException
import logging
logging.getLogger("semantic_kernel.connectors.openapi_plugin").setLevel(logging.DEBUG)
try:
result = await kernel.invoke(rest_fn, KernelArguments(**kwargs))
except FunctionExecutionException as e:
if "Error running OpenAPI operation" in str(e):
# consult logs for exc_info root cause before deciding to retry
raise
raise Prevention
- Enable DEBUG logging on the openapi_plugin logger to capture `exc_info`.
- Set a sensible `timeout` in execution parameters.
- Configure `server_url_validation_allowed_base_urls` to match your API.
- Reproduce failures via `runner.run_operation` to bypass the wrapper.
When it happens
Trigger: Runtime failures during invocation: network/HTTP errors, server-URL validation rejection (SSRF guard), payload build failures, timeout, auth callback errors, or response handling errors — all surface as this wrapper for the given operation.
Common situations: The target API is unreachable or returns errors; SSRF guard rejects the resolved URL; the auth callback throws; a timeout is hit; the response cannot be parsed. The message identifies the operation but the cause is in logs.
Related errors
- Payload can't be built dynamically due to the missing payloa
- No payload is provided by the argument '{self.payload_argume
- No argument is found for the '{property_metadata.name}' payl
- Agent Failure - Run terminated: {run.Status} [{run.Id}]: {ru
- Agent Failure - Run not created for thread: ${threadId}
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/88146ffcb5e6a478.
Report an issue: GitHub.