Guilherme
Guilherme

Reputation: 1990

firebase functions get error stream removed onCreate firestore event

I'm worried about this error on firebase functions,

I have a sendgrid dispatch on this function:

exports.mailDealings = functions.firestore
.document('dealings/current').onCreate(event => {
  // send mail
  const msg = {...}

  sgMail.send(msg);
})
.catch(result => {
  console.error("sendgrid error", result);
});

I was able to execute with success before but on one call, this function give me the error below:

{ Error: Stream removed
    at ClientReadableStream._emitStatusIfDone (/user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:255:19)
    at ClientReadableStream._receiveStatus (/user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:233:8)
    at /user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:705:12 code: 2, metadata: Metadata { _internal_repr: {} } }

There should have an automatic retry for this error, right? Or at least a method for turning this easy, like result.retry(1000)?

Upvotes: 5

Views: 909

Answers (2)

Eric
Eric

Reputation: 111

From the Google Groups discussion on this bug:

Hello all, Sebastian from the Firestore SDK team here. We believe this issue is related to the recent update of the GRPC Client SDK and have been running tests with GRPC 1.7.1. So far, we have not been able to reproduce this issue with this older GRPC version.

@google-cloud/firestore is now at 0.10.1. If you update your dependencies, you will be able to pull in this release.

Thanks for your patience.

Sebastian

This seems to have fixed the issue for me!

Upvotes: 0

Santi Bivacqua
Santi Bivacqua

Reputation: 101

Same problem here (in many functions & randomly) since 3 / 4 days. Apparently t disappears after deploy...for few minutes

Error: Stream removed
at ClientReadableStream._emitStatusIfDone (/user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:255:19)
at ClientReadableStream._receiveStatus (/user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:233:8)
at /user_code/node_modules/firebase-admin/node_modules/grpc/src/client.js:705:12

Upvotes: 2

Related Questions