503 error with File search tool from gemini

I keep getting this error whenever I try to upload a file to the file store:

503 - “{\n \“error\”: {\n \“code\”: 503,\n \“message\”: \“Failed to count tokens.\”,\n \“status\”: \“UNAVAILABLE\”\n }\n}\n”

2 Likes

Hi @Hiba_Ghrab
The 503 status code generally indicates a temporary server issue. Can you confirm if this error is still occurring?
Also, I was able to successfully run the doc code example here: [https://ai.google.dev/gemini-api/docs/file-search#upload]. Please let me know if the issue persists.

Yes, it’s still happening with specific PDFs