{"record":{"id":"88146ffcb5e6a478","repo":"microsoft/semantic-kernel","slug":"error-running-openapi-operation-operation-id","errorCode":null,"errorMessage":"Error running OpenAPI operation: {operation.id}","messagePattern":"Error running OpenAPI operation: (.+?)","errorType":"exception","errorClass":"FunctionExecutionException","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py","lineNumber":172,"sourceCode":"                        f\"`{parameter.name}` parameter of the `{plugin_name}.{operation.id}` REST function.\"\n                    )\n\n            options = RestApiRunOptions(\n                server_url_override=(\n                    execution_parameters.server_url_override\n                    if execution_parameters and execution_parameters.server_url_override is not None\n                    else None\n                ),\n                api_host_url=Uri(document_uri).get_left_part() if document_uri is not None else None,\n                timeout=execution_parameters.timeout\n                if execution_parameters and execution_parameters.timeout is not None\n                else None,\n            )\n\n            return await runner.run_operation(operation, kernel_arguments, options)\n        except Exception as e:\n            logger.error(f\"Error running OpenAPI operation: {operation.id}\", exc_info=True)\n            raise FunctionExecutionException(f\"Error running OpenAPI operation: {operation.id}\") from e\n\n    parameters: list[KernelParameterMetadata] = [\n        KernelParameterMetadata(\n            name=p.alternative_name or p.name,\n            description=f\"{p.description or p.name}\",\n            default_value=p.default_value or \"\",\n            is_required=p.is_required,\n            type_=p.type if p.type is not None else TYPE_MAPPING.get(p.type, \"object\"),\n            schema_data=(\n                p.schema\n                if p.schema is not None and isinstance(p.schema, dict)\n                else {\"type\": f\"{p.type}\"}\n                if p.type\n                else None\n            ),\n        )\n        for p in rest_operation_params\n    ]","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/openapi_plugin/openapi_manager.py#L154-L190","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\nresult = await kernel.invoke(op, KernelArguments(id=1))  # raises 1488\n\n# after: surface the root cause\nimport logging\nlogging.getLogger(\"semantic_kernel.connectors.openapi_plugin\").setLevel(logging.DEBUG)\n# then re-run; the exc_info traceback shows the real failure (network / SSRF / auth)","handlingStrategy":"retry","validationCode":"# pre-flight: ensure URL will validate and network is reachable\nfrom semantic_kernel.connectors.openapi_plugin.server_url_validator import (\n    validate_server_url, ServerUrlValidationOptions,\n)\nawait validate_server_url(resolved_url, options)","typeGuard":null,"tryCatchPattern":"from semantic_kernel.exceptions import FunctionExecutionException\nimport logging\nlogging.getLogger(\"semantic_kernel.connectors.openapi_plugin\").setLevel(logging.DEBUG)\n\ntry:\n    result = await kernel.invoke(rest_fn, KernelArguments(**kwargs))\nexcept FunctionExecutionException as e:\n    if \"Error running OpenAPI operation\" in str(e):\n        # consult logs for exc_info root cause before deciding to retry\n        raise\n    raise","preventionTips":["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."],"tags":["openapi-plugin","runtime","network","semantic-kernel"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}