You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I execute this (simplified) code in a container running in Google Cloud Run Job:
importcryptofrom'crypto';import{GoogleAIFileManager}from"@google/generative-ai/server";constgeminiApiKey=process.env.GEMINI_API_KEYasstring;constfileManager=newGoogleAIFileManager(geminiApiKey);// If the URL is repeated, the fileHash will be the sameconsturl="https://exampleUrl.com"constfileHash=crypto.createHash('md5').update(url).digest('hex');// Check if the image is already uploadedtry{constexistingFile=awaitfileManager.getFile(fileHash);}catch(error){console.error(error)}
I get this error:
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/files/<<myUri>>: [403 Forbidden] You do not have permission to access the File <<myUri>> or it may not exist.
My Cloud Run Job is running using a Service Account that has the role "aiplatform.admin".
Actual vs expected behavior:
Actual behavior: I get an error.
Expected behavior: Get the image file object when i call the getFile method.
Any other information you'd like to share?
No response
The text was updated successfully, but these errors were encountered:
navarrodiego
changed the title
fileManager.getFile gives 403 Forbidden Error even with permission on service account
getFile method gives 403 Forbidden Error even with permission on service account
Aug 23, 2024
Description of the bug:
When I execute this (simplified) code in a container running in Google Cloud Run Job:
I get this error:
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/files/<<myUri>>: [403 Forbidden] You do not have permission to access the File <<myUri>> or it may not exist.
My Cloud Run Job is running using a Service Account that has the role "aiplatform.admin".
Actual vs expected behavior:
Actual behavior: I get an error.
Expected behavior: Get the image file object when i call the getFile method.
Any other information you'd like to share?
No response
The text was updated successfully, but these errors were encountered: