I have a problem with upsert from google firebase function

The problem is undeterministic. In most cases it doesn’w work, sometimes it does.

I upsert 5 vectors at a time. And here is example of a vector:

id: 'f0b21772-d582-415f-8af3-8d0844cb6165',
values: [ -0.024082549, -0.0092171095, -0.023572724, -0.03410465,...]

And here is my code:

  const indexName = "namespace_name" 
  const projectKey = "projectkey_in_string"
  const namespaceIndex = pineconeClient.Index(indexName).namespace(projectKey);
  const v: {"id": string, "values": number[]}[] = [my vectors]
  namespaceIndex.upsert(v).then(result => {
        console.log("successfully upserted vectors to pinecone")
      }).catch(error => {
        console.log("there was error while upserting vectors")

The problem is that upsert function doesn’t return anything, neither success message, nor error.
After a while Google returns this mesage: Exception from a finished function: Error: 4 DEADLINE_EXCEEDED: Deadline exceeded

My firebase function hase 2000 seconds timeout set, and the last message appears after about 10 minutes.