Unreliability of Gemini API - Error while creating cache

I’m very annoyed with the (un)reliability of the Gemini API which doesn’t allow to build product on top the Gemini. I pay for API access and use the same key for last month.

  • Yesterday I’ve started to see “403 Generative Language API has not been used in project 85461904965 before or it is disabled”. Where “85461904965” is even not my project id
  • Today I can’t create cache “You do not have permission to access the File 8x14z3tlsioa or it may not exist”. While providing the same file “8x14z3tlsioa” directly yo generate_content works just fine.

Dear Gemini team, how is this possible dear? Did you already replaced all your QA with Gemini?

6 Likes

unfortunately, I have had the same two bugs.

even i am seeing this error since last two days.

I am also experiencing this issue

I am having the exact same problem:

“Error creating cache: 403 You do not have permission to access the File 44bccdbje5h1 or it may not exist.”

I’ve been facing the same issue since yesterday. Is there any solution yet?

Yes, this is pretty annoying and came out of blue and we are very much affected with it. Even google’s own cookbooks are giving error when tried. Currently context caching is not usable, and impacting our production deployments.

1 Like

Any solution? I thought I messed up the code or not paying on time.

I got the same error for the context caching, a week ago, it worked fine.

WARNING:tornado.access:403 POST /v1beta/cachedContents?%24alt=json%3Benum-encoding%3Dint (127.0.0.1) 1067.39ms

Forbidden: 403 POST https://generativelanguage.googleapis.com/v1beta/cachedContents?%24alt=json%3Benum-encoding%3Dint: You do not have permission to access the File wcb16pus54ao or it may not exist.
Note: the file wcb16pus54ao is the file that I uploaded to gemini, but why context caching can’t access the file (a week ago it worked fine!!!) ? really very embarrassing
@Logan_Kilpatrick could you please help us find a solution? It is a general bug…

Same experience while trying context caching:

In colab:

Forbidden: 403 POST https://generativelanguage.googleapis.com/v1beta/cachedContents?%24alt=json%3Benum-encoding%3Dint: You do not have permission to access the File euxkungcikji or it may not exist.

In kaggle:

PermissionDenied: 403 You do not have permission to access the File 4uqxjyjk97bc or it may not exist.

Hey everyone, thanks for reporting this issue - I’ve escalated this to our engineering team who are actively looking into this. I’ll post an update as soon as I have more info

3 Likes

Update for my case:

when I use upload_file it doesn’t work

document = genai.upload_file(path="/content/some.txt")

When I use a little function and get the doc it works:

def load_docs(filepath="/content/some.txt"):
    with open(filepath, "r") as f:
        return f.read()
document = load_docs()
model_name = "gemini-1.5-flash-001"
cached = caching.CachedContent.create(
    model=model_name,
    system_instruction="You are...",
    contents=[document]
)
1 Like

Hey! Thanks for this workaround, works well.
Now waiting proper fix from google…

1 Like

Encountered a similar issue when using caching.CachedContent.create: You do not have permission to access the File <name> or it may not exist.

The outage has lasted at least a whole day, unbelievable. Didn’t Google notice a significant drop in traffic for CachedContent.create? Or does it really take them a week to fix this issue?

@Govind_Keshari
Please take a look at this issue.

But we need genai.upload_file(...) to function correctly, as it is crucial for handling large files. Additionally, there is no reason why context caching should not work with it. Please resolve this issue to ensure genai.upload_file(...) operates correctly with context caching and other…@Vishal

Absolutely - we’re working on getting the file uploads fixed in caching.

Thanks @riza_temizel for sharing a workaround while we get this issue fixed.

1 Like

Hey all, quick update - we found the issue and have pushed a fix. I’ll follow up once the fix is live in prod.

Did this issue get fixed and deployed?I’m still getting this error.

Does this work with PDF files? It works perfectly for a txt file.