firebase / firebase/firebase-admin-node

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 查看
api: auth
主要语言
TypeScript
星标
1.7k
派生
419
平均合并
3 天 10 小时
30 天内合并 PR
16

描述

* 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,
}
});
});
```

贡献指南

打开贡献指南

调研方向

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

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

评估

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

把新 issue 发到你的邮箱

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