-
Notifications
You must be signed in to change notification settings - Fork 96
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
See build log in PR googleapis/gapic-generator-python#2361 which fails with the following stack trace.
if self._exception is not None:
# pylint: disable=raising-bad-type
# Pylint doesn't recognize that this is valid in this case.
> raise self._exception
E google.api_core.exceptions.GoogleAPICallError: None Unexpected state: Long-running operation had neither response nor error set.
FAILED tests/system/test_lro.py::test_lro_no_result[grpc] - google.api_core.exceptions.GoogleAPICallError: None Unexpected state: Long-running operation had neither response nor error set.
FAILED tests/system/test_lro.py::test_lro_no_result[rest] - google.api_core.exceptions.GoogleAPICallError: None Unexpected state: Long-running operation had neither response nor error set.
FAILED tests/system/test_lro.py::test_lro_async_no_result[grpc_asyncio] - google.api_core.exceptions.GoogleAPICallError: None Unexpected state: Long-running operation had neither response nor error set.
This error happens when the LRO response does not contain a result. For example, see the response below when running showcase.
2025/03/13 23:49:19 Received Unary Request for Method: /google.longrunning.Operations/GetOperation
2025/03/13 23:49:19 Request: name:"operations/google.showcase.v1beta1.Echo/Wait/CgwI/t3NvgYQyJqJpgM="
2025/03/13 23:49:19 Returning Response: name:"operations/google.showcase.v1beta1.Echo/Wait/CgwI/t3NvgYQyJqJpgM=" done:true
2025/03/13 23:49:19
name and done are set but there is no result. In other words, neither error nor response is set.
Some services might not provide the result.
When services don't provide a result, the response should be None instead of the exception Unexpected state: Long-running operation had neither response nor error set.
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.