googleapis / googleapis/python-aiplatform
vertexai.preview.rag.retrieval_query() raises error
- Dominant language
- Python
- Stars
- 905
- Forks
- 465
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 44
Description
Hello,
I'm encountering an issue with my Vertex AI RAG retrieval query. It was functioning correctly previously, but now I'm receiving an "InternalServerError: 500 Failed to search for project xxxx" error.
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/google/api_core/grpc_helpers.py", line 76, in error_remapped_callable
return callable_(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/grpc/_channel.py", line 1181, in __call__
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/grpc/_channel.py", line 1006, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Failed to search for project xxxx"
debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2a00:1450:400e:805::200a%5D:443 {created_time:"2025-03-04T15:22:45.964149653+01:00", grpc_status:13, grpc_message:"Failed to search for project xxxx"}"
>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/vertexai/preview/rag/rag_retrieval.py", line 133, in retrieval_query
response = client.retrieve_contexts(request=request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/client.py", line 833, in retrieve_contexts
response = rpc(
^^^^
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/google/api_core/gapic_v1/method.py", line 131, in __call__
return wrapped_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/google/api_core/grpc_helpers.py", line 78, in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
google.api_core.exceptions.InternalServerError: 500 Failed to search for project xxxx
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/user/gitlab/datascience-chatbot/vertex/gemini_only_query.py", line 11, in
response = rag.retrieval_query(
^^^^^^^^^^^^^^^^^^^^
File "/home/user/.pyenv/versions/gemini/lib/python3.12/site-packages/vertexai/preview/rag/rag_retrieval.py", line 135, in retrieval_query
raise RuntimeError("Failed in retrieving contexts due to: ", e) from e
RuntimeError: ('Failed in retrieving contexts due to: ', InternalServerError('Failed to search for project xxxx'))
```
I have not made any changes to the code, RAG configuration, or IAM permissions.
Could you please provide guidance on troubleshooting this error? I need to identify the root cause of the retrieval failure.
Specifically, I would like to know:
How to access detailed logs for the RAG retrieval process.
Where to check the status of my RAG corpus.
Any known recent issues with Vertex AI RAG that may be causing this.
Thank you for your assistance.
Contributor guide
Research direction
Start with the reported entry point in vertexai/preview/rag/rag_retrieval.py, especially retrieval_query, and reproduce the InternalServerError using the traceback details. Check the RAG corpus status and available retrieval logs; the issue is done when the failure has a confirmed root cause and a documented troubleshooting path or an identified SDK change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, python
- Domain
- cloud, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 22/100