firebase-functions: Error at Http2CallStream.call.on on .auth.user().onCreate

Related issues

#536

[REQUIRED] Version info

node: 8.16.0

firebase-functions: ^8.2.0

firebase-tools: 7.2.3

firebase-admin: ^8.2.0

[REQUIRED] Test case

import * as admin from "firebase-admin";
import * as functions from "firebase-functions";
import { onCreateUserListener } from "./user-listeners";

admin.initializeApp(functions.config().firebase);

export const createUserListener = functions.auth.user().onCreate(onCreateUserListener);

/* user-listeners.ts */
export async function onCreateUserListener(user: UserRecord) {
    console.log("creating user", user);
}

[REQUIRED] Steps to reproduce

Don’t know, happens randomly.

[REQUIRED] Expected behavior

The listener is executed when a user is created

[REQUIRED] Actual behavior

Randomly I get the following stack trace

Error
    at Http2CallStream.call.on (/srv/node_modules/@grpc/grpc-js/build/src/client.js:96:45)
    at emitOne (events.js:121:20)
    at Http2CallStream.emit (events.js:211:7)
    at process.nextTick (/srv/node_modules/@grpc/grpc-js/build/src/call-stream.js:71:22)
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)"  

It’s very similar to the stacktrace mentioned in the issue #536 but with no code, details, metadata and note, wich makes it even harder to debug. The first thing my function does is to log the user being created, and not even that appeared on the log. Other times the log message appears but it seems as it is interrupted in the middle of execution, with the same stacktrace. I’ve got it in other firestore triggers as well, but in the createUser seems to happen more frequently.

Cloud Firestore Location: us-east1 Cloud Functions Region: us-central1

Maybe this helps: insertId: “000000-03c08893-7a26-4f9e-a473-eb968a219339”
labels.“execution_id”=“728641127513661” trace: “projects/beer-awards-platform/traces/c7074db5ea3c72b6f9a9700b5e1a21fd”

Were you able to successfully deploy your functions?

Yes

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 19 (1 by maintainers)

Most upvoted comments

I’ve let the team know that some developers are experiencing this issue in us-central1 region as well. I’ll be sure to provide updates.

I got it fixed by upgrading dependencies.

It looks like the issue you’re experiencing might be caused by a recent gRPC bug which has since been fixed.

The bug is fixed once your dependencies are using later versions than these: Firebase dependency └─┬ google-gax@1.7.4 └── @grpc/grpc-js@0.6.8