Troubleshooting of Google Vertex AI Search: Difference between revisions

Jump to navigation Jump to search
Line 135: Line 135:
# Increase the delay time with each failed retry (e.g., 2 seconds, 4 seconds, 8 seconds, etc.)
# Increase the delay time with each failed retry (e.g., 2 seconds, 4 seconds, 8 seconds, etc.)
# Continue retrying until the request succeeds or maximum retry count is reached
# Continue retrying until the request succeeds or maximum retry count is reached
=== Troubleshooting: Vertex AI Search: Engine Not Found Error ===
'''Error:'''
When using Vertex AI Search API, encountering a 404 error:
<pre>
{
  "error": {
    "code": 404,
    "message": "Engine projects/<YOUR_PROJECT_ID>/locations/global/collections/default_collection/engines/<YOUR_APP_ID> not found.",
    "status": "NOT_FOUND"
  }
}
</pre>
Solution:
1. Verify the correct APP ID (Engine ID):
Open your browser and replace [YOUR_APP_ID] in the URL with the actual APP ID:
<pre>
https://console.cloud.google.com/gen-app-builder/locations/global/engines/<YOUR_APP_ID>/overview
</pre>
2. Update the app_id in your code:
3. Validate the API endpoint: Ensure the curl request uses the correct engine ID:
<pre>
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1alpha/projects/<YOUR_PROJECT_ID>/locations/global/collections/default_collection/engines/<YOUR_APP_ID>/servingConfigs/default_search:search" \
-d '{"query":"<QUERY>","pageSize":10,"queryExpansionSpec":{"condition":"AUTO"},"spellCorrectionSpec":{"mode":"AUTO"},"languageCode":"zh-TW","userInfo":{"timeZone":"Asia/Taipei"}}'
</pre>


== Related Pages ==
== Related Pages ==

Navigation menu