Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

auth.user().onCreate() fails with node: ../deps/uv/src/unix/epoll.c:312: uv__io_poll: Assertion `loop->watchers != NULL' failed.

未关闭
#2,361 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
firebase, nodejs

调研方向

先从提供的 handler functions.auth.user().onCreate() 和 auth-onRegistered 的 Google Cloud 日志入手,然后比较 Firebase Functions SDK 与 Cloud Functions v1 Node.js runtime 的版本。完成的标准是复现该 assertion 或确定其原因,并记录经过验证的 fix 或 workaround。

由索引模型根据 Issue 内容生成。

描述

api: auth
  • Operating System version: Firebase CloudFunctions NodeJS (v1)
  • Firebase SDK version: "firebase-functions": "^4.1.1"
  • Firebase Product: auth
  • Node.js version: CloudFunctions v1
  • NPM version: Deployed via firebase cli
[REQUIRED] Step 3: Describe the problem

I use the functions.auth.user().onCreate() hook to automatically create a database entry when a new user registers. However, this hook sometimes fails with the following log:
node: ../deps/uv/src/unix/epoll.c:312: uv__io_poll: Assertion loop->watchers != NULL' failed.`

Steps to reproduce:

Here is the google cloud log:

{
  "textPayload": "node: ../deps/uv/src/unix/epoll.c:312: uv__io_poll: Assertion `loop->watchers != NULL' failed.",
  "insertId": "653bb6a900030d36d8cf181a",
  "resource": {
    "type": "cloud_function",
    "labels": {
      "region": "us-central1",
      "project_id": "XXXXXXX",
      "function_name": "auth-onRegistered"
    }
  },
  "timestamp": "2023-10-27T13:10:01.199990Z",
  "labels": {
    "execution_id": "oxv3664a2uje",
    "instance_id": "0037d6d5d3a7dcb74ae305ac7f40db1ec80f2048dd7c521217f638a659a3eca90a6fedc99509a9e10073d7934b12ba2cee8da5050c465062e73cf2d98207d9a4bb1c"
  },
  "logName": "projects/XXXXXXX/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
  "trace": "projects/XXXXXXX/traces/be85c3c2262f49dfc8dd2f0645bfe485",
  "receiveTimestamp": "2023-10-27T13:10:01.539668946Z"
}
Relevant Code:

This is my code:

export default functions.runWith({ memory: "256MB", minInstances: 1 }).auth.user().onCreate(async (user) => {
    await usersCollection.doc(user.uid).set({
        'registeredAt': FieldValue.serverTimestamp(),
        'profile': {
            'name': '',
            'image': null,
        }
    });
});
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
5 天 6 小时
30 天内合并 PR
11

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-admin-node 的其他 Issue

查看 firebase/firebase-admin-node 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。